Package org.apache.ivy.util
Class Configurator
java.lang.Object
org.apache.ivy.util.Configurator
Ant 1.6.1 like Configurator
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
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate FileResolverprivate Map<String,Configurator.MacroDef> private Stack<Configurator.ObjectDescriptor> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprivate ObjectaddChild(Configurator.ObjectDescriptor parentOD, Class<?> childClass, String name, Object child) voidaddConfiguredMacrodef(Configurator.MacroDef macrodef) voidaddMacroAttribute(String attName, String attDefaultValue) voidaddMacroElement(String elementName, boolean optional) voidvoidclear()voidintgetDepth()Class<?>getTypeDef(String name) booleanvoidsetAttribute(String attributeName, String value) private voidsetCurrent(Object object, String name) voidsetFileResolver(FileResolver fileResolver) voidstartCreateChild(String name) startMacroDef(String macroName) voidvoid
-
Field Details
-
fileResolver
-
typedefs
-
macrodefs
-
objectStack
-
TRUE_VALUES
-
-
Constructor Details
-
Configurator
public Configurator()
-
-
Method Details
-
typeDef
- Throws:
ClassNotFoundException
-
typeDef
-
setRoot
-
clear
public void clear() -
setCurrent
-
startCreateChild
-
addChild
-
addChild
private Object addChild(Configurator.ObjectDescriptor parentOD, Class<?> childClass, String name, Object child) throws InstantiationException, IllegalAccessException, InvocationTargetException -
isTopLevelMacroRecord
public boolean isTopLevelMacroRecord() -
setAttribute
-
addText
-
endCreateChild
- Returns:
- the finished child
-
getCurrent
-
getDepth
public int getDepth() -
startMacroDef
-
addMacroAttribute
-
addMacroElement
-
endMacroDef
public void endMacroDef() -
addConfiguredMacrodef
-
getTypeDef
-
getFileResolver
-
setFileResolver
-