|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nl.idgis.giserver.DomUtils
public class DomUtils
Singleton to keep Dom utils. These methods will hides low level Dom navigation processing.
Constructor Summary | |
---|---|
DomUtils()
|
Method Summary | |
---|---|
static void |
addErrorReport(org.w3c.dom.Document doc,
java.lang.String className,
java.lang.String methodName,
java.lang.Exception e)
Add a error report as a collection of nodes to the document. |
static void |
addErrorReport(org.w3c.dom.Document doc,
java.lang.String className,
java.lang.String methodName,
java.lang.String message)
Add a error report as a collection of nodes to the document. |
static org.w3c.dom.Element |
addNewNodeElement(org.w3c.dom.Document doc,
org.deegree.datatypes.QualifiedName name,
java.lang.String value,
org.w3c.dom.Node home)
Add a new node at the given point into the Dom tree. |
static org.w3c.dom.Element |
addNewNodeElement(org.w3c.dom.Document doc,
java.lang.String name,
java.lang.String value,
org.w3c.dom.Node home)
Add a new node at the given point into the Dom tree. |
static org.w3c.dom.Element |
addNewNodeElement(java.lang.String name,
org.deegree.datatypes.QualifiedName value,
org.w3c.dom.Node home)
Add a new node at the given point into the Dom tree. |
static org.w3c.dom.Node |
addXmlString(org.w3c.dom.Element node,
java.lang.String xmlString)
Add an xml tagged string to a DomTree. |
static void |
clearNode(org.w3c.dom.Node node)
Get rid of everything for the Dom tree node. |
static void |
clearNodeChilds(org.w3c.dom.Node node)
Get rid of the children for a Dom tree node. |
static org.w3c.dom.Node |
copyNode(org.w3c.dom.Element nodeToCopy,
org.w3c.dom.Element destinationNodeForHook)
Copy a node from a document to (another) document |
static org.w3c.dom.Document |
createDocument(java.lang.String xml,
boolean validation)
Create for a given xml representation its corresponding DOM tree representation. |
static java.lang.String |
Dom2String(org.w3c.dom.Document document)
Convert a DOM tree info into a string in standard Xml format. |
static void |
DomPrintWriter(org.w3c.dom.Document document,
java.io.PrintWriter pw)
Writes a Dom document to the given output stream. |
static void |
DomStringWriter(org.w3c.dom.Document document,
java.io.StringWriter sw)
Writes a Dom document to the given string. |
static javax.xml.parsers.DocumentBuilder |
getDocumentBuilder(boolean validation)
Create a document builder. |
static org.w3c.dom.Document |
getNewDoucument()
creates a empty Dom document. |
static org.w3c.dom.Element |
getNodeNamed(org.w3c.dom.Node node,
java.lang.String name,
java.lang.Boolean grandchildren)
Search recursive in a dom tree for the first child or grant child (grandchildren=true) of type Element with the given name started at the given (parent) node . |
static void |
getNodesNamed(org.w3c.dom.Node startNode,
java.lang.String name,
java.util.Vector<org.w3c.dom.Node> findNodes,
boolean grandchildren)
Search recursive in a dom tree for the all children or grant children (grand children=true) with the given name started at the given (parent) node. |
static org.deegree.datatypes.QualifiedName |
readQualifiedName(org.w3c.dom.Element node)
Read qualified name. |
static void |
validateDocument(org.w3c.dom.Document document,
javax.xml.transform.Source schemaFile)
A given DOM tree will be validate again a xsd schema. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DomUtils()
Method Detail |
---|
public static org.w3c.dom.Document getNewDoucument()
public static java.lang.String Dom2String(org.w3c.dom.Document document)
document
-
public static javax.xml.parsers.DocumentBuilder getDocumentBuilder(boolean validation)
validation
- parsing with validation on
public static org.w3c.dom.Document createDocument(java.lang.String xml, boolean validation) throws org.xml.sax.SAXException, java.io.IOException
xml
- input for the Dom tree.validation
- indication parsing with validation
java.io.IOException
org.xml.sax.SAXException
public static void DomPrintWriter(org.w3c.dom.Document document, java.io.PrintWriter pw) throws javax.xml.transform.TransformerException, java.io.IOException
document
- the printing documentsw
- printer stream write domain
javax.xml.transform.TransformerException
java.io.IOException
public static void DomStringWriter(org.w3c.dom.Document document, java.io.StringWriter sw) throws javax.xml.transform.TransformerException
document
- the printing documentsw
- string stream write domain
javax.xml.transform.TransformerException
public static void validateDocument(org.w3c.dom.Document document, javax.xml.transform.Source schemaFile) throws org.xml.sax.SAXException, java.io.IOException
document
- to validateschemaFile
- source of the schema as file
org.xml.sax.SAXException
java.io.IOException
public static org.w3c.dom.Element addNewNodeElement(org.w3c.dom.Document doc, java.lang.String name, java.lang.String value, org.w3c.dom.Node home)
doc
- -
document reference needed to create new doc elementsname
- -
the name of the new nodevalue
- -
the value attached to the new nodehome
- -
node in the Dom tree where to insert the new node
public static org.w3c.dom.Element addNewNodeElement(org.w3c.dom.Document doc, org.deegree.datatypes.QualifiedName name, java.lang.String value, org.w3c.dom.Node home)
doc
- -
document reference needed to create new doc elementsname
- -
the qualified name of the new nodevalue
- -
the value attached to the new nodehome
- -
node in the Dom tree where to insert the new node
public static org.w3c.dom.Element addNewNodeElement(java.lang.String name, org.deegree.datatypes.QualifiedName value, org.w3c.dom.Node home)
name
- -
the name of the new nodevalue
- -
the value (qualified name) attached to the new nodehome
- -
node in the Dom tree where to insert the new node
public static void clearNodeChilds(org.w3c.dom.Node node)
node
- in a Dom treepublic static void clearNode(org.w3c.dom.Node node)
node
- in a Dom treepublic static void addErrorReport(org.w3c.dom.Document doc, java.lang.String className, java.lang.String methodName, java.lang.String message)
doc
- documentclassName
- report part class namemethodName
- report part method namemessage
- report part additional messagepublic static void addErrorReport(org.w3c.dom.Document doc, java.lang.String className, java.lang.String methodName, java.lang.Exception e)
doc
- documentclassName
- report part class namemethodName
- report part method namemessage
- report part additional messagepublic static org.w3c.dom.Element getNodeNamed(org.w3c.dom.Node node, java.lang.String name, java.lang.Boolean grandchildren)
startNode
- start the searching in the Dom treename
- the child name acting as search keygrandchildren
- search for grand children
public static void getNodesNamed(org.w3c.dom.Node startNode, java.lang.String name, java.util.Vector<org.w3c.dom.Node> findNodes, boolean grandchildren)
startNode
- start the searching in the Dom treenamer
- the child name acting as search keyfindNodes
- the collection childrengrandchildren
- search for grand childrenpublic static org.w3c.dom.Node addXmlString(org.w3c.dom.Element node, java.lang.String xmlString) throws org.xml.sax.SAXException, java.io.IOException
node
- insertion placexmlString
- info to add
java.io.IOException
org.xml.sax.SAXException
java.lang.Exception
public static org.w3c.dom.Node copyNode(org.w3c.dom.Element nodeToCopy, org.w3c.dom.Element destinationNodeForHook)
nodeToCopy
- source of the copydestinationNodeForHook
- destination node to insert the new copy
public static org.deegree.datatypes.QualifiedName readQualifiedName(org.w3c.dom.Element node) throws org.w3c.dom.DOMException, java.net.URISyntaxException
node
- containing the qualified name
java.net.URISyntaxException
org.w3c.dom.DOMException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |