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

PropertyHelper
public class PropertyHelper (Code)
NOT FINAL. API MAY CHANGE Deals with properties - substitution, dynamic properties, etc. This is the same code as in Ant1.5. The main addition is the ability to chain multiple PropertyHelpers and to replace the default.
since:
   Ant 1.6



Constructor Summary
protected  PropertyHelper()
     Default constructor.

Method Summary
public  voidcopyInheritedProperties(Project other)
     Copies all user properties that have not been set on the command line or a GUI tool from this instance to the Project instance given as the argument.

To copy all "user" properties, you will also have to call PropertyHelper.copyUserProperties copyUserProperties .


Parameters:
  other - the project to copy the properties to.
public  voidcopyUserProperties(Project other)
     Copies all user properties that have been set on the command line or a GUI tool from this instance to the Project instance given as the argument.

To copy all "user" properties, you will also have to call PropertyHelper.copyInheritedProperties copyInheritedProperties .


Parameters:
  other - the project to copy the properties to.
protected  HashtablegetInternalInheritedProperties()
    
protected  HashtablegetInternalProperties()
    
protected  HashtablegetInternalUserProperties()
    
public  PropertyHelpergetNext()
     Get the next property helper in the chain.
public  HashtablegetProperties()
     Returns a copy of the properties table.
public synchronized  ObjectgetProperty(String ns, String name)
     Returns the value of a property, if it is set.
public static synchronized  PropertyHelpergetPropertyHelper(Project project)
     Factory method to create a property processor. Users can provide their own or replace it using "ant.PropertyHelper" reference.
public  ObjectgetPropertyHook(String ns, String name, boolean user)
     Get a property.
public  HashtablegetUserProperties()
    
public synchronized  ObjectgetUserProperty(String ns, String name)
     Returns the value of a user property, if it is set.
Parameters:
  ns - The namespace for the property (currently not used).
Parameters:
  name - The name of the property.May be null, in which casethe return value is also null.
public  voidparsePropertyString(String value, Vector fragments, Vector propertyRefs)
     Parses a string containing ${xxx} style property references into two lists.
static  voidparsePropertyStringDefault(String value, Vector fragments, Vector propertyRefs)
     Default parsing method.
public  StringreplaceProperties(String ns, String value, Hashtable keys)
     Replaces ${xxx} style constructions in the given value with the string value of the corresponding data types.
Parameters:
  ns - The namespace for the property.
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.
public synchronized  voidsetInheritedProperty(String ns, String name, Object value)
     Sets an inherited user property, which cannot be overwritten by set/unset property calls.
public synchronized  voidsetNewProperty(String ns, String name, Object value)
     Sets a property if no value currently exists.
public  voidsetNext(PropertyHelper next)
     There are 2 ways to hook into property handling: - you can replace the main PropertyHelper.
public  voidsetProject(Project p)
    
public synchronized  booleansetProperty(String ns, String name, Object value, boolean verbose)
     Default implementation of setProperty.
public  booleansetPropertyHook(String ns, String name, Object value, boolean inherited, boolean user, boolean isNew)
     Sets a property.
public synchronized  voidsetUserProperty(String ns, String name, Object value)
     Sets a user property, which cannot be overwritten by set/unset property calls.


Constructor Detail
PropertyHelper
protected PropertyHelper()(Code)
Default constructor.




Method Detail
copyInheritedProperties
public void copyInheritedProperties(Project other)(Code)
Copies all user properties that have not been set on the command line or a GUI tool from this instance to the Project instance given as the argument.

To copy all "user" properties, you will also have to call PropertyHelper.copyUserProperties copyUserProperties .


Parameters:
  other - the project to copy the properties to. Must not be null.
since:
   Ant 1.6



copyUserProperties
public void copyUserProperties(Project other)(Code)
Copies all user properties that have been set on the command line or a GUI tool from this instance to the Project instance given as the argument.

To copy all "user" properties, you will also have to call PropertyHelper.copyInheritedProperties copyInheritedProperties .


Parameters:
  other - the project to copy the properties to. Must not be null.
since:
   Ant 1.6



getInternalInheritedProperties
protected Hashtable getInternalInheritedProperties()(Code)
special back door for subclasses, internal access to the hashtables the live hashtable inherited properties



getInternalProperties
protected Hashtable getInternalProperties()(Code)
special back door for subclasses, internal access to the hashtables the live hashtable of all properties



getInternalUserProperties
protected Hashtable getInternalUserProperties()(Code)
special back door for subclasses, internal access to the hashtables the live hashtable of user properties



getNext
public PropertyHelper getNext()(Code)
Get the next property helper in the chain. the next property helper.



getProperties
public Hashtable getProperties()(Code)
Returns a copy of the properties table. a hashtable containing all properties(including user properties).



