|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectto.etc.xml.DomTools
public class DomTools
Static utility class having stuff to easily obtain data from a DOM parsed document.
Field Summary | |
---|---|
static java.util.Date |
BIGBANG
|
static java.lang.String |
DBNULL
|
static java.util.Date |
OBLIVIAN
|
Method Summary | |
---|---|
static boolean |
boolAttr(org.w3c.dom.Node n,
java.lang.String aname)
|
static boolean |
boolAttr(org.w3c.dom.Node n,
java.lang.String aname,
boolean defval)
|
static java.lang.Boolean |
booleanNode(org.w3c.dom.Node rootnode,
java.lang.String name)
Finds the child node with the name specified, and returns it as a boolean value. |
static boolean |
boolNode(org.w3c.dom.Node rootnode,
java.lang.String name)
Finds the child node with the name specified, and returns it as a boolean value. |
static java.util.Date |
dateDecode(java.lang.String s)
Decodes a date and converts it to the local time. |
static java.lang.String |
dateEncode(java.util.Date dt)
Encodes a date-only field to some readable form. |
static java.util.Date |
dateNode(org.w3c.dom.Node rn,
java.lang.String name)
|
static java.util.Date |
dateNode(org.w3c.dom.Node rn,
java.lang.String name,
java.util.Date dflt)
|
static boolean |
decodeBoolStr(java.lang.String nt,
java.lang.String name)
|
static double |
doubleNode(org.w3c.dom.Node rootnode,
java.lang.String name,
double val)
|
static java.lang.String |
fileNameNode(org.w3c.dom.Node rootnode,
java.lang.String name)
Checks if there's a file node with the spec'd name in the node. |
static java.lang.String |
findChildNodeValue(org.w3c.dom.Node rootnode,
java.lang.String name)
Deprecated. |
static org.w3c.dom.Document |
getDocument(java.io.File inf,
boolean nsaware)
Creates a DOM parser, parses the document, and returns the DOM associated with the thing. |
static org.w3c.dom.Document |
getDocument(java.io.File inf,
org.xml.sax.ErrorHandler eh,
boolean nsaware)
Creates a DOM parser, parses the document, and returns the DOM associated with the thing. |
static org.w3c.dom.Document |
getDocument(java.io.InputStream is,
java.lang.String ident,
boolean nsaware)
Creates a DOM parser, parses the document, and returns the DOM associated with the thing. |
static org.w3c.dom.Document |
getDocument(java.io.InputStream is,
java.lang.String ident,
org.xml.sax.ErrorHandler eh,
boolean nsaware)
Creates a DOM parser, parses the document, and returns the DOM associated with the thing. |
static org.w3c.dom.Document |
getDocument(java.io.Reader is,
java.lang.String ident,
boolean nsaware)
Creates a DOM parser, parses the document, and returns the DOM associated with the thing. |
static org.w3c.dom.Document |
getDocument(java.io.Reader is,
java.lang.String ident,
org.xml.sax.ErrorHandler eh,
boolean nsaware)
Creates a DOM parser, parses the document, and returns the DOM associated with the thing. |
static org.w3c.dom.Document |
getDocumentFromZIP(java.io.File zipfile,
java.lang.String name,
org.xml.sax.ErrorHandler eh,
boolean nsaware)
|
static org.w3c.dom.Node |
getDocumentRoot(java.lang.String txt,
java.lang.String ident,
boolean nsaware)
|
static org.w3c.dom.Node |
getDocumentRoot(java.lang.String txt,
java.lang.String ident,
org.xml.sax.ErrorHandler eh,
boolean nsaware)
|
static int |
getNodeAttribute(org.w3c.dom.Node n,
java.lang.String aname,
int defval)
Get the named attribute from a node. |
static java.lang.String |
getNodeAttribute(org.w3c.dom.Node n,
java.lang.String aname,
java.lang.String defval)
Get the named attribute from a node. |
static org.w3c.dom.Node |
getRootElement(org.w3c.dom.Document doc)
|
static java.lang.String[] |
getStringList(org.w3c.dom.Node inn,
java.lang.String itemname)
|
static java.util.List<java.lang.String> |
getStringList(org.w3c.dom.Node inn,
java.lang.String listname,
java.lang.String itemname)
|
static int |
intAttr(org.w3c.dom.Node n,
java.lang.String aname)
|
static int |
intAttr(org.w3c.dom.Node n,
java.lang.String aname,
int defval)
|
static int |
intNode(org.w3c.dom.Node rootnode,
java.lang.String name)
|
static int |
intNode(org.w3c.dom.Node rootnode,
java.lang.String name,
int val)
|
static boolean |
isBigBang(java.util.Date dt)
|
static boolean |
isOblivian(java.util.Date dt)
|
static boolean |
isTextOnly(org.w3c.dom.Node inn)
|
static long |
longAttr(org.w3c.dom.Node n,
java.lang.String aname)
|
static java.lang.Long |
longAttrWrapped(org.w3c.dom.Node n,
java.lang.String aname)
|
static long |
longNode(org.w3c.dom.Node rootnode,
java.lang.String name)
|
static long |
longNode(org.w3c.dom.Node rootnode,
java.lang.String name,
long val)
|
static java.lang.Long |
longWrapperNode(org.w3c.dom.Node rootnode,
java.lang.String name)
|
static org.w3c.dom.Node |
nodeFind(org.w3c.dom.Node rn,
java.lang.String name)
Finds a single element with the name spec'd in the node. |
static org.w3c.dom.Node |
nodeFindXpath(org.w3c.dom.Node node,
java.lang.String xpathQuery)
Finds a child node, via the xpath query route. |
static java.util.List<org.w3c.dom.Node> |
nodesFind(org.w3c.dom.Node rn,
java.lang.String name)
Searches for child Nodes in the specified Node which have the specified name and returns the result as a Set. |
static void |
saveDocument(java.io.File of,
org.w3c.dom.Document doc)
|
static void |
setAttr(org.w3c.dom.Node elem,
java.lang.String name,
java.lang.String value)
|
static java.lang.String |
strAttr(org.w3c.dom.Node n,
java.lang.String aname)
|
static java.lang.String |
strAttr(org.w3c.dom.Node n,
java.lang.String aname,
java.lang.String def)
|
static java.lang.String |
stringNode_untrimmed(org.w3c.dom.Node rootnode,
java.lang.String name)
Finds the child node with the name specified, and returns it's text value. |
static java.lang.String |
stringNode_untrimmed(org.w3c.dom.Node rootnode,
java.lang.String name,
java.lang.String deflt)
Finds the child node with the name specified, and returns it's text value. |
static java.lang.String |
stringNode(org.w3c.dom.Node rootnode,
java.lang.String name)
Finds the child node with the name specified, and returns it's text value. |
static java.lang.String |
stringNode(org.w3c.dom.Node rootnode,
java.lang.String name,
int trunclen)
Finds the child node with the name specified, and returns it's text value. |
static java.lang.String |
stringNode(org.w3c.dom.Node rootnode,
java.lang.String name,
java.lang.String deflt)
Finds the child node with the name specified, and returns it's text value. |
static java.lang.String |
textFrom_untrimmed(org.w3c.dom.Node n)
Gets the text part contained in a node... |
static java.lang.String |
textFrom(org.w3c.dom.Node n)
Gets the text part contained in a node... |
static int |
timeNode(org.w3c.dom.Node rn,
java.lang.String name,
int dflt)
Scans a node as a hh:mm:ss time (or hh:mm). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.util.Date OBLIVIAN
public static final java.util.Date BIGBANG
public static final java.lang.String DBNULL
Method Detail |
---|
public static org.w3c.dom.Document getDocument(java.io.InputStream is, java.lang.String ident, org.xml.sax.ErrorHandler eh, boolean nsaware) throws java.lang.Exception
java.lang.Exception
public static org.w3c.dom.Node getDocumentRoot(java.lang.String txt, java.lang.String ident, org.xml.sax.ErrorHandler eh, boolean nsaware) throws java.lang.Exception
java.lang.Exception
public static org.w3c.dom.Node getDocumentRoot(java.lang.String txt, java.lang.String ident, boolean nsaware) throws java.lang.Exception
java.lang.Exception
public static org.w3c.dom.Document getDocument(java.io.Reader is, java.lang.String ident, org.xml.sax.ErrorHandler eh, boolean nsaware) throws java.lang.Exception
java.lang.Exception
public static org.w3c.dom.Document getDocument(java.io.File inf, org.xml.sax.ErrorHandler eh, boolean nsaware) throws java.lang.Exception
java.lang.Exception
public static org.w3c.dom.Document getDocument(java.io.File inf, boolean nsaware) throws java.lang.Exception
java.lang.Exception
public static org.w3c.dom.Document getDocument(java.io.InputStream is, java.lang.String ident, boolean nsaware) throws java.lang.Exception
java.lang.Exception
public static org.w3c.dom.Document getDocument(java.io.Reader is, java.lang.String ident, boolean nsaware) throws java.lang.Exception
java.lang.Exception
public static org.w3c.dom.Document getDocumentFromZIP(java.io.File zipfile, java.lang.String name, org.xml.sax.ErrorHandler eh, boolean nsaware) throws java.lang.Exception
java.lang.Exception
public static org.w3c.dom.Node nodeFind(org.w3c.dom.Node rn, java.lang.String name) throws java.lang.Exception
java.lang.Exception
public static java.util.List<org.w3c.dom.Node> nodesFind(org.w3c.dom.Node rn, java.lang.String name)
rn,
- the Node which is queried.name,
- the name of the childNodes we are searching.
public static java.lang.String textFrom_untrimmed(org.w3c.dom.Node n)
public static java.lang.String textFrom(org.w3c.dom.Node n)
@Deprecated public static java.lang.String findChildNodeValue(org.w3c.dom.Node rootnode, java.lang.String name) throws java.lang.Exception
java.lang.Exception
stringNode(Node, String)
public static java.lang.String stringNode(org.w3c.dom.Node rootnode, java.lang.String name) throws java.lang.Exception
java.lang.Exception
public static java.lang.String stringNode(org.w3c.dom.Node rootnode, java.lang.String name, int trunclen) throws java.lang.Exception
java.lang.Exception
public static java.lang.String stringNode(org.w3c.dom.Node rootnode, java.lang.String name, java.lang.String deflt) throws java.lang.Exception
java.lang.Exception
public static java.lang.String stringNode_untrimmed(org.w3c.dom.Node rootnode, java.lang.String name) throws java.lang.Exception
java.lang.Exception
public static java.lang.String stringNode_untrimmed(org.w3c.dom.Node rootnode, java.lang.String name, java.lang.String deflt) throws java.lang.Exception
java.lang.Exception
public static java.util.Date dateNode(org.w3c.dom.Node rn, java.lang.String name) throws java.lang.Exception
java.lang.Exception
public static java.util.Date dateNode(org.w3c.dom.Node rn, java.lang.String name, java.util.Date dflt) throws java.lang.Exception
java.lang.Exception
public static int timeNode(org.w3c.dom.Node rn, java.lang.String name, int dflt) throws java.lang.Exception
rn
- name
- dflt
-
java.lang.Exception
public static int intNode(org.w3c.dom.Node rootnode, java.lang.String name) throws java.lang.Exception
java.lang.Exception
public static int intNode(org.w3c.dom.Node rootnode, java.lang.String name, int val) throws java.lang.Exception
java.lang.Exception
public static java.lang.Long longWrapperNode(org.w3c.dom.Node rootnode, java.lang.String name) throws java.lang.Exception
java.lang.Exception
public static long longNode(org.w3c.dom.Node rootnode, java.lang.String name) throws java.lang.Exception
java.lang.Exception
public static long longNode(org.w3c.dom.Node rootnode, java.lang.String name, long val) throws java.lang.Exception
java.lang.Exception
public static double doubleNode(org.w3c.dom.Node rootnode, java.lang.String name, double val) throws java.lang.Exception
java.lang.Exception
public static java.lang.String fileNameNode(org.w3c.dom.Node rootnode, java.lang.String name) throws java.lang.Exception
rootnode
- name
-
java.lang.Exception
public static boolean boolNode(org.w3c.dom.Node rootnode, java.lang.String name) throws java.lang.Exception
java.lang.Exception
public static java.lang.Boolean booleanNode(org.w3c.dom.Node rootnode, java.lang.String name) throws java.lang.Exception
java.lang.Exception
public static boolean decodeBoolStr(java.lang.String nt, java.lang.String name)
public static java.lang.String getNodeAttribute(org.w3c.dom.Node n, java.lang.String aname, java.lang.String defval)
n
- the node to containing the attribute.aname
- the name of the attribute.defval
- the value to return if the attribute is not present,
public static java.lang.String strAttr(org.w3c.dom.Node n, java.lang.String aname, java.lang.String def)
public static java.lang.String strAttr(org.w3c.dom.Node n, java.lang.String aname)
public static int intAttr(org.w3c.dom.Node n, java.lang.String aname, int defval) throws java.lang.Exception
java.lang.Exception
public static int intAttr(org.w3c.dom.Node n, java.lang.String aname) throws java.lang.Exception
java.lang.Exception
public static long longAttr(org.w3c.dom.Node n, java.lang.String aname) throws java.lang.Exception
java.lang.Exception
public static java.lang.Long longAttrWrapped(org.w3c.dom.Node n, java.lang.String aname) throws java.lang.Exception
java.lang.Exception
public static boolean boolAttr(org.w3c.dom.Node n, java.lang.String aname) throws java.lang.Exception
java.lang.Exception
public static boolean boolAttr(org.w3c.dom.Node n, java.lang.String aname, boolean defval) throws java.lang.Exception
java.lang.Exception
public static int getNodeAttribute(org.w3c.dom.Node n, java.lang.String aname, int defval) throws java.lang.Exception
n
- the node to containing the attribute.aname
- the name of the attribute.defval
- the value to return if the attribute is not present,
java.lang.Exception
public static java.lang.String dateEncode(java.util.Date dt)
dt
- the date to encode.
public static java.util.Date dateDecode(java.lang.String s)
Format: 0123456789012345678901234567 2001-12-24 18:10:52.0012 (timezone)
s
-
public static final boolean isOblivian(java.util.Date dt)
public static final boolean isBigBang(java.util.Date dt)
public static final java.lang.String[] getStringList(org.w3c.dom.Node inn, java.lang.String itemname) throws java.lang.Exception
java.lang.Exception
public static final java.util.List<java.lang.String> getStringList(org.w3c.dom.Node inn, java.lang.String listname, java.lang.String itemname) throws java.lang.Exception
java.lang.Exception
public static org.w3c.dom.Node getRootElement(org.w3c.dom.Document doc) throws java.lang.Exception
java.lang.Exception
public static boolean isTextOnly(org.w3c.dom.Node inn)
public static void saveDocument(java.io.File of, org.w3c.dom.Document doc) throws java.lang.Exception
java.lang.Exception
public static void setAttr(org.w3c.dom.Node elem, java.lang.String name, java.lang.String value)
public static org.w3c.dom.Node nodeFindXpath(org.w3c.dom.Node node, java.lang.String xpathQuery) throws java.lang.Exception
node
- the node to searchxpathQuery
- path to the child node
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |