Java Doc for ComponentHelper.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.ComponentHelper

ComponentHelper
public class ComponentHelper (Code)
Component creation and configuration. The class is based around handing component definitions in an AntTypeTable. The old task/type methods have been kept for backward compatibly. Project will just delegate its calls to this class. A very simple hook mechanism is provided that allows users to plug in custom code. It is also possible to replace the default behavior ( for example in an app embedding ant )
since:
   Ant1.6


Field Summary
final public static  StringCOMPONENT_HELPER_REFERENCE
    

Constructor Summary
protected  ComponentHelper()
     Creates a new ComponentHelper instance.

Method Summary
public  voidaddDataTypeDefinition(String typeName, Class typeClass)
     Adds a new datatype definition. Attempting to override an existing definition with an equivalent one (i.e.
public  voidaddDataTypeDefinition(AntTypeDefinition def)
     Describe addDataTypeDefinition method here.
public  voidaddTaskDefinition(String taskName, Class taskClass)
     Adds a new task definition to the project. Attempting to override an existing definition with an equivalent one (i.e.
public  voidcheckTaskClass(Class taskClass)
     Checks whether or not a class is suitable for serving as Ant task. Ant task implementation classes must be public, concrete, and have a no-arg constructor.
Parameters:
  taskClass - The class to be checked.Must not be null.
exception:
  BuildException - if the class is unsuitable for being an Anttask.
public  ObjectcreateComponent(UnknownElement ue, String ns, String componentType)
     Factory method to create the components. This should be called by UnknownElement.
Parameters:
  ue - The Unknown Element creating this component.
Parameters:
  ns - Namespace URI.
public  ObjectcreateComponent(String componentName)
     Create an object for a component.
Parameters:
  componentName - the name of the component, ifthe component is in a namespace, thename is prefixed with the namespace uri and ":".
public  ObjectcreateDataType(String typeName)
     Creates a new instance of a data type.
Parameters:
  typeName - The name of the data type to create an instance of.Must not be null.
public  TaskcreateTask(String taskType)
     Creates a new instance of a task. Called from Project.createTask(), which can be called by tasks.
Parameters:
  taskType - The name of the task to create an instance of.Must not be null.
public  StringdiagnoseCreationFailure(String componentName, String type)
     Handler called to do decent diagnosis on instantiation failure.
public  voidenterAntLib(String uri)
     Called at the start of processing an antlib.
public  voidexitAntLib()
     Called at the end of processing an antlib.
public  HashtablegetAntTypeTable()
     Returns the current datatype definition hashtable.
public  ClassgetComponentClass(String componentName)
     Return the class of the component name.
Parameters:
  componentName - the name of the component, ifthe component is in a namespace, thename is prefixed with the namespace uri and ":".
public static  ComponentHelpergetComponentHelper(Project project)
     Find a project component for a specific project, creating it if it does not exist.
Parameters:
  project - the project.
public  StringgetCurrentAntlibUri()
    
public  HashtablegetDataTypeDefinitions()
     Returns the current type definition hashtable.
public  AntTypeDefinitiongetDefinition(String componentName)
     Return the antTypeDefinition for a componentName.
Parameters:
  componentName - the name of the component.
public  StringgetElementName(Object element)
     Returns a description of the type of the given element.

This is useful for logging purposes.
Parameters:
  element - The element to describe.Must not be null.

public  StringgetElementName(Object o, boolean brief)
     Returns a description of the type of the given element.

This is useful for logging purposes.
Parameters:
  o - The element to describe.Must not be null.
Parameters:
  brief - whether to use a brief description.

public static  StringgetElementName(Project p, Object o, boolean brief)
     Convenient way to get some element name even when you may not have a Project context.
Parameters:
  p - The optional Project instance.
Parameters:
  o - The element to describe.Must not be null.
Parameters:
  brief - whether to use a brief description.
public  ComponentHelpergetNext()
     Get the next chained component helper.
public  HashtablegetTaskDefinitions()
     Returns the current task definition hashtable.
public  voidinitDefaultDefinitions()
     This method is initialization code implementing the original ant component loading from /org/apache/tools/ant/taskdefs/default.properties and /org/apache/tools/ant/types/default.properties.
public  voidinitSubProject(ComponentHelper helper)
     Used with creating child projects.
public  voidsetNext(ComponentHelper next)
     Set the next chained component helper.
public  voidsetProject(Project project)
     Sets the project for this component helper.

Field Detail
COMPONENT_HELPER_REFERENCE
final public static String COMPONENT_HELPER_REFERENCE(Code)
reference under which we register ourselves with a project -




Constructor Detail
ComponentHelper
protected ComponentHelper()(Code)
Creates a new ComponentHelper instance.




Method Detail
addDataTypeDefinition
public void addDataTypeDefinition(String typeName, Class typeClass)(Code)
Adds a new datatype definition. Attempting to override an existing definition with an equivalent one (i.e. with the same classname) results in a verbose log message. Attempting to override an existing definition with a different one results in a warning log message, but the definition is changed.
Parameters:
  typeName - The name of the datatype.Must not be null.
Parameters:
  typeClass - The full name of the class implementing the datatype.Must not be null.



addDataTypeDefinition
public void addDataTypeDefinition(AntTypeDefinition def)(Code)
Describe addDataTypeDefinition method here.
Parameters:
  def - an AntTypeDefinition value.



addTaskDefinition
public void addTaskDefinition(String taskName, Class taskClass)(Code)
Adds a new task definition to the project. Attempting to override an existing definition with an equivalent one (i.e. with the same classname) results in a verbose log message. Attempting to override an existing definition with a different one results in a warning log message.
Parameters:
  taskName - The name of the task to add.Must not be null.
Parameters:
  taskClass - The full name of the class implementing the task.Must not be null.
exception:
  BuildException - if the class is unsuitable for being an Anttask. An error level message is logged beforethis exception is thrown.
See Also:   ComponentHelper.checkTaskClass(Class)



checkTaskClass
public void checkTaskClass(Class taskClass) throws BuildException(Code)
Checks whether or not a class is suitable for serving as Ant task. Ant task implementation classes must be public, concrete, and have a no-arg constructor.
Parameters:
  taskClass - The class to be checked.Must not be null.
exception:
  BuildException - if the class is unsuitable for being an Anttask. An error level message is logged beforethis exception is thrown.



createComponent
public Object createComponent(UnknownElement ue, String ns, String componentType) throws BuildException(Code)
Factory method to create the components. This should be called by UnknownElement.
Parameters:
  ue - The Unknown Element creating this component.
Parameters:
  ns - Namespace URI. Also available as ue.getNamespace().
Parameters:
  componentType - The component type,Also available as ue.getComponentName(). the created component.
throws:
  BuildException - if an error occurs.



createComponent
public Object createComponent(String componentName)(Code)
Create an object for a component.
Parameters:
  componentName - the name of the component, ifthe component is in a namespace, thename is prefixed with the namespace uri and ":". the class if found or null if not.



createDataType
public Object createDataType(String typeName) throws BuildException(Code)
Creates a new instance of a data type.
Parameters:
  typeName - The name of the data type to create an instance of.Must not be null. an instance of the specified data type, or null ifthe data type name is not recognised.
exception:
  BuildException - if the data type name is recognised butinstance creation fails.



createTask
public Task createTask(String taskType) throws BuildException(Code)
Creates a new instance of a task. Called from Project.createTask(), which can be called by tasks.
Parameters:
  taskType - The name of the task to create an instance of.Must not be null. an instance of the specified task, or null ifthe task name is not recognised.
exception:
  BuildException - if the task name is recognised but taskcreation fails.



diagnoseCreationFailure
public String diagnoseCreationFailure(String componentName, String type)(Code)
Handler called to do decent diagnosis on instantiation failure.
Parameters:
  componentName - component name.
Parameters:
  type - component type, used in error messages a string containing as much diagnostics info as possible.



enterAntLib
public void enterAntLib(String uri)(Code)
Called at the start of processing an antlib.
Parameters:
  uri - the uri that is associated with this antlib.



exitAntLib
public void exitAntLib()(Code)
Called at the end of processing an antlib.



getAntTypeTable
public Hashtable getAntTypeTable()(Code)
Returns the current datatype definition hashtable. The returned hashtable is "live" and so should not be modified. a map of from datatype name to implementing class(String to Class).



getComponentClass
public Class getComponentClass(String componentName)(Code)
Return the class of the component name.
Parameters:
  componentName - the name of the component, ifthe component is in a namespace, thename is prefixed with the namespace uri and ":". the class if found or null if not.



getComponentHelper
public static ComponentHelper getComponentHelper(Project project)(Code)
Find a project component for a specific project, creating it if it does not exist.
Parameters:
  project - the project. the project component for a specific project.



getCurrentAntlibUri
public String getCurrentAntlibUri()(Code)
the current antlib uri.



getDataTypeDefinitions
public Hashtable getDataTypeDefinitions()(Code)
Returns the current type definition hashtable. The returned hashtable is "live" and so should not be modified. a map of from type name to implementing class(String to Class).



getDefinition
public AntTypeDefinition getDefinition(String componentName)(Code)
Return the antTypeDefinition for a componentName.
Parameters:
  componentName - the name of the component. the ant definition or null if not present.



getElementName
public String getElementName(Object element)(Code)
Returns a description of the type of the given element.

This is useful for logging purposes.
Parameters:
  element - The element to describe.Must not be null. a description of the element type.
since:
   Ant 1.6




getElementName
public String getElementName(Object o, boolean brief)(Code)
Returns a description of the type of the given element.

This is useful for logging purposes.
Parameters:
  o - The element to describe.Must not be null.
Parameters:
  brief - whether to use a brief description. a description of the element type.
since:
   Ant 1.7




getElementName
public static String getElementName(Project p, Object o, boolean brief)(Code)
Convenient way to get some element name even when you may not have a Project context.
Parameters:
  p - The optional Project instance.
Parameters:
  o - The element to describe.Must not be null.
Parameters:
  brief - whether to use a brief description. a description of the element type.
since:
   Ant 1.7



getNext
public ComponentHelper getNext()(Code)
Get the next chained component helper. the next chained component helper.



getTaskDefinitions
public Hashtable getTaskDefinitions()(Code)
Returns the current task definition hashtable. The returned hashtable is "live" and so should not be modified. a map of from task name to implementing class(String to Class).



initDefaultDefinitions
public void initDefaultDefinitions()(Code)
This method is initialization code implementing the original ant component loading from /org/apache/tools/ant/taskdefs/default.properties and /org/apache/tools/ant/types/default.properties.



initSubProject
public void initSubProject(ComponentHelper helper)(Code)
Used with creating child projects. Each child project inherits the component definitions from its parent.
Parameters:
  helper - the component helper of the parent project.



setNext
public void setNext(ComponentHelper next)(Code)
Set the next chained component helper.
Parameters:
  next - the next chained component helper.



setProject
public void setProject(Project project)(Code)
Sets the project for this component helper.
Parameters:
  project - the project for this helper.



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.