Java Doc for IntrospectionHelper.java in  » Build » ANT » org » apache » tools » ant » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Build » ANT » org.apache.tools.ant 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.tools.ant.IntrospectionHelper

IntrospectionHelper
final public class IntrospectionHelper (Code)
Helper class that collects the methods a task or nested element holds to set attributes, create nested elements or hold PCDATA elements. The class is final as it has a private constructor.

Inner Class :final public static class Creator



Method Summary
public  voidaddText(Project project, Object element, String text)
     Adds PCDATA to an element, using the element's void addText(String) method, if it has one.
public static  voidclearCache()
     Clears the static cache of on build finished.
public  ObjectcreateElement(Project project, Object parent, String elementName)
     Creates a named nested element.
public  MethodgetAddTextMethod()
     Returns the addText method when the introspected class supports nested text.
public  MapgetAttributeMap()
     Returns a read-only map of attributes supported by the introspected class. an attribute name to attribute Classunmodifiable map.
public  MethodgetAttributeMethod(String attributeName)
     Returns the setter method of a named attribute.
Parameters:
  attributeName - The name of the attribute to find the settermethod of.
public  ClassgetAttributeType(String attributeName)
     Returns the type of a named attribute.
Parameters:
  attributeName - The name of the attribute to find the type of.Must not be null.
public  EnumerationgetAttributes()
     Returns an enumeration of the names of the attributes supported by the introspected class.
public  CreatorgetElementCreator(Project project, String parentUri, Object parent, String elementName, UnknownElement ue)
     returns an object that creates and stores an object for an element of a parent.
Parameters:
  project - Project to which the parent object belongs.
Parameters:
  parentUri - The namespace uri of the parent object.
Parameters:
  parent - Parent object used to create the creator object tocreate and store and instance of a subelement.
Parameters:
  elementName - Name of the element to create an instance of.
Parameters:
  ue - The unknown element associated with the element.
public  MethodgetElementMethod(String elementName)
     Returns the adder or creator method of a named nested element.
Parameters:
  elementName - The name of the attribute to find the settermethod of.
protected  StringgetElementName(Project project, Object element)
     Returns a description of the type of the given element in relation to a given project.
public  ClassgetElementType(String elementName)
     Returns the type of a named nested element.
Parameters:
  elementName - The name of the element to find the type of.Must not be null.
public  ListgetExtensionPoints()
     Returns a read-only list of extension points supported by the introspected class.

A task/type or nested element with void methods named add() or addConfigured(), taking a single class or interface argument, supports extensions point.

public static synchronized  IntrospectionHelpergetHelper(Class c)
     Returns a helper for the given class, either from the cache or by creating a new instance.
Parameters:
  c - The class for which a helper is required.Must not be null.
public static  IntrospectionHelpergetHelper(Project p, Class c)
     Returns a helper for the given class, either from the cache or by creating a new instance. The method will make sure the helper will be cleaned up at the end of the project, and only one instance will be created for each class.
Parameters:
  p - the project instance.
Parameters:
  c - The class for which a helper is required.Must not be null.
public  MapgetNestedElementMap()
     Returns a read-only map of nested elements supported by the introspected class. a nested-element name to nested-element Classunmodifiable map.
public  EnumerationgetNestedElements()
     Returns an enumeration of the names of the nested elements supported by the introspected class.
public  booleanisContainer()
     Indicates whether the introspected class is a task container, supporting arbitrary nested tasks/types.
public  booleanisDynamic()
     Indicates whether the introspected class is a dynamic one, supporting arbitrary nested elements and/or attributes.
public  voidsetAttribute(Project p, Object element, String attributeName, String value)
     Sets the named attribute in the given element, which is part of the given project.
Parameters:
  p - The project containing the element.
public  voidstoreElement(Project project, Object parent, Object child, String elementName)
     Stores a named nested element using a storage method determined by the initial introspection.
public  booleansupportsCharacters()
     Returns whether or not the introspected class supports PCDATA.
public  booleansupportsNestedElement(String elementName)
     Indicates if this element supports a nested element of the given name.
public  booleansupportsNestedElement(String parentUri, String elementName)
     Indicate if this element supports a nested element of the given name.
public  voidthrowNotSupported(Project project, Object parent, String elementName)
    



