Java Doc for DefaultConfiguration.java in  » Inversion-of-Control » DNA » org » codehaus » dna » impl » 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 » Inversion of Control » DNA » org.codehaus.dna.impl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.codehaus.dna.impl.AbstractFreezable
      org.codehaus.dna.impl.DefaultConfiguration

DefaultConfiguration
public class DefaultConfiguration extends AbstractFreezable implements Configuration(Code)
In memory Configuration implementation. The developer should create the DefaultConfiguration, associate value, attributes and/or child elements configuration and then invoke DefaultConfiguration.makeReadOnly() before passing the Configuration to the client component.
version:
   $Revision: 1.2 $ $Date: 2004/05/01 09:51:48 $



Constructor Summary
public  DefaultConfiguration(String name, String location, String path)
     Create a DefaultConfiguration instance.

Method Summary
public  voidaddChild(Configuration configuration)
     Add a child configuration element.
final protected  StringgenerateLocation()
     Generate a location string that postfixes autogenerated marker.
public  StringgetAttribute(String name)
     Return attribute value with specified name.
public  StringgetAttribute(String name, String defaultValue)
     Return attribute value with specified name.
public  booleangetAttributeAsBoolean(String name)
     Return attribute value with specified name as a boolean.
public  booleangetAttributeAsBoolean(String name, boolean defaultValue)
     Return attribute value with specified name as a boolean.
public  floatgetAttributeAsFloat(String name)
     Return attribute value with specified name as afloat.
public  floatgetAttributeAsFloat(String name, float defaultValue)
     Return attribute value with specified name as a float.
public  intgetAttributeAsInteger(String name)
     Return attribute value with specified name as an integer.
public  intgetAttributeAsInteger(String name, int defaultValue)
     Return attribute value with specified name as an integer.
public  longgetAttributeAsLong(String name)
     Return attribute value with specified name as a long.
public  longgetAttributeAsLong(String name, long defaultValue)
     Return attribute value with specified name as a long.
final protected  MapgetAttributeMap()
     Return the backing map for attributes.
public  String[]getAttributeNames()
     Return an array of all the attribute names.
public  ConfigurationgetChild(String name)
     Return a child Configuration element with specified name.
public  ConfigurationgetChild(String name, boolean createChild)
     Return a child Configuration element with specified name.
final protected  ListgetChildList()
     Return the list of child configuration objects.
public  Configuration[]getChildren()
     Return an array of all the child elements.
public  Configuration[]getChildren(String name)
     Return an array of all the child elements with specified name.
public  StringgetLocation()
     Return the location of configuration element. Usually of the form "uri[:line number[:column number]]" if possible.
public  StringgetName()
     Return the name of the configuration element.
final public  StringgetPath()
     Return the path to the configuration element.
public  StringgetValue()
     Return text value of element.
public  StringgetValue(String defaultValue)
     Return text value of element.
public  booleangetValueAsBoolean()
     Return text value of element as a boolean.
public  booleangetValueAsBoolean(boolean defaultValue)
     Return text value of element as a boolean.
public  floatgetValueAsFloat()
     Return text value of element as a float.
public  floatgetValueAsFloat(float defaultValue)
     Return text value of element as a float.
public  intgetValueAsInteger()
     Return text value of element as an integer.
public  intgetValueAsInteger(int defaultValue)
     Return text value of element as an integer.
public  longgetValueAsLong()
     Return text value of element as a long.
public  longgetValueAsLong(long defaultValue)
     Return text value of element as a long.
public  voidmakeReadOnly()
     Mark the configuration and child configurations as read only.
public  voidsetAttribute(String key, String value)
     Set an attribute of configuration.
public  voidsetValue(String value)
     Set the value of the configuration element.
final protected  voidthrowMixedContentException()
     Throw an IllegalStateException warning about mixed content.
public  StringtoString()
     Overide toString to improve ability to debug implementation.