getProperty
public synchronized Object getProperty(String ns, String name)(Code)
Returns the value of a property, if it is set. You can override this method in order to plug your own storage.
Parameters:
  ns - The namespace for the property (currently not used).
Parameters:
  name - The name of the property.May be null, in which casethe return value is also null. the property value, or null for no matchor if a null name is provided.



getPropertyHelper
public static synchronized PropertyHelper getPropertyHelper(Project project)(Code)
Factory method to create a property processor. Users can provide their own or replace it using "ant.PropertyHelper" reference. User tasks can also add themselves to the chain, and provide dynamic properties.
Parameters:
  project - the project fro which the property helper is required. the project's property helper.



getPropertyHook
public Object getPropertyHook(String ns, String name, boolean user)(Code)
Get a property. If all hooks return null, the default tables will be used.
Parameters:
  ns - namespace of the sought property.
Parameters:
  name - name of the sought property.
Parameters:
  user - True if this is a user property. The property, if returned by a hook, or null if none.



getUserProperties
public Hashtable getUserProperties()(Code)
Returns a copy of the user property hashtable a hashtable containing just the user properties



getUserProperty
public synchronized Object getUserProperty(String ns, String name)(Code)
Returns the value of a user property, if it is set.
Parameters:
  ns - The namespace for the property (currently not used).
Parameters:
  name - The name of the property.May be null, in which casethe return value is also null. the property value, or null for no matchor if a null name is provided.



parsePropertyString
public 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. It can be overridden with a more efficient or customized version.
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}



parsePropertyStringDefault
static void parsePropertyStringDefault(String value, Vector fragments, Vector propertyRefs) throws BuildException(Code)
Default parsing method. It is here only to support backward compatibility for the static ProjectHelper.parsePropertyString().



replaceProperties
public String replaceProperties(String ns, 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:
  ns - The namespace for the property.
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. If null, only project properties willbe used.
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.



setInheritedProperty
public synchronized void setInheritedProperty(String ns, String name, Object value)(Code)
Sets an inherited user property, which cannot be overwritten by set/unset property calls. Any previous value is overwritten. Also marks these properties as properties that have not come from the command line.
Parameters:
  ns - The namespace for the property (currently not used).
Parameters:
  name - The name of property to set.Must not be null.
Parameters:
  value - The new value of the property.Must not be null.



setNewProperty
public synchronized void setNewProperty(String ns, String name, Object value)(Code)
Sets a property if no value currently exists. If the property exists already, a message is logged and the method returns with no other effect.
Parameters:
  ns - The namespace for the property (currently not used).
Parameters:
  name - The name of property to set.Must not be null.
Parameters:
  value - The new value of the property.Must not be null.
since:
   Ant 1.6



setNext
public void setNext(PropertyHelper next)(Code)
There are 2 ways to hook into property handling: - you can replace the main PropertyHelper. The replacement is required to support the same semantics (of course :-) - you can chain a property helper capable of storing some properties. Again, you are required to respect the immutability semantics (at least for non-dynamic properties)
Parameters:
  next - the next property helper in the chain.



setProject
public void setProject(Project p)(Code)
Set the project for which this helper is performing property resolution
Parameters:
  p - the project instance.



setProperty
public synchronized boolean setProperty(String ns, String name, Object value, boolean verbose)(Code)
Default implementation of setProperty. Will be called from Project. This is the original 1.5 implementation, with calls to the hook added.
Parameters:
  ns - The namespace for the property (currently not used).
Parameters:
  name - The name of the property.
Parameters:
  value - The value to set the property to.
Parameters:
  verbose - If this is true output extra log messages. true if the property is set.



setPropertyHook
public boolean setPropertyHook(String ns, String name, Object value, boolean inherited, boolean user, boolean isNew)(Code)
Sets a property. Any existing property of the same name is overwritten, unless it is a user property. Will be called from setProperty(). If all helpers return false, the property will be saved in the default properties table by setProperty.
Parameters:
  ns - The namespace that the property is in (currentlynot used.
Parameters:
  name - The name of property to set.Must not be null.
Parameters:
  value - The new value of the property.Must not be null.
Parameters:
  inherited - True if this property is inherited (an [sub]ant[call] property).
Parameters:
  user - True if this property is a user property.
Parameters:
  isNew - True is this is a new property. true if this helper has stored the property, false if itcouldn't. Each helper should delegate to the next one (unless ithas a good reason not to).



setUserProperty
public synchronized void setUserProperty(String ns, String name, Object value)(Code)
Sets a user property, which cannot be overwritten by set/unset property calls. Any previous value is overwritten.
Parameters:
  ns - The namespace for the property (currently not used).
Parameters:
  name - The name of property to set.Must not be null.
Parameters:
  value - The new value of the property.Must not be null.



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.