Java Doc for XMLConfiguration.java in  » Web-Framework » jpublish » com » anthonyeden » lib » config » 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 » Web Framework » jpublish » com.anthonyeden.lib.config 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.anthonyeden.lib.config.XMLConfiguration

XMLConfiguration
public class XMLConfiguration implements MutableConfiguration(Code)
Implementation of the Configuration interface which uses an XML document as its data source.
author:
   Anthony Eden
author:
   Florin T.PATRASCU



Constructor Summary
public  XMLConfiguration(String xmlString)
    
public  XMLConfiguration(String id, String xmlString)
     Construct a configuration object from the given XML String with the given id.
public  XMLConfiguration(String id, String xmlString, String encoding)
     Construct a configuration object from the given XML String with the given id.
public  XMLConfiguration(File file)
     Construct an XMLConfiguration from the given File.
public  XMLConfiguration(String id, File file)
    
public  XMLConfiguration(FileObject file)
     Construct an XMLConfiguration from the given FileObject.
public  XMLConfiguration(URL url)
     Construct an XMLConfiguration using the data at the given URL.
public  XMLConfiguration(InputStream in)
     Construct an XMLConfiguration using the given InputStream.
public  XMLConfiguration(String id, InputStream in)
    
public  XMLConfiguration(Reader reader)
     Construct an XMLConfiguration using the given reader.

Method Summary
public synchronized  voidaddAttribute(String name, Object value)
     Add an attribute with the given name.
public  MutableConfigurationaddChild(String name)
     Add a child node with no child value to the configuration.
public synchronized  MutableConfigurationaddChild(String name, Object value)
     Add a child node to the configuration.
public synchronized  MutableConfigurationaddChild(String name, Object value, Object defaultValue)
     Add a child node to the configuration.
public synchronized  voidaddChild(Configuration child)
     Add the configuration object as a child of this configuration object.
public  voidclearChildren()
     Remove all of the children of this configuration node.
public  Configurationcopy()
     This is a deep copy of XMLConfiguration since atrributes and values are Strings and therefore immutable.
public  StringgetAttribute(String name)
     Get the named attribute or null.
public  StringgetAttribute(String name, String defaultValue)
     Get the named attribute.
public  ListgetAttributeNames()
     Get a List of attribute names.
public  ConfigurationgetChild(String name)
     Get the child configuration object with the given name.
public  StringgetChildValue(String name)
     Get the value of the first child configuration object with the given name.
public  StringgetChildValue(String name, String defaultValue)
     Get the value of the first child configuration object with the given name.
public  ListgetChildren()
     Get a list of all child nodes.
public  ListgetChildren(String name)
     Get a list of all child nodes with the given name.
public  LocationgetLocation()
    
public  StringgetName()
     Get the node's name.
public  ConfigurationgetParent()
     Get the parent configuration object.
public  StringgetValue()
     Get the node's value or null if the node contains no data.
public  StringgetValue(String defaultValue)
     Get the node's value.
public  voidload(String filename)
     Load the configuration from the file represented by the given file name.
public  voidload(File file)
     Load the configuration from the given file.
public  voidload(FileObject file)
     Load the configuration from the given FileObject.
public  voidload(URL url)
     Load the configuration from the given URL.
public  voidload(String id, InputStream in)
     Load the configuration from the given InputStream.
public  voidload(InputStream in)
    
public  voidload(Reader reader)
     Load the configuration from the given Reader.
public  voidremoveChild(Configuration configuration)
     Remove the specified configuration object.
public  voidsave(OutputStream out)
     Save the configuration data to the given OutputStream.
public  voidsave(Writer out)
     Save the configuration data to the given Writer.
public  voidsetLocation(String id)
    
public synchronized  voidsetName(String name)
     Set the node name.
public synchronized  voidsetValue(String value)
     Set the configuration object's value.
public  StringtoXMLString()
     Returns this XMLConfiguration as a string.


