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


java.lang.Object
   org.apache.commons.configuration.ConfigurationKey

ConfigurationKey
public class ConfigurationKey implements Serializable(Code)

A simple class that supports creation of and iteration on complex configuration keys.

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.


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

Inner Class :public class KeyIterator implements Iterator,Cloneable

Field Summary
final public static  StringESCAPED_DELIMITER
     Constant for an escaped delimiter.
final public static  charPROPERTY_DELIMITER
     Constant for a property delimiter.

Constructor Summary
public  ConfigurationKey()
     Creates a new, empty instance of ConfigurationKey.
public  ConfigurationKey(String key)
     Creates a new instance of ConfigurationKey and initializes it with the given key.

Method Summary
public  ConfigurationKeyappend(String property)
     Appends the name of a property to this key.
public  ConfigurationKeyappendAttribute(String attr)
     Appends an attribute to this configuration key.
public  ConfigurationKeyappendIndex(int index)
     Appends an index to this configuration key.
public static  StringattributeName(String key)
     Extracts the name of the attribute from the given attribute key.
public  ConfigurationKeycommonKey(ConfigurationKey other)
     Returns a configuration key object that is initialized with the part of the key that is common to this key and the passed in key.
public static  StringconstructAttributeKey(String key)
     Decorates the given key so that it represents an attribute.
public  ConfigurationKeydifferenceKey(ConfigurationKey other)
     Returns the "difference key" to a given key.
public  booleanequals(Object c)
     Checks if two ConfigurationKey objects are equal.
public  inthashCode()
     Returns the hash code for this object.
public  booleanisAttributeKey()
     Checks if this key is an attribute key.
public static  booleanisAttributeKey(String key)
     Checks if the passed in key is an attribute key.
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.
static  StringremoveAttributeMarkers(String key)
     Helper method for removing attribute markers from a key.
public  voidsetLength(int len)
     Sets the new length of this configuration key.
public  StringtoString()
     Returns a string representation of this object.

Field Detail
ESCAPED_DELIMITER
final public static String ESCAPED_DELIMITER(Code)
Constant for an escaped delimiter.



PROPERTY_DELIMITER
final public static char PROPERTY_DELIMITER(Code)
Constant for a property delimiter.




Constructor Detail
ConfigurationKey
public ConfigurationKey()(Code)
Creates a new, empty instance of ConfigurationKey.



ConfigurationKey
public ConfigurationKey(String key)(Code)
Creates a new instance of ConfigurationKey and initializes it with the given key.
Parameters:
  key - the key as a string




Method Detail
append
public ConfigurationKey append(String property)(Code)
Appends the name of a property to this key. If necessary, a property delimiter will be added.
Parameters:
  property - the name of the property to be added a reference to this object



appendAttribute
public ConfigurationKey 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 ConfigurationKey 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 static 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



commonKey
public ConfigurationKey commonKey(ConfigurationKey other)(Code)
Returns a configuration key object that is initialized with the part of the key that is common to this key and the passed in key.
Parameters:
  other - the other key a key object with the common key part



constructAttributeKey
public static String constructAttributeKey(String key)(Code)
Decorates the given key so that it represents an attribute. Adds special start and end markers.
Parameters:
  key - the key to be decorated the decorated attribute key



differenceKey
public ConfigurationKey differenceKey(ConfigurationKey other)(Code)
Returns the "difference key" to a given key. This value is the part of the passed in key that differs from this key. There is the following relation: other = key.commonKey(other) + key.differenceKey(other) for an arbitrary configuration key key.
Parameters:
  other - the key for which the difference is to be calculated the difference 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



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



isAttributeKey
public boolean isAttributeKey()(Code)
Checks if this key is an attribute key. a flag if this key is an attribute key



isAttributeKey
public static boolean isAttributeKey(String key)(Code)
Checks if the passed in key is an attribute key. Such attribute keys start and end with certain marker strings. In some cases they must be treated slightly different.
Parameters:
  key - the key (part) to be checked a flag if this key is an attribute key



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



removeAttributeMarkers
static String removeAttributeMarkers(String key)(Code)
Helper method for removing attribute markers from a key.
Parameters:
  key - the key the key with removed attribute markers



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



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.