org.apache.ivy.util
public class Configurator extends Object
This configurator is used to configure elements (initialised with setRoot) using the behaviour defined by ant for its tasks.
Example (based on Ant Example):
Configurator conf = new Configurator(); conf.typeDef("buildpath", "Sample$BuildPath"); conf.typeDef("xinterface", "Sample$XInterface"); Sample.MyFileSelector mfs = new Sample.MyFileSelector(); conf.setRoot(mfs); conf.startCreateChild("buildpath"); conf.setAttribute("path", "."); conf.setAttribute("url", "abc"); conf.startCreateChild("xinterface"); conf.setAttribute("count", "4"); conf.endCreateChild(); // xinterface conf.endCreateChild(); // buildpath
Nested Class Summary | |
---|---|
static class | Configurator.Attribute |
static class | Configurator.Element |
static class | Configurator.Macro |
static class | Configurator.MacroDef |
static class | Configurator.MacroRecord |
Method Summary | |
---|---|
void | addChild(String name, Object child) |
void | addConfiguredMacrodef(Configurator.MacroDef macrodef) |
void | addMacroAttribute(String attName, String attDefaultValue) |
void | addMacroElement(String elementName, boolean optional) |
void | addText(String text) |
void | clear() |
Object | endCreateChild() |
void | endMacroDef() |
Object | getCurrent() |
int | getDepth() |
FileResolver | getFileResolver() |
Class | getTypeDef(String name) |
boolean | isTopLevelMacroRecord() |
void | setAttribute(String attributeName, String value) |
void | setFileResolver(FileResolver fileResolver) |
void | setRoot(Object root) |
Object | startCreateChild(String name) |
Configurator.MacroDef | startMacroDef(String macroName) |
void | typeDef(String name, String className) |
void | typeDef(String name, Class clazz) |
Returns: the finished child