Method Detail
addText
public void addText(Project project, Object element, String text) throws BuildException(Code)
Adds PCDATA to an element, using the element's void addText(String) method, if it has one. If no such method is present, a BuildException is thrown if the given text contains non-whitespace.
Parameters:
  project - The project which the element is part of.Must not be null.
Parameters:
  element - The element to add the text to.Must not be null.
Parameters:
  text - The text to add.Must not be null.
exception:
  BuildException - if non-whitespace text is provided and nomethod is available to handle it, or ifthe handling method fails.



clearCache
public static void clearCache()(Code)
Clears the static cache of on build finished.



createElement
public Object createElement(Project project, Object parent, String elementName) throws BuildException(Code)
Creates a named nested element. Depending on the results of the initial introspection, either a method in the given parent instance or a simple no-arg constructor is used to create an instance of the specified element type.
Parameters:
  project - Project to which the parent object belongs.Must not be null. If the resultingobject is an instance of ProjectComponent, itsProject reference is set to this parameter value.
Parameters:
  parent - Parent object used to create the instance.Must not be null.
Parameters:
  elementName - Name of the element to create an instance of.Must not be null. an instance of the specified element type
exception:
  BuildException - if no method is available to create theelement instance, or if the creating methodfails.



getAddTextMethod
public Method getAddTextMethod() throws BuildException(Code)
Returns the addText method when the introspected class supports nested text. the method on this introspected class that adds nested text.Cannot be null.
throws:
  BuildException - if the introspected class does notsupport the nested text.
since:
   Ant 1.6.3



getAttributeMap
public Map getAttributeMap()(Code)
Returns a read-only map of attributes supported by the introspected class. an attribute name to attribute Classunmodifiable map. Can be empty, but never null.
since:
   Ant 1.6.3



getAttributeMethod
public Method getAttributeMethod(String attributeName) throws BuildException(Code)
Returns the setter method of a named attribute.
Parameters:
  attributeName - The name of the attribute to find the settermethod of. Must not be null. the method on this introspected class that sets this attribute.This will never be null.
throws:
  BuildException - if the introspected class does notsupport the named attribute.
since:
   Ant 1.6.3



getAttributeType
public Class getAttributeType(String attributeName) throws BuildException(Code)
Returns the type of a named attribute.
Parameters:
  attributeName - The name of the attribute to find the type of.Must not be null. the type of the attribute with the specified name.This will never be null.
exception:
  BuildException - if the introspected class does notsupport the named attribute.



getAttributes
public Enumeration getAttributes()(Code)
Returns an enumeration of the names of the attributes supported by the introspected class. an enumeration of the names of the attributes supportedby the introspected class.
See Also:   IntrospectionHelper.getAttributeMap



getElementCreator
public Creator getElementCreator(Project project, String parentUri, Object parent, String elementName, UnknownElement ue)(Code)
returns an object that creates and stores an object for an element of a parent.
Parameters:
  project - Project to which the parent object belongs.
Parameters:
  parentUri - The namespace uri of the parent object.
Parameters:
  parent - Parent object used to create the creator object tocreate and store and instance of a subelement.
Parameters:
  elementName - Name of the element to create an instance of.
Parameters:
  ue - The unknown element associated with the element. a creator object to create and store the element instance.



getElementMethod
public Method getElementMethod(String elementName) throws BuildException(Code)
Returns the adder or creator method of a named nested element.
Parameters:
  elementName - The name of the attribute to find the settermethod of. Must not be null. the method on this introspected class that adds or creates thisnested element. Can be null when the introspectedclass is a dynamic configurator!
throws:
  BuildException - if the introspected class does notsupport the named nested element.
since:
   Ant 1.6.3



getElementName
protected String getElementName(Project project, Object element)(Code)
Returns a description of the type of the given element in relation to a given project. This is used for logging purposes when the element is asked to cope with some data it has no way of handling.
Parameters:
  project - The project the element is defined in.Must not be null.
Parameters:
  element - The element to describe.Must not be null. a description of the element type



getElementType
public Class getElementType(String elementName) throws BuildException(Code)
Returns the type of a named nested element.
Parameters:
  elementName - The name of the element to find the type of.Must not be null. the type of the nested element with the specified name.This will never be null.
exception:
  BuildException - if the introspected class does notsupport the named nested element.



