Package org.eigenbase.xom.wrappers
Class GenericDOMParser
java.lang.Object
org.eigenbase.xom.wrappers.GenericDOMParser
- All Implemented Interfaces:
Locator
,Parser
,ErrorHandler
- Direct Known Subclasses:
JaxpDOMParser
,XercesDOMParser
- Since:
- Aug 29, 2002
- Version:
- $Id: //open/util/resgen/src/org/eigenbase/xom/wrappers/GenericDOMParser.java#6 $
- Author:
- jhyde
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Document
The document which spawns elements.(package private) StringWriter
(package private) PrintWriter
(package private) static final String
(package private) static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a wrapper representing an XML element.void
Error.void
Fatal error.getLocation
(DOMWrapper wrapper) protected void
boolean
Returns whether the parser is retaining position information.parse
(InputStream is) Parses an input stream and returns a wrapped element.Parses the contents of a reader and returns a wrapped element.Parses a string and returns a wrapped element.Parses the contents of a URL and returns a wrapped element.protected abstract Document
Parses the specified URI and returns the document.protected void
void
setKeepPositions
(boolean keepPositions) Sets whether to retain position information.void
Warning.
-
Field Details
-
errorBuffer
StringWriter errorBuffer -
errorOut
PrintWriter errorOut -
document
The document which spawns elements. The constructor of the derived class must set this. -
LOAD_EXTERNAL_DTD_FEATURE
- See Also:
-
VALIDATION_FEATURE
- See Also:
-
-
Constructor Details
-
GenericDOMParser
GenericDOMParser()
-
-
Method Details
-
create
Description copied from interface:Parser
Creates a wrapper representing an XML element. -
parse
Description copied from interface:Parser
Parses an input stream and returns a wrapped element.- Specified by:
parse
in interfaceParser
- Parameters:
is
- Input stream- Returns:
- Wrapped element
- Throws:
XOMException
- on error
-
setKeepPositions
public void setKeepPositions(boolean keepPositions) Description copied from interface:Parser
Sets whether to retain position information.- Specified by:
setKeepPositions
in interfaceParser
- Parameters:
keepPositions
- Whether to keep position information.
-
isKeepPositions
public boolean isKeepPositions()Description copied from interface:Parser
Returns whether the parser is retaining position information.- Specified by:
isKeepPositions
in interfaceParser
- Returns:
- Whether to keep position information.
-
parse
Description copied from interface:Parser
Parses a string and returns a wrapped element.- Specified by:
parse
in interfaceParser
- Parameters:
xmlString
- XML string- Returns:
- Wrapped element
- Throws:
XOMException
- on error
-
parse
Description copied from interface:Parser
Parses the contents of a reader and returns a wrapped element.- Specified by:
parse
in interfaceParser
- Parameters:
reader
- Reader- Returns:
- Wrapped element
- Throws:
XOMException
- on error
-
parseInputSource
Parses the specified URI and returns the document.- Parameters:
in
- Input source- Returns:
- Document
- Throws:
XOMException
- on error
-
warning
Warning.- Specified by:
warning
in interfaceErrorHandler
-
error
Error.- Specified by:
error
in interfaceErrorHandler
-
fatalError
Fatal error.- Specified by:
fatalError
in interfaceErrorHandler
- Throws:
SAXException
-
parse
Description copied from interface:Parser
Parses the contents of a URL and returns a wrapped element.- Specified by:
parse
in interfaceParser
- Parameters:
url
- URL- Returns:
- Wrapped element
- Throws:
XOMException
- on error
-
prepareParse
protected void prepareParse() -
handleErrors
- Throws:
XOMException
-
getLocation
- Specified by:
getLocation
in interfaceLocator
-