|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.deploy.XmlStructure
public class XmlStructure
The structure for handling the XML files.
Constructor Summary | |
---|---|
XmlStructure(org.dom4j.Element subTreeRoot)
Constructor. |
|
XmlStructure(java.io.File f)
Constructor. |
Method Summary | |
---|---|
static java.util.List<org.dom4j.Element> |
getAllChildrenAlongPath(org.dom4j.Element current,
java.lang.String... path)
This function recursively calls it self, and retrieves all the leaf children from all sibling branches along the path. |
org.dom4j.Element |
getChild(java.lang.String name)
Function for retrieving a single specific branch. |
java.util.List<org.dom4j.Element> |
getChildren(java.lang.String name)
For receiving a list of specific branches. |
java.lang.String |
getLeafValue(java.lang.String... path)
Retrieves the content of a branch deep in tree structure. |
java.lang.String[] |
getLeafValues(java.lang.String... path)
Retrieves the content of a the leafs deep in the tree structure. |
org.dom4j.Element |
getRoot()
Function to retrieving the root of this branch in the XML tree. |
org.dom4j.Element |
getSubChild(java.lang.String... name)
For retrieving the first children along a path. |
java.lang.String |
getSubChildValue(java.lang.String... name)
Retrieves the content of a branch deep in tree structure. |
java.lang.String |
getXML()
Retrieves the XML code for this entire branch. |
static org.dom4j.Element |
makeElementFromString(java.lang.String content)
Creates an dom4j.Element from a String. |
void |
overWrite(org.dom4j.Element overwriter)
This function initialise the process of overwriting a part of the tree. |
void |
overWriteOnly(org.dom4j.Element branch,
java.lang.String value,
java.lang.String... path)
Overwrites the leaf at the end of the path from the branch. |
void |
overWriteOnlyInt(org.dom4j.Element branch,
int position,
char value,
java.lang.String... path)
Specific overwrite function for overwriting a specific character in a string. |
static java.lang.String |
pathAndContentToXML(java.lang.String content,
java.lang.String... path)
This function creates the XML code for the path. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlStructure(java.io.File f)
f
- The XML filepublic XmlStructure(org.dom4j.Element subTreeRoot)
subTreeRoot
- The root of the tree for this instanceMethod Detail |
---|
public org.dom4j.Element getRoot()
public org.dom4j.Element getChild(java.lang.String name)
name
- The name of the branch
public java.util.List<org.dom4j.Element> getChildren(java.lang.String name)
name
- The name of the children to be found.
public java.lang.String getXML()
public org.dom4j.Element getSubChild(java.lang.String... name)
name
- The path to the child.
public java.lang.String getSubChildValue(java.lang.String... name)
name
- Specifies the path in the tree (e.g. in HTML:
GetSubChildValue("HTML", "HEAD", "TITLE") to get the title of
a HTML document)
public java.lang.String getLeafValue(java.lang.String... path)
path
- Specifies the path in the tree (e.g. in HTML:
GetSubChildValue("HTML", "HEAD", "TITLE") to get the title of
a HTML document)
public java.lang.String[] getLeafValues(java.lang.String... path)
path
- Specifies the path in the tree (e.g. in HTML:
GetSubChildValue("HTML", "HEAD", "TITLE") to get the title of
a HTML document)
public void overWrite(org.dom4j.Element overwriter)
overwriter
- The settings instance for the current elementpublic void overWriteOnly(org.dom4j.Element branch, java.lang.String value, java.lang.String... path)
branch
- The branch where to begin.value
- The value to overwrite the leaf with.path
- The path from the branch to the leaf.public void overWriteOnlyInt(org.dom4j.Element branch, int position, char value, java.lang.String... path)
branch
- The initial branch of the XML tree.position
- The position in the String where the character are to be
changed.value
- The new value of the character to change.path
- The path to the leaf of the string to change.public static org.dom4j.Element makeElementFromString(java.lang.String content)
content
- The content of a String.
public static java.lang.String pathAndContentToXML(java.lang.String content, java.lang.String... path)
content
- The content at the leaf of the branch.path
- The path to the branch.
public static java.util.List<org.dom4j.Element> getAllChildrenAlongPath(org.dom4j.Element current, java.lang.String... path)
current
- The current element to retrieve children along the path.path
- The path to the leafs.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |