datatypes.xml

This AntLib contains tasks, types and macros to access specific Java classes / data types, found as object values of Ant properties. The macros are purely based on ModelAnt util / antlib.xml tasks.

Note that the ability to assign non-string values to Ant properties is provided by the ModelAnt util library.

Lists

The following are macros to support properties values as instances of java.util.List

list.add     Adds a property’s value form another list-valued property.
list.create     Store in a property a list of strings, that are the names of described Ant resources
list.remove     Remove a property’s value form another list-valued property.

Maps to list of values

The following are macros to support properties values as instances of java.util.Map<Object, java.util.List<?>>

map.create     Store in a property a map from object keys to sets of objects
map.get     Get the list value bound to a key. It could be null or a set of values
map.put     Bind a key to (one more) value in the string keys to sets of objects mapping
map.remove     Remove the key from the map.

String methods access

string.replace Call the String.replaceAll(regex, replacement) method on a property’s string value

Usage:

  1. Make sure ModelAnt or just modelant-util.jar is in the classpath
  2. Use <typedef resource=”net/mdatools/modelant/util/datatypes.xml”/>

See also

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.