|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.mmbase.util.xml.DocumentReader
The DocumentReader class provides methods for loading a xml document in memory. It serves as the base class for DocumentWriter (which adds ways to write a document), and XMLBasicReader, which adds path-like methods with which to retrieve elements.
| Field Summary | |
protected org.w3c.dom.Document |
document
|
static java.lang.String |
DTD_ERROR
DTD respource filename of the most recent Error DTD |
static java.lang.String |
DTD_ERROR_1_0
DTD resource filename of the Error DTD version 1.0 |
protected static java.lang.String |
FILENOTFOUND
|
static java.lang.String |
PUBLIC_ID_ERROR
Public ID of the most recent Error DTD |
static java.lang.String |
PUBLIC_ID_ERROR_1_0
Public ID of the Error DTD version 1.0 |
| Constructor Summary | |
protected |
DocumentReader()
Creates an empty document reader. |
|
DocumentReader(org.xml.sax.InputSource source)
Constructs the document by reading it from a source. |
|
DocumentReader(org.xml.sax.InputSource source,
boolean validating,
java.lang.Class resolveBase)
Constructs the document by reading it from a source. |
|
DocumentReader(java.lang.String path)
Constructs the document by reading it from a file. |
|
DocumentReader(java.lang.String path,
boolean validating,
java.lang.Class resolveBase)
Constructs the document by reading it from a source. |
| Method Summary | |
static javax.xml.parsers.DocumentBuilder |
getDocumentBuilder()
Creates a DocumentBuilder with default settings for handler, resolver, or validation, obtaining it from the cache if available. |
static javax.xml.parsers.DocumentBuilder |
getDocumentBuilder(boolean validating,
org.xml.sax.ErrorHandler handler,
org.xml.sax.EntityResolver resolver)
Creates a DocumentBuilder. |
java.lang.String |
getFileName()
Returns the systemID of the InputSource used to read the document. |
java.lang.String |
getNodeTextValue(org.w3c.dom.Node n)
Return the text value of a node. |
static void |
registerPublicIDs()
Register the Public Ids for DTDs used by XMLBasicReader This method is called by XMLEntityResolver. |
protected static boolean |
validate()
Returns the default setting for validation for DocumentReaders. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final java.lang.String FILENOTFOUND
public static final java.lang.String PUBLIC_ID_ERROR_1_0
public static final java.lang.String DTD_ERROR_1_0
public static final java.lang.String PUBLIC_ID_ERROR
public static final java.lang.String DTD_ERROR
protected org.w3c.dom.Document document
| Constructor Detail |
protected DocumentReader()
public DocumentReader(java.lang.String path)
path - the path to the file from which to read the document
public DocumentReader(java.lang.String path,
boolean validating,
java.lang.Class resolveBase)
path - the path to the file from which to read the documentvalidating - whether to validate the documentresolveBase - the base class whose package is used to resolve dtds, set to null if unknownpublic DocumentReader(org.xml.sax.InputSource source)
source - the input source from which to read the document
public DocumentReader(org.xml.sax.InputSource source,
boolean validating,
java.lang.Class resolveBase)
source - the input source from which to read the documentvalidating - whether to validate the documentresolveBase - the base class whose package is used to resolve dtds, set to null if unknown| Method Detail |
public static void registerPublicIDs()
protected static final boolean validate()
public static javax.xml.parsers.DocumentBuilder getDocumentBuilder()
public static javax.xml.parsers.DocumentBuilder getDocumentBuilder(boolean validating,
org.xml.sax.ErrorHandler handler,
org.xml.sax.EntityResolver resolver)
validating - if true, the documentbuilder will validate documents readhandler - a ErrorHandler class to use for catching parsing errors, pass null to use the default handlerresolver - a EntityResolver class used for resolving the document's dtd, pass null to use the default resolver
public java.lang.String getNodeTextValue(org.w3c.dom.Node n)
n - the Node whose value to determine
public java.lang.String getFileName()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||