From 48fd7051678e3acf2ed956dc22c6c73cdd117265 Mon Sep 17 00:00:00 2001 From: Jan Materne Date: Wed, 24 Oct 2007 11:26:02 +0000 Subject: [PATCH] New attribute: git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@587855 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/CoreTasks/xmlproperty.html | 5 +++++ .../org/apache/tools/ant/taskdefs/XmlProperty.java | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/manual/CoreTasks/xmlproperty.html b/docs/manual/CoreTasks/xmlproperty.html index 9839f496e..32b990e06 100644 --- a/docs/manual/CoreTasks/xmlproperty.html +++ b/docs/manual/CoreTasks/xmlproperty.html @@ -146,6 +146,11 @@ is roughly equivalent to the following fragments in a build.xml file: if semanticAttributes is not set to true. No, default is ${basedir}. + + delimiter + Delimiter for splitting multiple values.
since Ant 1.7.1 + No, defaults to comma +

Nested Elements

diff --git a/src/main/org/apache/tools/ant/taskdefs/XmlProperty.java b/src/main/org/apache/tools/ant/taskdefs/XmlProperty.java index a3ed9d5c8..ded670567 100644 --- a/src/main/org/apache/tools/ant/taskdefs/XmlProperty.java +++ b/src/main/org/apache/tools/ant/taskdefs/XmlProperty.java @@ -183,6 +183,7 @@ public class XmlProperty extends org.apache.tools.ant.Task { private File rootDirectory = null; private Hashtable addedAttributes = new Hashtable(); private XMLCatalog xmlCatalog = new XMLCatalog(); + private String delimiter = ","; private static final String ID = "id"; private static final String REF_ID = "refid"; @@ -474,7 +475,7 @@ public class XmlProperty extends org.apache.tools.ant.Task { // when we read them, though (instead of keeping them // outside of the project and batch adding them at the end) // to allow other properties to reference them. - value = (String) addedAttributes.get(name) + "," + value; + value = (String) addedAttributes.get(name) + getDelimiter() + value; getProject().setProperty(name, value); addedAttributes.put(name, value); } else if (getProject().getProperty(name) == null) { @@ -752,4 +753,12 @@ public class XmlProperty extends org.apache.tools.ant.Task { protected boolean supportsNonFileResources() { return getClass().equals(XmlProperty.class); } + + public String getDelimiter() { + return delimiter; + } + + public void setDelimiter(String delimiter) { + this.delimiter = delimiter; + } }