Java Doc for Path.java in  » Build » ANT » org » apache » tools » ant » types » 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.types 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.tools.ant.types.DataType
   org.apache.tools.ant.types.Path

Path
public class Path extends DataType implements Cloneable,ResourceCollection(Code)
This object represents a path as used by CLASSPATH or PATH environment variable. A path might also be described as a collection of unique filesystem resources.

<sometask>
  <somepath>
    <pathelement location="/path/to/file.jar" />
    <pathelement path="/path/to/file2.jar:/path/to/class2;/path/to/class3" />
    <pathelement location="/path/to/file3.jar" />
    <pathelement location="/path/to/file4.jar" />
  </somepath>
</sometask>

The object implemention sometask must provide a method called createSomepath which returns an instance of Path. Nested path definitions are handled by the Path object and must be labeled pathelement.

The path element takes a parameter path which will be parsed and split into single elements. It will usually be used to define a path from an environment variable.


Inner Class :public class PathElement implements ResourceCollection

Field Summary
public static  PathsystemBootClasspath
     The system bootclasspath as a Path object.
public static  PathsystemClasspath
    

Constructor Summary
public  Path(Project p, String path)
     Invoked by IntrospectionHelper for setXXX(Path p) attribute setters.
public  Path(Project project)
     Construct an empty Path.

Method Summary
public  voidadd(Path path)
    
public  voidadd(ResourceCollection c)
     Add a nested ResourceCollection.
public  voidaddDirset(DirSet dset)
     Adds a nested <dirset> element.
public  voidaddExisting(Path source)
     Adds the components on the given path which exist to this Path.
public  voidaddExisting(Path source, boolean tryUserDir)
     Same as addExisting, but support classpath behavior if tryUserDir is true.
public  voidaddExtdirs(Path extdirs)
     Emulation of extdirs feature in java >= 1.2.
public  voidaddFilelist(FileList fl)
     Adds a nested <filelist> element.
public  voidaddFileset(FileSet fs)
     Adds a nested <fileset> element.
public  voidaddJavaRuntime()
     Add the Java Runtime classes to this Path instance.
public  voidappend(Path other)
     Append the contents of the other Path instance to this.
protected  ResourceCollectionassertFilesystemOnly(ResourceCollection rc)
     Verify the specified ResourceCollection is filesystem-only.
Parameters:
  rc - the ResourceCollection to check.
throws:
  BuildException - if rc is not filesystem-only.
public  Objectclone()
     Clone this Path.
public  PathconcatSystemBootClasspath(String defValue)
     Concatenates the system boot class path in the order specified by the ${build.sysclasspath} property - using the supplied value if ${build.sysclasspath} has not been set.
public  PathconcatSystemClasspath()
     Concatenates the system class path in the order specified by the ${build.sysclasspath} property - using "last" as default value.
public  PathconcatSystemClasspath(String defValue)
     Concatenates the system class path in the order specified by the ${build.sysclasspath} property - using the supplied value if ${build.sysclasspath} has not been set.
public  PathcreatePath()
     Creates a nested <path> element.
public  PathElementcreatePathElement()
     Creates the nested <pathelement> element.
protected synchronized  voiddieOnCircularReference(Stack stk, Project p)
     Overrides the version of DataType to recurse on all DataType child elements that may have been added.
public synchronized  booleanisFilesystemOnly()
     Fulfill the ResourceCollection contract.
final public synchronized  Iteratoriterator()
     Fulfill the ResourceCollection contract.
public  String[]list()
     Returns all path elements defined by this and nested path objects.
public  voidsetLocation(File location)
     Adds a element definition to the path.
public  voidsetPath(String path)
     Parses a path definition and creates single PathElements.
public  voidsetRefid(Reference r)
     Makes this instance in effect a reference to another Path instance.
public synchronized  intsize()
     Fulfill the ResourceCollection contract.
public  StringtoString()
     Returns a textual representation of the path, which can be used as CLASSPATH or PATH environment variable definition.
public static  StringtranslateFile(String source)
     Returns its argument with all file separator characters replaced so that they match the local OS conventions.
