| java.lang.Object org.apache.tools.ant.module.api.IntrospectedInfo
IntrospectedInfo | final public class IntrospectedInfo (Code) | | Represents Ant-style introspection info for a set of classes.
There should be one instance which is loaded automatically
from defaults.properties files, i.e. standard tasks/datatypes.
A second is loaded from settings and represents custom tasks/datatypes.
Uses Ant's IntrospectionHelper for the actual work, but manages the results
and makes them safely serializable (stores only classnames, etc.).
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 )
|
Method Summary | |
public void | addChangeListener(ChangeListener l) Add a listener to changes in the definition set. | public Map<String, String> | getAttributes(String clazz) Get all attributes supported by this class. | public static synchronized IntrospectedInfo | getDefaults() Get default definitions specified by Ant's defaults.properties. | public Map<String, String> | getDefs(String kind) Get definitions.
Parameters: kind - the kind of definition, e.g. | public Map<String, String> | getElements(String clazz) Get all subelements supported by this class. | public static synchronized IntrospectedInfo | getKnownInfo() Get all known introspected definitions.
Includes all those in
IntrospectedInfo.getDefaults plus custom definitions
encountered in actual build scripts (details unspecified).
a set of all known definitions, e.g. | public String[] | getTags(String clazz) Get tags represented by this class if it is an EnumeratedAttribute . | public boolean | isKnown(String clazz) | public synchronized void | register(String name, Class clazz, String kind) Register a new definition.
May change the defined task/type for a given name, but
will not redefine structure if classes are modified.
Also any class definitions contained in the default map (if not this one)
are just ignored; you should refer to the default map for info on them.
Throws various errors if the class could not be resolved, e.g. | public void | removeChangeListener(ChangeListener l) Remove a listener to changes in the definition set. | public void | scanProject(Map<String, Map<String, Class>> defs) Scan an existing (already-run) project to see if it has any new tasks/types. | public boolean | supportsText(String clazz) | public String | toString() | public synchronized void | unregister(String name, String kind) Unregister a definition. |
IntrospectedInfo | public IntrospectedInfo()(Code) | | Make new empty set of info.
|
addChangeListener | public void addChangeListener(ChangeListener l)(Code) | | Add a listener to changes in the definition set.
Parameters: l - the listener to add since: 2.6 |
getDefaults | public static synchronized IntrospectedInfo getDefaults()(Code) | | Get default definitions specified by Ant's defaults.properties.
the singleton defaults |
getDefs | public Map<String, String> getDefs(String kind)(Code) | | Get definitions.
Parameters: kind - the kind of definition, e.g. task an immutable map from definition names to class names |
getKnownInfo | public static synchronized IntrospectedInfo getKnownInfo()(Code) | | Get all known introspected definitions.
Includes all those in
IntrospectedInfo.getDefaults plus custom definitions
encountered in actual build scripts (details unspecified).
a set of all known definitions, e.g. of tasks and types since: 2.14 |
getTags | public String[] getTags(String clazz) throws IllegalArgumentException(Code) | | Get tags represented by this class if it is an EnumeratedAttribute .
Parameters: clazz - the class name a list of tag names, or null if the class is not a subclass of EnumeratedAttribute throws: IllegalArgumentException - if the class is unknown since: org.apache.tools.ant.module/3 3.3 |
isKnown | public boolean isKnown(String clazz)(Code) | | Is anything known about this class?
Parameters: clazz - the class name true if it is known, false if never encountered |
register | public synchronized void register(String name, Class clazz, String kind)(Code) | | Register a new definition.
May change the defined task/type for a given name, but
will not redefine structure if classes are modified.
Also any class definitions contained in the default map (if not this one)
are just ignored; you should refer to the default map for info on them.
Throws various errors if the class could not be resolved, e.g. NoClassDefFoundError.
Parameters: name - name of the task or type as it appears in scripts Parameters: clazz - the implementing class Parameters: kind - the kind of definition to register (task or type currently) since: 2.4 |
removeChangeListener | public void removeChangeListener(ChangeListener l)(Code) | | Remove a listener to changes in the definition set.
Parameters: l - the listener to remove since: 2.6 |
scanProject | public void scanProject(Map<String, Map<String, Class>> defs)(Code) | | Scan an existing (already-run) project to see if it has any new tasks/types.
Any new definitions found will automatically be added to the known list.
This will try to change existing definitions in the custom set, i.e.
if a task is defined to be implemented with a different class, or if a
class changes structure.
Will not try to define anything contained in the defaults list.
Parameters: defs - map from kinds to maps from names to classes |
unregister | public synchronized void unregister(String name, String kind)(Code) | | Unregister a definition.
Removes it from the definition mapping, though structural
information about the implementing class (and classes referenced
by that class) will not be removed.
If the definition was not registered before, does nothing.
Parameters: name - the definition name Parameters: kind - the kind of definition (task etc.) since: 2.4 |
|
|