Constructor Detail
DefaultConfiguration
public DefaultConfiguration(String name, String location, String path)(Code)
Create a DefaultConfiguration instance.
Parameters:
  name - the name of configuration element
Parameters:
  location - the location of configuration element in source
Parameters:
  path - the path of configuration element in document




Method Detail
addChild
public void addChild(Configuration configuration)(Code)
Add a child configuration element.
Parameters:
  configuration - the child configuration element.



generateLocation
final protected String generateLocation()(Code)
Generate a location string that postfixes autogenerated marker. a autogenerated location string



getAttribute
public String getAttribute(String name) throws ConfigurationException(Code)
Return attribute value with specified name.
Parameters:
  name - the attribute name the attribute value
throws:
  ConfigurationException - if no attribute withspecified name



getAttribute
public String getAttribute(String name, String defaultValue)(Code)
Return attribute value with specified name. If no attribute with specified name then return default value.
Parameters:
  name - the attribute name
Parameters:
  defaultValue - the default value the attribute value



getAttributeAsBoolean
public boolean getAttributeAsBoolean(String name) throws ConfigurationException(Code)
Return attribute value with specified name as a boolean.
Parameters:
  name - the attribute name the attribute value
throws:
  ConfigurationException - if no attribute withspecified name or attribute can not be convertedto correct type



getAttributeAsBoolean
public boolean getAttributeAsBoolean(String name, boolean defaultValue)(Code)
Return attribute value with specified name as a boolean. If no attribute with specified name or attribute can not be converted to correct type then return default value.
Parameters:
  name - the attribute name
Parameters:
  defaultValue - the default value the attribute value



getAttributeAsFloat
public float getAttributeAsFloat(String name) throws ConfigurationException(Code)
Return attribute value with specified name as afloat.
Parameters:
  name - the attribute name the attribute value
throws:
  ConfigurationException - if no attribute withspecified name or attribute can not be convertedto correct type



getAttributeAsFloat
public float getAttributeAsFloat(String name, float defaultValue)(Code)
Return attribute value with specified name as a float. If no attribute with specified name or attribute can not be converted to correct type then return default value.
Parameters:
  name - the attribute name
Parameters:
  defaultValue - the default value the attribute value



getAttributeAsInteger
public int getAttributeAsInteger(String name) throws ConfigurationException(Code)
Return attribute value with specified name as an integer.
Parameters:
  name - the attribute name the attribute value
throws:
  ConfigurationException - if no attribute withspecified name or attribute can not be convertedto correct type



getAttributeAsInteger
public int getAttributeAsInteger(String name, int defaultValue)(Code)
Return attribute value with specified name as an integer. If no attribute with specified name or attribute can not be converted to correct type then return default value.
Parameters:
  name - the attribute name
Parameters:
  defaultValue - the default value the attribute value



getAttributeAsLong
public long getAttributeAsLong(String name) throws ConfigurationException(Code)
Return attribute value with specified name as a long.
Parameters:
  name - the attribute name the attribute value
throws:
  ConfigurationException - if no attribute withspecified name or attribute can not be convertedto correct type



getAttributeAsLong
public long getAttributeAsLong(String name, long defaultValue)(Code)
Return attribute value with specified name as a long. If no attribute with specified name or attribute can not be converted to correct type then return default value.
Parameters:
  name - the attribute name
Parameters:
  defaultValue - the default value the attribute value



getAttributeMap
final protected Map getAttributeMap()(Code)
Return the backing map for attributes. the backing map for attributes.



getAttributeNames
public String[] getAttributeNames()(Code)
Return an array of all the attribute names. an array of all the attribute names.



getChild
public Configuration getChild(String name)(Code)
Return a child Configuration element with specified name. If no such element exists an element will be autocreated.
Parameters:
  name - the name of child configuration object a child Configuration element with specified name.



