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

All known Subclasses:   org.apache.tools.ant.helper.ProjectHelper2,  org.apache.tools.ant.helper.ProjectHelperImpl,
ProjectHelper
public class ProjectHelper (Code)
Configures a Project (complete with Targets and Tasks) based on a XML build file. It'll rely on a plugin to do the actual processing of the xml file. This class also provide static wrappers for common introspection. All helper plugins must provide backward compatibility with the original ant patterns, unless a different behavior is explicitly specified. For example, if namespace is used on the <project> tag the helper can expect the entire build file to be namespace-enabled. Namespaces or helper-specific tags can provide meta-information to the helper, allowing it to use new ( or different policies ). However, if no namespace is used the behavior should be exactly identical with the default helper.


Field Summary
final public static  StringANTLIB_URI
    
final public static  StringANT_CORE_URI
    
final public static  StringANT_CURRENT_URI
    
final public static  StringANT_TYPE
    
final public static  StringHELPER_PROPERTY
     Name of JVM system property which provides the name of the ProjectHelper class to use.
final public static  StringPROJECTHELPER_REFERENCE
    
final public static  StringSERVICE_ID
     The service identifier in jars which provide Project Helper implementations.

Constructor Summary
public  ProjectHelper()
    

Method Summary
public static  BuildExceptionaddLocationToBuildException(BuildException ex, Location newLocation)
     Add location to build exception.
Parameters:
  ex - the build exception, if the build exceptiondoes not include
Parameters:
  newLocation - the location of the calling task (may be null) a new build exception based in the build exception withlocation set to newLocation.
public static  voidaddText(Project project, Object target, char[] buf, int start, int count)
     Adds the content of #PCDATA sections to an element.
public static  voidaddText(Project project, Object target, String text)
     Adds the content of #PCDATA sections to an element.
public static  voidconfigure(Object target, AttributeList attrs, Project project)
     Configures an object using an introspection handler.
public static  voidconfigureProject(Project project, File buildFile)
     Configures the project with the contents of the specified XML file.
Parameters:
  project - The project to configure.
public static  StringextractNameFromComponentName(String componentName)
    
public static  StringextractUriFromComponentName(String componentName)
    
public static  StringgenComponentName(String uri, String name)
     Map a namespaced {uri,name} to an internal string format.
public static  ClassLoadergetContextClassLoader()
     JDK1.1 compatible access to the context class loader.
public  VectorgetImportStack()
     EXPERIMENTAL WILL_CHANGE Import stack. Used to keep track of imported files.
public static  ProjectHelpergetProjectHelper()
     Discovers a project helper instance.
public  voidparse(Project project, Object source)
     Parses the project file, configuring the project as it goes.
Parameters:
  project - The project for the resulting ProjectHelper to configure.Must not be null.
Parameters:
  source - The source for XML configuration.
public static  voidparsePropertyString(String value, Vector fragments, Vector propertyRefs)
     Parses a string containing ${xxx} style property references into two lists.
public static  StringreplaceProperties(Project project, String value)
     Replaces ${xxx} style constructions in the given value with the string value of the corresponding properties.
public static  StringreplaceProperties(Project project, String value, Hashtable keys)
     Replaces ${xxx} style constructions in the given value with the string value of the corresponding data types.
Parameters:
  project - The container project.
public static  voidstoreChild(Project project, Object parent, Object child, String tag)
     Stores a configured child element within its parent object.

Field Detail
ANTLIB_URI
final public static String ANTLIB_URI(Code)
The URI for defined types/tasks - the format is antlib:



ANT_CORE_URI
final public static String ANT_CORE_URI(Code)
The URI for ant name space



ANT_CURRENT_URI
final public static String ANT_CURRENT_URI(Code)
The URI for antlib current definitions



ANT_TYPE
final public static String ANT_TYPE(Code)
Polymorphic attribute



HELPER_PROPERTY
final public static String HELPER_PROPERTY(Code)
Name of JVM system property which provides the name of the ProjectHelper class to use.



PROJECTHELPER_REFERENCE
final public static String PROJECTHELPER_REFERENCE(Code)
name of project helper reference that we add to a project



SERVICE_ID
final public static String SERVICE_ID(Code)
The service identifier in jars which provide Project Helper implementations.




Constructor Detail
ProjectHelper
public ProjectHelper()(Code)
Default constructor




Method Detail
addLocationToBuildException
public static BuildException addLocationToBuildException(BuildException ex, Location newLocation)(Code)
Add location to build exception.
Parameters:
  ex - the build exception, if the build exceptiondoes not include
Parameters:
  newLocation - the location of the calling task (may be null) a new build exception based in the build exception withlocation set to newLocation. If the original exceptiondid not have a location, just return the build exception



addText
public static void addText(Project project, Object target, char[] buf, int start, int count) throws BuildException(Code)
Adds the content of #PCDATA sections to an element.
Parameters:
  project - The project containing the target.Must not be null.
Parameters:
  target - The target object to be configured.Must not be null.
Parameters:
  buf - A character array of the text within the element.Will not be null.
Parameters:
  start - The start element in the array.
Parameters:
  count - The number of characters to read from the array.
