public class Dom4JXmlFileBuilder extends Object implements XmlFileBuilder
Constructor and Description |
---|
Dom4JXmlFileBuilder(FileHandler fileHandler)
creates the instance, which will use the specified @{link FileHandler fileHandler} to read or
write the xml file.
|
Modifier and Type | Method and Description |
---|---|
void |
insertElementsUnderXPath(String elementsToParse,
String xpath)
this will parse one or more elements from elementToParse and insert them under the xpath.
|
void |
loadFile()
load the current xml file into a Document.
|
void |
setFile(String path)
sets the name of the file we will read and write.
|
void |
setNamespaces(Map namespaces)
assign prefix to namespace mappings used for xpath and other xml operations.
|
void |
writeFile()
write the current xml to disk.
|
public Dom4JXmlFileBuilder(FileHandler fileHandler)
fileHandler
- used for file i/o.public void setFile(String path)
setFile
in interface XmlFileBuilder
path
- - where the xml file will be read from or written to.public void insertElementsUnderXPath(String elementsToParse, String xpath)
insertElementsUnderXPath
in interface XmlFileBuilder
elementsToParse
- String containing one or more elements in textual formatxpath
- where to place the above elements.public void loadFile()
loadFile
in interface XmlFileBuilder
public void writeFile()
writeFile
in interface XmlFileBuilder
public void setNamespaces(Map namespaces)
setNamespaces
in interface XmlFileBuilder
namespaces
- - key is prefix value is urlCopyright © 2004-2013 Codehaus. All Rights Reserved.