protected static  booleantranslateFileSep(StringBuffer buffer, int pos)
     Translates occurrences at a position of / or \ to correct separator of the current platform and returns whether it had to do a replacement.
public static  String[]translatePath(Project project, String source)
     Splits a PATH (with : or ; as separators) into its parts.

Field Detail
systemBootClasspath
public static Path systemBootClasspath(Code)
The system bootclasspath as a Path object.
since:
   Ant 1.6.2



systemClasspath
public static Path systemClasspath(Code)
The system classpath as a Path object




Constructor Detail
Path
public Path(Project p, String path)(Code)
Invoked by IntrospectionHelper for setXXX(Path p) attribute setters.
Parameters:
  p - the Project for this path.
Parameters:
  path - the String path definition.



Path
public Path(Project project)(Code)
Construct an empty Path.
Parameters:
  project - the Project for this path.




Method Detail
add
public void add(Path path) throws BuildException(Code)
Adds a nested path
Parameters:
  path - a Path to be added to the path
throws:
  BuildException - on error
since:
   Ant 1.6



add
public void add(ResourceCollection c)(Code)
Add a nested ResourceCollection.
Parameters:
  c - the ResourceCollection to add.
since:
   Ant 1.7



addDirset
public void addDirset(DirSet dset) throws BuildException(Code)
Adds a nested <dirset> element.
Parameters:
  dset - a DirSet to be added to the path
throws:
  BuildException - on error



addExisting
public void addExisting(Path source)(Code)
Adds the components on the given path which exist to this Path. Components that don't exist aren't added.
Parameters:
  source - - source path whose components are examined for existence



addExisting
public void addExisting(Path source, boolean tryUserDir)(Code)
Same as addExisting, but support classpath behavior if tryUserDir is true. Classpaths are relative to user dir, not the project base. That used to break jspc test
Parameters:
  source - the source path
Parameters:
  tryUserDir - if true try the user directory if the file is not present



addExtdirs
public void addExtdirs(Path extdirs)(Code)
Emulation of extdirs feature in java >= 1.2. This method adds all files in the given directories (but not in sub-directories!) to the classpath, so that you don't have to specify them all one by one.
Parameters:
  extdirs - - Path to append files to



addFilelist
public void addFilelist(FileList fl) throws BuildException(Code)
Adds a nested <filelist> element.
Parameters:
  fl - a FileList to be added to the path
throws:
  BuildException - on error



addFileset
public void addFileset(FileSet fs) throws BuildException(Code)
Adds a nested <fileset> element.
Parameters:
  fs - a FileSet to be added to the path
throws:
  BuildException - on error



addJavaRuntime
public void addJavaRuntime()(Code)
Add the Java Runtime classes to this Path instance.



append
public void append(Path other)(Code)
Append the contents of the other Path instance to this.
Parameters:
  other - a Path to be added to the path



assertFilesystemOnly
protected ResourceCollection assertFilesystemOnly(ResourceCollection rc)(Code)
Verify the specified ResourceCollection is filesystem-only.
Parameters:
  rc - the ResourceCollection to check.
throws:
  BuildException - if rc is not filesystem-only. the passed in ResourceCollection.



clone
public Object clone()(Code)
Clone this Path. Path with shallowly cloned Resource children.



concatSystemBootClasspath
public Path concatSystemBootClasspath(String defValue)(Code)
Concatenates the system boot class path in the order specified by the ${build.sysclasspath} property - using the supplied value if ${build.sysclasspath} has not been set.
Parameters:
  defValue - the order ("first", "last", "only") the concatenated path



concatSystemClasspath
public Path concatSystemClasspath()(Code)
Concatenates the system class path in the order specified by the ${build.sysclasspath} property - using "last" as default value. the concatenated path



concatSystemClasspath
public Path concatSystemClasspath(String defValue)(Code)
Concatenates the system class path in the order specified by the ${build.sysclasspath} property - using the supplied value if ${build.sysclasspath} has not been set.
Parameters:
  defValue - the order ("first", "last", "only") the concatenated path



createPath
public Path createPath() throws BuildException(Code)
Creates a nested <path> element. a Path to be configured
throws:
  BuildException - on error



createPathElement
public PathElement createPathElement() throws BuildException(Code)
Creates the nested <pathelement> element. the PathElement to be configured
throws:
  BuildException - on error



dieOnCircularReference
protected synchronized void dieOnCircularReference(Stack stk, Project p) throws BuildException(Code)
Overrides the version of DataType to recurse on all DataType child elements that may have been added.
Parameters:
  stk - the stack of data types to use (recursively).
Parameters:
  p - the project to use to dereference the references.
throws:
  BuildException - on error.



isFilesystemOnly
public synchronized boolean isFilesystemOnly()(Code)
Fulfill the ResourceCollection contract. whether this is a filesystem-only resource collection.



iterator
final public synchronized Iterator iterator()(Code)
Fulfill the ResourceCollection contract. The Iterator returned will throw ConcurrentModificationExceptions if ResourceCollections are added to this container while the Iterator is in use. a "fail-fast" Iterator.



list
public String[] list()(Code)
Returns all path elements defined by this and nested path objects. list of path elements.



setLocation
public void setLocation(File location) throws BuildException(Code)
Adds a element definition to the path.
Parameters:
  location - the location of the element to add (must not benull nor empty.
throws:
  BuildException - on error



setPath
public void setPath(String path) throws BuildException(Code)
Parses a path definition and creates single PathElements.
Parameters:
  path - the String path definition.
throws:
  BuildException - on error



setRefid
public void setRefid(Reference r) throws BuildException(Code)
Makes this instance in effect a reference to another Path instance.

You must not set another attribute or nest elements inside this element if you make it a reference.


Parameters:
  r - the reference to another Path
throws:
  BuildException - on error



size
public synchronized int size()(Code)
Fulfill the ResourceCollection contract. number of elements as int.



toString
public String toString()(Code)
Returns a textual representation of the path, which can be used as CLASSPATH or PATH environment variable definition. a textual representation of the path.



translateFile
public static String translateFile(String source)(Code)
Returns its argument with all file separator characters replaced so that they match the local OS conventions.
Parameters:
  source - the path to convert the converted path



translateFileSep
protected static boolean translateFileSep(StringBuffer buffer, int pos)(Code)
Translates occurrences at a position of / or \ to correct separator of the current platform and returns whether it had to do a replacement.
Parameters:
  buffer - a buffer containing a string
Parameters:
  pos - the position in the string buffer to convert true if the character was a / or \



translatePath
public static String[] translatePath(Project project, String source)(Code)
Splits a PATH (with : or ; as separators) into its parts.
Parameters:
  project - the project to use
Parameters:
  source - a String value an array of strings, one for each path element



Fields inherited from org.apache.tools.ant.types.DataType
protected boolean checked(Code)(Java Doc)
protected Reference ref(Code)(Java Doc)

Methods inherited from org.apache.tools.ant.types.DataType
protected void checkAttributesAllowed()(Code)(Java Doc)
protected void checkChildrenAllowed()(Code)(Java Doc)
protected BuildException circularReference()(Code)(Java Doc)
public Object clone() throws CloneNotSupportedException(Code)(Java Doc)
protected void dieOnCircularReference()(Code)(Java Doc)
protected void dieOnCircularReference(Project p)(Code)(Java Doc)
protected void dieOnCircularReference(Stack stack, Project project) throws BuildException(Code)(Java Doc)
protected Object getCheckedRef()(Code)(Java Doc)
protected Object getCheckedRef(Project p)(Code)(Java Doc)
protected Object getCheckedRef(Class requiredClass, String dataTypeName)(Code)(Java Doc)
protected Object getCheckedRef(Class requiredClass, String dataTypeName, Project project)(Code)(Java Doc)
protected String getDataTypeName()(Code)(Java Doc)
public Reference getRefid()(Code)(Java Doc)
public static void invokeCircularReferenceCheck(DataType dt, Stack stk, Project p)(Code)(Java Doc)
protected boolean isChecked()(Code)(Java Doc)
public boolean isReference()(Code)(Java Doc)
protected BuildException noChildrenAllowed()(Code)(Java Doc)
protected void setChecked(boolean checked)(Code)(Java Doc)
public void setRefid(Reference ref)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
protected BuildException tooManyAttributes()(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.