public final class IntrospectedInfo extends Object
All task and type names may be namespace-qualified for use
in Ant 1.6: a name of the form nsuri:localname
refers to
an XML element with namespace nsuri
and local name localname
.
Attribute names could also be similarly qualified, but in practice attributes
used in Ant never have a defined namespace. The prefix antlib:org.apache.tools.ant:
is implied, not expressed, on Ant core element names (for backwards compatibility).
Subelement names are *not* namespace-qualified here, even though in the script
they would be - because the namespace used in the script will actually vary
according to how an antlib is imported and used. An unqualified subelement name
should be understood to inherit a namespace from its parent element.
(Namespace support since org.apache.tools.ant.module/3 3.6
)
Constructor and Description |
---|
IntrospectedInfo()
Make new empty set of info.
|
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(ChangeListener l)
Add a listener to changes in the definition set.
|
Map<String,String> |
getAttributes(String clazz)
Get all attributes supported by this class.
|
static IntrospectedInfo |
getDefaults()
Get default definitions specified by Ant's defaults.properties.
|
Map<String,String> |
getDefs(String kind)
Get definitions.
|
Map<String,String> |
getElements(String clazz)
Get all subelements supported by this class.
|
static IntrospectedInfo |
getKnownInfo()
Get all known introspected definitions.
|
String[] |
getTags(String clazz)
Get tags represented by this class if it is an
EnumeratedAttribute . |
boolean |
isKnown(String clazz)
Is anything known about this class?
|
void |
register(String name,
Class clazz,
String kind)
Register a new definition.
|
void |
removeChangeListener(ChangeListener l)
Remove a listener to changes in the definition set.
|
void |
scanProject(Map<String,Map<String,Class>> defs)
Scan an existing (already-run) project to see if it has any new tasks/types.
|
boolean |
supportsText(String clazz)
Does this class support inserting text data?
|
String |
toString() |
void |
unregister(String name,
String kind)
Unregister a definition.
|
public static IntrospectedInfo getDefaults()
public void addChangeListener(ChangeListener l)
l
- the listener to addpublic void removeChangeListener(ChangeListener l)
l
- the listener to removepublic Map<String,String> getDefs(String kind)
kind
- the kind of definition, e.g. task
public boolean isKnown(String clazz)
clazz
- the class namepublic boolean supportsText(String clazz) throws IllegalArgumentException
clazz
- the class nameIllegalArgumentException
- if the class is unknownpublic Map<String,String> getAttributes(String clazz) throws IllegalArgumentException
clazz
- the class nameIllegalArgumentException
- if the class is unknownpublic Map<String,String> getElements(String clazz) throws IllegalArgumentException
clazz
- the class nameIllegalArgumentException
- if the class is unknownpublic String[] getTags(String clazz) throws IllegalArgumentException
EnumeratedAttribute
.clazz
- the class nameEnumeratedAttribute
IllegalArgumentException
- if the class is unknownpublic void register(String name, Class clazz, String kind)
name
- name of the task or type as it appears in scriptsclazz
- the implementing classkind
- the kind of definition to register (task
or type
currently)public void unregister(String name, String kind)
name
- the definition namekind
- the kind of definition (task
etc.)public void scanProject(Map<String,Map<String,Class>> defs)
defs
- map from kinds to maps from names to classespublic static IntrospectedInfo getKnownInfo()
IntrospectedInfo.getDefaults()
plus custom definitions
encountered in actual build scripts (details unspecified).