Constructor Detail
XMLConfiguration
public XMLConfiguration(String xmlString) throws ConfigurationException(Code)
Construct an "anonymous" configuration object from the given XML String
Parameters:
  xmlString - The xml string we want to load



XMLConfiguration
public XMLConfiguration(String id, String xmlString) throws ConfigurationException(Code)
Construct a configuration object from the given XML String with the given id.
Parameters:
  id -
Parameters:
  xmlString - The xml string we want to load



XMLConfiguration
public XMLConfiguration(String id, String xmlString, String encoding) throws ConfigurationException(Code)
Construct a configuration object from the given XML String with the given id.
Parameters:
  id - used to identify the parsing sequence
Parameters:
  xmlString - The xml string we want to load
Parameters:
  encoding - character encoding
throws:
  ConfigurationException -



XMLConfiguration
public XMLConfiguration(File file) throws ConfigurationException(Code)
Construct an XMLConfiguration from the given File.
Parameters:
  file - The file
throws:
  ConfigurationException -



XMLConfiguration
public XMLConfiguration(String id, File file) throws ConfigurationException(Code)



XMLConfiguration
public XMLConfiguration(FileObject file) throws ConfigurationException(Code)
Construct an XMLConfiguration from the given FileObject.
Parameters:
  file - The file
throws:
  ConfigurationException -



XMLConfiguration
public XMLConfiguration(URL url) throws ConfigurationException(Code)
Construct an XMLConfiguration using the data at the given URL.
Parameters:
  url - The URL
throws:
  ConfigurationException -



XMLConfiguration
public XMLConfiguration(InputStream in) throws ConfigurationException(Code)
Construct an XMLConfiguration using the given InputStream.
Parameters:
  in - The InputStream
throws:
  ConfigurationException -



XMLConfiguration
public XMLConfiguration(String id, InputStream in) throws ConfigurationException(Code)

Parameters:
  id -
Parameters:
  in -
throws:
  ConfigurationException -



XMLConfiguration
public XMLConfiguration(Reader reader) throws ConfigurationException(Code)
Construct an XMLConfiguration using the given reader.
Parameters:
  reader - The Reader
throws:
  ConfigurationException -




Method Detail
addAttribute
public synchronized void addAttribute(String name, Object value)(Code)
Add an attribute with the given name.
Parameters:
  name - The attribute name
Parameters:
  value - The attribute value



addChild
public MutableConfiguration addChild(String name)(Code)
Add a child node with no child value to the configuration. This method should be the same as calling addChild(name, "")
Parameters:
  name - The name of the new configuration node The configuration node



addChild
public synchronized MutableConfiguration addChild(String name, Object value)(Code)
Add a child node to the configuration.
Parameters:
  name - The name of the new configuration node
Parameters:
  value - The value of the new configuration node The configuration node



addChild
public synchronized MutableConfiguration addChild(String name, Object value, Object defaultValue)(Code)
Add a child node to the configuration.
Parameters:
  name - The name of the new configuration node
Parameters:
  value - The value of the new configuration node
Parameters:
  defaultValue - The value to use in case the value is null The configuration node



addChild
public synchronized void addChild(Configuration child)(Code)
Add the configuration object as a child of this configuration object.
Parameters:
  child - The child configuration object



clearChildren
public void clearChildren()(Code)
Remove all of the children of this configuration node.



copy
public Configuration copy()(Code)
This is a deep copy of XMLConfiguration since atrributes and values are Strings and therefore immutable. Unless of course you modified the object manually and entered complex objects as values or attribute values. All this does is return the result of configuration.copy() call on the wrapped configuration object. copy of the wrapped Configuration object



getAttribute
public String getAttribute(String name)(Code)
Get the named attribute or null.
Parameters:
  name - The attribute name The attribute value



getAttribute
public String getAttribute(String name, String defaultValue)(Code)
Get the named attribute. If the attribute is not found then return the given default value.
Parameters:
  name - The attribute name
Parameters:
  defaultValue - The default value The attribute value



