|
Jeospace API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jeospace.xml.XMLUtilities
Utility methods for retrieving xml DOM objects from a URL and for obtaining named document Elements.
Document,
Element,
URL| Constructor Summary | |
protected |
XMLUtilities()
Protected Constructor |
| Method Summary | |
static org.w3c.dom.Document |
createNewDocument()
Create and return a new empty xml DOM object |
static java.util.List |
getChildElements(org.w3c.dom.Element e)
Return the child Elements of the argument Element |
static org.w3c.dom.Document |
getDocument(org.xml.sax.InputSource is,
org.xml.sax.XMLReader reader)
Create and return a new xml DOM object parsed through an XMLReader
from the argument InputSource. |
static org.w3c.dom.Document |
getDocument(java.lang.String documentUrl)
Create and return a new xml DOM object parsed from the argument url string |
static org.w3c.dom.Document |
getDocument(java.net.URL url)
Create and return a new xml DOM object parsed from the argument URL |
static org.w3c.dom.Document |
getDocument(java.net.URL baseURL,
java.lang.String relativeUrlString)
Create and return a new xml DOM object parsed from the argument url parameters |
static org.w3c.dom.Element |
getElement(java.lang.String tag,
org.w3c.dom.Element e)
Return the first child Element of the argument Element
that matches the argument tagName |
static org.w3c.dom.Element |
getFirstChildElement(org.w3c.dom.Element e)
Return the first child Element of the argument Element |
static void |
printNode(org.w3c.dom.Node node,
java.io.PrintStream stream)
Print out a document node to the specified PrintStream. |
static void |
putDocument(org.w3c.dom.Document doc,
java.net.URI uri)
Write out the argument document to the specified URI |
static java.lang.String[] |
slice(java.lang.String string,
int[][] indices,
java.lang.String[] slices)
Segment the argument String into an array of substrings. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected XMLUtilities()
| Method Detail |
public static org.w3c.dom.Document getDocument(java.net.URL url)
URL
url - the document URL
URL, or
null if one cannot be created.
public static org.w3c.dom.Document getDocument(java.net.URL baseURL,
java.lang.String relativeUrlString)
baseURL - the context URLrelativeUrlString - the document path relative to the base URL
null if one cannot be created.public static org.w3c.dom.Document getDocument(java.lang.String documentUrl)
documentUrl - the url string
null if one cannot be created.
public static org.w3c.dom.Document getDocument(org.xml.sax.InputSource is,
org.xml.sax.XMLReader reader)
XMLReader
from the argument InputSource.
is - the InputSourcereader - the XMLReader
null if one cannot be created.public static org.w3c.dom.Document createNewDocument()
null if one cannot be created.
public static void putDocument(org.w3c.dom.Document doc,
java.net.URI uri)
doc - the document to writeuri - the uri indicating the local file to which to write the document.public static org.w3c.dom.Element getFirstChildElement(org.w3c.dom.Element e)
Element of the argument Element
e - the argument Element
Element of the argument Element,
null if the argument Element contains no child Elementspublic static java.util.List getChildElements(org.w3c.dom.Element e)
Elements of the argument Element
e - the argument Element
List of child Elements of the
argument Element
public static org.w3c.dom.Element getElement(java.lang.String tag,
org.w3c.dom.Element e)
Element of the argument Element
that matches the argument tagName
tag - the tag namee - the argument Element
Element matching the argument tagName,
null if an Element with the tag name is not found.
public static void printNode(org.w3c.dom.Node node,
java.io.PrintStream stream)
PrintStream.
node - the document node.stream - the ouptput PrintStream
public static java.lang.String[] slice(java.lang.String string,
int[][] indices,
java.lang.String[] slices)
String into an array of substrings.
string - the String to segmentindices - an array of begin/end indices of the desired substrings.
An end index of -1 indicates that the remainder of the String
from the begin index should be returned.slices - a String array to initialize with the return
substrings. If slices is null, or is not of sufficient capacity, a new
String array will be created and returned.
String array of substrings
IndexOutOfBoundsException - if the begin or end indices
are invalid per the conditions of String.substring( ).
|
Jeospace API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||