getExtensionPoints
public List getExtensionPoints()(Code)
Returns a read-only list of extension points supported by the introspected class.

A task/type or nested element with void methods named add() or addConfigured(), taking a single class or interface argument, supports extensions point. This method returns the list of all these void add[Configured](type) methods. a list of void, single argument add() or addConfigured()Methods of all supported extension points.These methods are sorted such that if the argument type of amethod derives from another type also an argument of a methodof this list, the method with the most derived argument willalways appear first. Can be empty, but never null.
since:
   Ant 1.6.3




getHelper
public static synchronized IntrospectionHelper getHelper(Class c)(Code)
Returns a helper for the given class, either from the cache or by creating a new instance.
Parameters:
  c - The class for which a helper is required.Must not be null. a helper for the specified class



getHelper
public static IntrospectionHelper getHelper(Project p, Class c)(Code)
Returns a helper for the given class, either from the cache or by creating a new instance. The method will make sure the helper will be cleaned up at the end of the project, and only one instance will be created for each class.
Parameters:
  p - the project instance.
Parameters:
  c - The class for which a helper is required.Must not be null. a helper for the specified class



getNestedElementMap
public Map getNestedElementMap()(Code)
Returns a read-only map of nested elements supported by the introspected class. a nested-element name to nested-element Classunmodifiable map. Can be empty, but never null.
since:
   Ant 1.6.3



getNestedElements
public Enumeration getNestedElements()(Code)
Returns an enumeration of the names of the nested elements supported by the introspected class. an enumeration of the names of the nested elements supportedby the introspected class.
See Also:   IntrospectionHelper.getNestedElementMap



isContainer
public boolean isContainer()(Code)
Indicates whether the introspected class is a task container, supporting arbitrary nested tasks/types. true if the introspected class is a container;false otherwise.
since:
   Ant 1.6.3
See Also:   TaskContainer



isDynamic
public boolean isDynamic()(Code)
Indicates whether the introspected class is a dynamic one, supporting arbitrary nested elements and/or attributes. true if the introspected class is dynamic;false otherwise.
since:
   Ant 1.6.3
See Also:   DynamicElement
See Also:   DynamicElementNS



setAttribute
public void setAttribute(Project p, Object element, String attributeName, String value) throws BuildException(Code)
Sets the named attribute in the given element, which is part of the given project.
Parameters:
  p - The project containing the element. This is used when filesneed to be resolved. Must not be null.
Parameters:
  element - The element to set the attribute in. Must not benull.
Parameters:
  attributeName - The name of the attribute to set. Must not benull.
Parameters:
  value - The value to set the attribute to. This may be interpretedor converted to the necessary type if the setter methoddoesn't just take a string. Must not be null.
exception:
  BuildException - if the introspected class doesn't supportthe given attribute, or if the settingmethod fails.



storeElement
public void storeElement(Project project, Object parent, Object child, String elementName) throws BuildException(Code)
Stores a named nested element using a storage method determined by the initial introspection. If no appropriate storage method is available, this method returns immediately.
Parameters:
  project - Ignored in this implementation.May be null.
Parameters:
  parent - Parent instance to store the child in.Must not be null.
Parameters:
  child - Child instance to store in the parent.Should not be null.
Parameters:
  elementName - Name of the child element to store.May be null, in which casethis method returns immediately.
exception:
  BuildException - if the storage method fails.



supportsCharacters
public boolean supportsCharacters()(Code)
Returns whether or not the introspected class supports PCDATA. whether or not the introspected class supports PCDATA.



supportsNestedElement
public boolean supportsNestedElement(String elementName)(Code)
Indicates if this element supports a nested element of the given name.
Parameters:
  elementName - the name of the nested element being checked true if the given nested element is supported



supportsNestedElement
public boolean supportsNestedElement(String parentUri, String elementName)(Code)
Indicate if this element supports a nested element of the given name.
Parameters:
  parentUri - the uri of the parent
Parameters:
  elementName - the name of the nested element being checked true if the given nested element is supported



throwNotSupported
public void throwNotSupported(Project project, Object parent, String elementName)(Code)
Utility method to throw a NotSupported exception
Parameters:
  project - the Project instance.
Parameters:
  parent - the object which doesn't support a requested element
Parameters:
  elementName - the name of the Element which is trying to be created.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.