|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.manifoldcf.core.interfaces.Configuration
public class Configuration
This class represents XML configuration information, in its most basic incarnation.
| Field Summary | |
|---|---|
static java.lang.String |
_rcsid
|
protected java.util.ArrayList |
children
|
protected static java.lang.String |
JSON_ATTRIBUTE
|
protected static java.lang.String |
JSON_CHILDREN
|
protected static java.lang.String |
JSON_TYPE
|
protected static java.lang.String |
JSON_VALUE
|
protected boolean |
readOnly
|
protected java.lang.String |
rootNodeLabel
|
| Constructor Summary | |
|---|---|
Configuration()
Constructor. |
|
Configuration(java.lang.String rootNodeLabel)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addChild(int index,
ConfigurationNode child)
Add child at specified position. |
protected void |
addOuterNode(ConfigurationNode node)
Note the addition of a new outer node. |
void |
clearChildren()
Clear children. |
protected void |
clearOuterNodes()
Note the removal of all outer nodes. |
protected Configuration |
createDuplicate(boolean readOnly)
Create a duplicate. |
protected Configuration |
createNew()
Create a new object of the appropriate class. |
protected ConfigurationNode |
createNewNode(java.lang.String type)
Create a new child node of the appropriate type and class. |
boolean |
equals(java.lang.Object o)
Do a comparison |
ConfigurationNode |
findChild(int index)
Get child n. |
void |
fromJSON(java.lang.String json)
Read from JSON. |
void |
fromXML(java.io.InputStream xmlstream)
Read from an XML binary stream. |
void |
fromXML(java.lang.String xml)
Read from XML. |
int |
getChildCount()
Get child count. |
int |
hashCode()
Calculate a hash code |
protected void |
initializeFromDoc(XMLDoc doc)
|
void |
makeReadOnly()
Make the configuration read-only |
protected void |
processObject(ConfigurationNode cn,
java.lang.String key,
java.lang.Object x)
Process a JSON object |
protected void |
processObject(java.lang.String key,
java.lang.Object x)
Process a JSON object |
protected ConfigurationNode |
readNode(java.lang.String key,
org.json.JSONObject object)
Read a node from a json object |
protected ConfigurationNode |
readNode(XMLDoc doc,
java.lang.Object object)
Read a configuration node from XML. |
void |
removeChild(int index)
Remove child n. |
protected void |
removeOuterNode(ConfigurationNode node)
Note the removal of an outer node. |
java.lang.String |
toJSON()
Get as JSON. |
java.lang.String |
toXML()
Get as XML |
protected static void |
writeNode(org.json.JSONWriter writer,
ConfigurationNode node,
boolean writeKey,
boolean writeSpecialKey)
Write a JSON specification node. |
protected static void |
writeNode(XMLDoc doc,
java.lang.Object parent,
ConfigurationNode node)
Write a specification node. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String _rcsid
protected static final java.lang.String JSON_ATTRIBUTE
protected static final java.lang.String JSON_VALUE
protected static final java.lang.String JSON_CHILDREN
protected static final java.lang.String JSON_TYPE
protected java.lang.String rootNodeLabel
protected java.util.ArrayList children
protected boolean readOnly
| Constructor Detail |
|---|
public Configuration()
public Configuration(java.lang.String rootNodeLabel)
rootNodeLabel - is the root node label to use.| Method Detail |
|---|
protected Configuration createNew()
protected ConfigurationNode createNewNode(java.lang.String type)
protected void clearOuterNodes()
protected void addOuterNode(ConfigurationNode node)
node - is the node that was just read.protected void removeOuterNode(ConfigurationNode node)
node - is the node that was just removed.protected Configuration createDuplicate(boolean readOnly)
public void makeReadOnly()
public java.lang.String toXML()
throws ManifoldCFException
ManifoldCFException
public java.lang.String toJSON()
throws ManifoldCFException
ManifoldCFException
protected static void writeNode(XMLDoc doc,
java.lang.Object parent,
ConfigurationNode node)
throws ManifoldCFException
doc - is the document.parent - is the parent.node - is the node.
ManifoldCFException
protected static void writeNode(org.json.JSONWriter writer,
ConfigurationNode node,
boolean writeKey,
boolean writeSpecialKey)
throws ManifoldCFException
writer - is the JSON writer.node - is the node.writeKey - is true if the key needs to be written, false otherwise.
ManifoldCFException
public void fromXML(java.lang.String xml)
throws ManifoldCFException
xml - is the input XML.
ManifoldCFException
public void fromJSON(java.lang.String json)
throws ManifoldCFException
json - is the input JSON.
ManifoldCFException
protected void processObject(java.lang.String key,
java.lang.Object x)
throws ManifoldCFException
ManifoldCFException
protected ConfigurationNode readNode(java.lang.String key,
org.json.JSONObject object)
throws ManifoldCFException
ManifoldCFException
protected void processObject(ConfigurationNode cn,
java.lang.String key,
java.lang.Object x)
throws ManifoldCFException
ManifoldCFException
public void fromXML(java.io.InputStream xmlstream)
throws ManifoldCFException
xmlstream - is the input XML stream. Does NOT close the stream.
ManifoldCFException
protected void initializeFromDoc(XMLDoc doc)
throws ManifoldCFException
ManifoldCFException
protected ConfigurationNode readNode(XMLDoc doc,
java.lang.Object object)
throws ManifoldCFException
doc - is the document.object - is the object.
ManifoldCFExceptionpublic int getChildCount()
getChildCount in interface IHierarchyParentpublic ConfigurationNode findChild(int index)
findChild in interface IHierarchyParentindex - is the child number.
public void removeChild(int index)
removeChild in interface IHierarchyParentindex - is the child to remove.
public void addChild(int index,
ConfigurationNode child)
addChild in interface IHierarchyParentindex - is the position to add the child.child - is the child to add.public void clearChildren()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||