getChild
public Configuration getChild(String name, boolean createChild)(Code)
Return a child Configuration element with specified name. If no such element exists and createChild is true then an element will be autocreated otherwise null will be returned.
Parameters:
  name - the name of child configuration object
Parameters:
  createChild - true if child should be created if it does not exist a child Configuration element with specified name.



getChildList
final protected List getChildList()(Code)
Return the list of child configuration objects. the list of child configuration objects.



getChildren
public Configuration[] getChildren()(Code)
Return an array of all the child elements. an array of all the child elements.



getChildren
public Configuration[] getChildren(String name)(Code)
Return an array of all the child elements with specified name.
Parameters:
  name - the name of child configuration objects an array of all the child elements with specified name.



getLocation
public String getLocation()(Code)
Return the location of configuration element. Usually of the form "uri[:line number[:column number]]" if possible. ie "file:myFile.xml:80:2". However the line number and column number may be elided if unavailable. the location of configuration element.



getName
public String getName()(Code)
Return the name of the configuration element. the name of the configuration element.



getPath
final public String getPath()(Code)
Return the path to the configuration element. The path should be in the xpath form but may be the empty string if unabel to determine path. the path to the configuration element.



getValue
public String getValue() throws ConfigurationException(Code)
Return text value of element. the value
throws:
  ConfigurationException - if no value in element



getValue
public String getValue(String defaultValue)(Code)
Return text value of element. Use specified default if no value in element.
Parameters:
  defaultValue - the default value the value



getValueAsBoolean
public boolean getValueAsBoolean() throws ConfigurationException(Code)
Return text value of element as a boolean. the value
throws:
  ConfigurationException - if no value in elementor value can not be converted to correct type



getValueAsBoolean
public boolean getValueAsBoolean(boolean defaultValue)(Code)
Return text value of element as a boolean. Use specified default if no value in element or value can not be converted to correct type.
Parameters:
  defaultValue - the default value the value



getValueAsFloat
public float getValueAsFloat() throws ConfigurationException(Code)
Return text value of element as a float. the value
throws:
  ConfigurationException - if no value in elementor value can not be converted to correct type



getValueAsFloat
public float getValueAsFloat(float defaultValue)(Code)
Return text value of element as a float. Use specified default if no value in element or value can not be converted to correct type.
Parameters:
  defaultValue - the default value the value



getValueAsInteger
public int getValueAsInteger() throws ConfigurationException(Code)
Return text value of element as an integer. the value
throws:
  ConfigurationException - if no value in elementor value can not be converted to correct type



getValueAsInteger
public int getValueAsInteger(int defaultValue)(Code)
Return text value of element as an integer. Use specified default if no value in element or value can not be converted to correct type.
Parameters:
  defaultValue - the default value the value



getValueAsLong
public long getValueAsLong() throws ConfigurationException(Code)
Return text value of element as a long. the value
throws:
  ConfigurationException - if no value in elementor value can not be converted to correct type



getValueAsLong
public long getValueAsLong(long defaultValue)(Code)
Return text value of element as a long. Use specified default if no value in element or value can not be converted to correct type.
Parameters:
  defaultValue - the default value the value



makeReadOnly
public void makeReadOnly()(Code)
Mark the configuration and child configurations as read only.



setAttribute
public void setAttribute(String key, String value)(Code)
Set an attribute of configuration.
Parameters:
  key - the attribute key
Parameters:
  value - the attribute value



setValue
public void setValue(String value)(Code)
Set the value of the configuration element.
Parameters:
  value - the value of the configuration element.



throwMixedContentException
final protected void throwMixedContentException()(Code)
Throw an IllegalStateException warning about mixed content.



toString
public String toString()(Code)
Overide toString to improve ability to debug implementation. string representation of object



Methods inherited from org.codehaus.dna.impl.AbstractFreezable
final protected void checkWriteable()(Code)(Java Doc)
final protected boolean isReadOnly()(Code)(Java Doc)
public void makeReadOnly()(Code)(Java Doc)

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.