getAttributeNames
public List getAttributeNames()(Code)
Get a List of attribute names. A List of attribute names



getChild
public Configuration getChild(String name)(Code)
Get the child configuration object with the given name. If the child with the name does not exist then this method returns null. If more than one child with the given name exists then this method returns the first child.
Parameters:
  name - The child name The first named child or null



getChildValue
public String getChildValue(String name)(Code)
Get the value of the first child configuration object with the given name. If the child cannot be found or the child had no data then this method returns null.
Parameters:
  name - The child name The value or null



getChildValue
public String getChildValue(String name, String defaultValue)(Code)
Get the value of the first child configuration object with the given name. If the child cannot be found or the child had no data then this method returns the given default value.
Parameters:
  name - The child name
Parameters:
  defaultValue - The default value The value



getChildren
public List getChildren()(Code)
Get a list of all child nodes. A List of Configuration objects



getChildren
public List getChildren(String name)(Code)
Get a list of all child nodes with the given name.
Parameters:
  name - The child node name A List of Configuration objects



getLocation
public Location getLocation()(Code)



getName
public String getName()(Code)
Get the node's name. The node's name



getParent
public Configuration getParent()(Code)
Get the parent configuration object. This method will return null if this configuration object is the top-most configuration object in the configuration tree. The parent configuration object or null



getValue
public String getValue()(Code)
Get the node's value or null if the node contains no data. The node value or null



getValue
public String getValue(String defaultValue)(Code)
Get the node's value. If the node contains no data then return the given default value.
Parameters:
  defaultValue - The default value The node value



load
public void load(String filename) throws ConfigurationException(Code)
Load the configuration from the file represented by the given file name. A File object is constructed using the given String. If the File exists then it is used to load the configuration information. If the File does not exist then the classpath will be searched for the given file name.

The filename cannot be null.
Parameters:
  filename - The filename
throws:
  ConfigurationException -




load
public void load(File file) throws ConfigurationException(Code)
Load the configuration from the given file. The file cannot be null.
Parameters:
  file - The file
throws:
  ConfigurationException -



load
public void load(FileObject file) throws ConfigurationException(Code)
Load the configuration from the given FileObject. The FileObject cannot be null.
Parameters:
  file - The FileObject
throws:
  ConfigurationException -



load
public void load(URL url) throws ConfigurationException(Code)
Load the configuration from the given URL. The URL cannot be null.
Parameters:
  url - The URL
throws:
  ConfigurationException -



load
public void load(String id, InputStream in) throws ConfigurationException(Code)
Load the configuration from the given InputStream. The InputStream cannot be null.
Parameters:
  in - The InputStream
throws:
  ConfigurationException -



load
public void load(InputStream in) throws ConfigurationException(Code)



load
public void load(Reader reader) throws ConfigurationException(Code)
Load the configuration from the given Reader. The reader cannot be null.
Parameters:
  reader - The Reader
throws:
  ConfigurationException -



removeChild
public void removeChild(Configuration configuration)(Code)
Remove the specified configuration object.
Parameters:
  configuration - The child configuration object



save
public void save(OutputStream out) throws ConfigurationException(Code)
Save the configuration data to the given OutputStream.
Parameters:
  out - The OutputStream
throws:
  ConfigurationException -



save
public void save(Writer out) throws ConfigurationException(Code)
Save the configuration data to the given Writer.
Parameters:
  out - The Writer
throws:
  ConfigurationException -



setLocation
public void setLocation(String id)(Code)



setName
public synchronized void setName(String name)(Code)
Set the node name.
Parameters:
  name - The new node name



setValue
public synchronized void setValue(String value)(Code)
Set the configuration object's value.
Parameters:
  value - The new value



toXMLString
public String toXMLString() throws ConfigurationException(Code)
Returns this XMLConfiguration as a string. Internally it uses the save method, to obtain the string. this XMLConfiguration as a string
throws:
  ConfigurationException -



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.