Java Doc for DefaultConfigurationKey.java in  » Library » Apache-commons-configuration-1.4-src » org » apache » commons » configuration » tree » 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 » Library » Apache commons configuration 1.4 src » org.apache.commons.configuration.tree 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.commons.configuration.tree.DefaultConfigurationKey

DefaultConfigurationKey
public class DefaultConfigurationKey (Code)

A simple class that supports creation of and iteration on configuration keys supported by a DefaultExpressionEngine object.

For key creation the class works similar to a StringBuffer: There are several appendXXXX() methods with which single parts of a key can be constructed. All these methods return a reference to the actual object so they can be written in a chain. When using this methods the exact syntax for keys need not be known.

This class also defines a specialized iterator for configuration keys. With such an iterator a key can be tokenized into its single parts. For each part it can be checked whether it has an associated index.

Instances of this class are always associated with an instance of DefaultExpressionEngine , from which the current delimiters are obtained. So key creation and parsing is specific to this associated expression engine.


since:
   1.3
author:
   Oliver Heger
version:
   $Id: DefaultConfigurationKey.java 439648 2006-09-02 20:42:10Z oheger $

Inner Class :public class KeyIterator implements Iterator,Cloneable


Constructor Summary
public  DefaultConfigurationKey(DefaultExpressionEngine engine)
     Creates a new instance of DefaultConfigurationKey and sets the associated expression engine.
public  DefaultConfigurationKey(DefaultExpressionEngine engine, String key)
     Creates a new instance of DefaultConfigurationKey and sets the associated expression engine and an initial key.

Method Summary
public  DefaultConfigurationKeyappend(String property, boolean escape)
     Appends the name of a property to this key.
public  DefaultConfigurationKeyappend(String property)
     Appends the name of a property to this key.
public  DefaultConfigurationKeyappendAttribute(String attr)
     Appends an attribute to this configuration key.
public  DefaultConfigurationKeyappendIndex(int index)
     Appends an index to this configuration key.
public  StringattributeName(String key)
     Extracts the name of the attribute from the given attribute key.
public  StringconstructAttributeKey(String key)
     Decorates the given key so that it represents an attribute.
public  booleanequals(Object c)
     Checks if two ConfigurationKey objects are equal.
public  DefaultExpressionEnginegetExpressionEngine()
     Returns the associated default expression engine.
public  inthashCode()
     Returns the hash code for this object.
public  booleanisAttributeKey(String key)
     Tests if the specified key represents an attribute according to the current expression engine.
public  KeyIteratoriterator()
     Returns an iterator for iterating over the single components of this configuration key.
public  intlength()
     Returns the actual length of this configuration key.
public  voidsetExpressionEngine(DefaultExpressionEngine expressionEngine)
     Sets the associated expression engine.
public  voidsetLength(int len)
     Sets the new length of this configuration key.
public  StringtoString()
     Returns a string representation of this object.
public  Stringtrim(String key)
     Removes delimiters at the beginning and the end of the specified key.
public  StringtrimLeft(String key)
     Removes leading property delimiters from the specified key.
public  StringtrimRight(String key)
     Removes trailing property delimiters from the specified key.


Constructor Detail
DefaultConfigurationKey
public DefaultConfigurationKey(DefaultExpressionEngine engine)(Code)
Creates a new instance of DefaultConfigurationKey and sets the associated expression engine.
Parameters:
  engine - the expression engine



DefaultConfigurationKey
public DefaultConfigurationKey(DefaultExpressionEngine engine, String key)(Code)
Creates a new instance of DefaultConfigurationKey and sets the associated expression engine and an initial key.
Parameters:
  engine - the expression engine
Parameters:
  key - the key to be wrapped




Method Detail
append
public DefaultConfigurationKey append(String property, boolean escape)(Code)
Appends the name of a property to this key. If necessary, a property delimiter will be added. If the boolean argument is set to true, property delimiters contained in the property name will be escaped.
Parameters:
  property - the name of the property to be added
Parameters:
  escape - a flag if property delimiters in the passed in property nameshould be escaped a reference to this object



append
public DefaultConfigurationKey append(String property)(Code)
Appends the name of a property to this key. If necessary, a property delimiter will be added. Property delimiters in the given string will not be escaped.
Parameters:
  property - the name of the property to be added a reference to this object



appendAttribute
public DefaultConfigurationKey appendAttribute(String attr)(Code)
Appends an attribute to this configuration key.
Parameters:
  attr - the name of the attribute to be appended a reference to this object



appendIndex
public DefaultConfigurationKey appendIndex(int index)(Code)
Appends an index to this configuration key.
Parameters:
  index - the index to be appended a reference to this object



attributeName
public String attributeName(String key)(Code)
Extracts the name of the attribute from the given attribute key. This method removes the attribute markers - if any - from the specified key.
Parameters:
  key - the attribute key the name of the corresponding attribute



constructAttributeKey
public String constructAttributeKey(String key)(Code)
Decorates the given key so that it represents an attribute. Adds special start and end markers. The passed in string will be modified only if does not already represent an attribute.
Parameters:
  key - the key to be decorated the decorated attribute key



equals
public boolean equals(Object c)(Code)
Checks if two ConfigurationKey objects are equal. The method can be called with strings or other objects, too.
Parameters:
  c - the object to compare a flag if both objects are equal



getExpressionEngine
public DefaultExpressionEngine getExpressionEngine()(Code)
Returns the associated default expression engine. the associated expression engine



hashCode
public int hashCode()(Code)
Returns the hash code for this object. the hash code



isAttributeKey
public boolean isAttributeKey(String key)(Code)
Tests if the specified key represents an attribute according to the current expression engine.
Parameters:
  key - the key to be checked true if this is an attribute key, false otherwise



iterator
public KeyIterator iterator()(Code)
Returns an iterator for iterating over the single components of this configuration key. an iterator for this key



length
public int length()(Code)
Returns the actual length of this configuration key. the length of this key



setExpressionEngine
public void setExpressionEngine(DefaultExpressionEngine expressionEngine)(Code)
Sets the associated expression engine.
Parameters:
  expressionEngine - the expression engine (must not be null)



setLength
public void setLength(int len)(Code)
Sets the new length of this configuration key. With this method it is possible to truncate the key, e.g. to return to a state prior calling some append() methods. The semantic is the same as the setLength() method of StringBuffer.
Parameters:
  len - the new length of the key



toString
public String toString()(Code)
Returns a string representation of this object. This is the configuration key as a plain string. a string for this object



trim
public String trim(String key)(Code)
Removes delimiters at the beginning and the end of the specified key.
Parameters:
  key - the key the key with removed property delimiters



trimLeft
public String trimLeft(String key)(Code)
Removes leading property delimiters from the specified key.
Parameters:
  key - the key the key with removed leading property delimiters



trimRight
public String trimRight(String key)(Code)
Removes trailing property delimiters from the specified key.
Parameters:
  key - the key the key with removed trailing property delimiters



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.