Browse Source

New attribute: <xmlproperty delimiter=""/>

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@587855 13f79535-47bb-0310-9956-ffa450edef68
master
Jan Materne 17 years ago
parent
commit
48fd705167
2 changed files with 15 additions and 1 deletions
  1. +5
    -0
      docs/manual/CoreTasks/xmlproperty.html
  2. +10
    -1
      src/main/org/apache/tools/ant/taskdefs/XmlProperty.java

+ 5
- 0
docs/manual/CoreTasks/xmlproperty.html View File

@@ -146,6 +146,11 @@ is roughly equivalent to the following fragments in a build.xml file:
if <i>semanticAttributes</i> is not set to <i>true</i>.</td>
<td valign="top" align="center">No, default is <i>${basedir}</i>.</td>
</tr>
<tr>
<td valign="top">delimiter</td>
<td valign="top">Delimiter for splitting multiple values.<br><i>since Ant 1.7.1</i></td>
<td valign="top" align="center">No, defaults to comma</td>
</tr>
</table>

<h3><a name="nested">Nested Elements</a></h3>


+ 10
- 1
src/main/org/apache/tools/ant/taskdefs/XmlProperty.java View File

@@ -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;
}
}

Loading…
Cancel
Save