exception:
  BuildException - if the target object doesn't accept text



addText
public static void addText(Project project, Object target, String text) throws BuildException(Code)
Adds the content of #PCDATA sections to an element.
Parameters:
  project - The project containing the target.Must not be null.
Parameters:
  target - The target object to be configured.Must not be null.
Parameters:
  text - Text to add to the target.May be null, in which case thismethod call is a no-op.
exception:
  BuildException - if the target object doesn't accept text



configure
public static void configure(Object target, AttributeList attrs, Project project) throws BuildException(Code)
Configures an object using an introspection handler.
Parameters:
  target - The target object to be configured.Must not be null.
Parameters:
  attrs - A list of attributes to configure within the target.Must not be null.
Parameters:
  project - The project containing the target.Must not be null.
exception:
  BuildException - if any of the attributes can't be handled bythe target



configureProject
public static void configureProject(Project project, File buildFile) throws BuildException(Code)
Configures the project with the contents of the specified XML file.
Parameters:
  project - The project to configure. Must not be null.
Parameters:
  buildFile - An XML file giving the project's configuration.Must not be null.
exception:
  BuildException - if the configuration is invalid or cannotbe read



extractNameFromComponentName
public static String extractNameFromComponentName(String componentName)(Code)
extract the element name from a component name
Parameters:
  componentName - The stringified form for {uri, name} The element name of the component



extractUriFromComponentName
public static String extractUriFromComponentName(String componentName)(Code)
extract a uri from a component name
Parameters:
  componentName - The stringified form for {uri, name} The uri or "" if not present



genComponentName
public static String genComponentName(String uri, String name)(Code)
Map a namespaced {uri,name} to an internal string format. For BC purposes the names from the ant core uri will be mapped to "name", other names will be mapped to uri + ":" + name.
Parameters:
  uri - The namepace URI
Parameters:
  name - The localname The stringified form of the ns name



getContextClassLoader
public static ClassLoader getContextClassLoader()(Code)
JDK1.1 compatible access to the context class loader. Cut&paste from JAXP. the current context class loader, or nullif the context class loader is unavailable.



getImportStack
public Vector getImportStack()(Code)
EXPERIMENTAL WILL_CHANGE Import stack. Used to keep track of imported files. Error reporting should display the import path. the stack of import source objects.



getProjectHelper
public static ProjectHelper getProjectHelper() throws BuildException(Code)
Discovers a project helper instance. Uses the same patterns as JAXP, commons-logging, etc: a system property, a JDK1.3 service discovery, default. a ProjectHelper, either a custom implementationif one is available and configured, or the default implementationotherwise.
exception:
  BuildException - if a specified helper class cannotbe loaded/instantiated.



parse
public void parse(Project project, Object source) throws BuildException(Code)
Parses the project file, configuring the project as it goes.
Parameters:
  project - The project for the resulting ProjectHelper to configure.Must not be null.
Parameters:
  source - The source for XML configuration. A helper must supportat least File, for backward compatibility. Helpers maysupport URL, InputStream, etc or specialized types.
since:
   Ant1.5
exception:
  BuildException - if the configuration is invalid or cannotbe read



parsePropertyString
public static void parsePropertyString(String value, Vector fragments, Vector propertyRefs) throws BuildException(Code)
Parses a string containing ${xxx} style property references into two lists. The first list is a collection of text fragments, while the other is a set of string property names. null entries in the first list indicate a property reference from the second list.
Parameters:
  value - Text to parse. Must not be null.
Parameters:
  fragments - List to add text fragments to.Must not be null.
Parameters:
  propertyRefs - List to add property names to.Must not be null.
exception:
  BuildException - if the string contains an opening${ without a closing}



replaceProperties
public static String replaceProperties(Project project, String value) throws BuildException(Code)
Replaces ${xxx} style constructions in the given value with the string value of the corresponding properties.
Parameters:
  project - The project containing the properties to replace.Must not be null.
Parameters:
  value - The string to be scanned for property references.May be null.
exception:
  BuildException - if the string contains an opening${ without a closing} the original string with the properties replaced, ornull if the original string is null.
since:
   1.5



replaceProperties
public static String replaceProperties(Project project, String value, Hashtable keys) throws BuildException(Code)
Replaces ${xxx} style constructions in the given value with the string value of the corresponding data types.
Parameters:
  project - The container project. This is used solely forlogging purposes. Must not be null.
Parameters:
  value - The string to be scanned for property references.May be null, in which case thismethod returns immediately with no effect.
Parameters:
  keys - Mapping (String to String) of property names to theirvalues. Must not be null.
exception:
  BuildException - if the string contains an opening${ without a closing} the original string with the properties replaced, ornull if the original string is null.



storeChild
public static void storeChild(Project project, Object parent, Object child, String tag)(Code)
Stores a configured child element within its parent object.
Parameters:
  project - Project containing the objects.May be null.
Parameters:
  parent - Parent object to add child to.Must not be null.
Parameters:
  child - Child object to store in parent.Should not be null.
Parameters:
  tag - Name of element which generated the child.May be null, in which casethe child is not stored.



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.