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 DocumentThe 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.voidError.voidFatal error.getLocation(DOMWrapper wrapper) protected voidbooleanReturns 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 DocumentParses the specified URI and returns the document.protected voidvoidsetKeepPositions(boolean keepPositions) Sets whether to retain position information.voidWarning.
-
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:ParserCreates a wrapper representing an XML element. -
parse
Description copied from interface:ParserParses an input stream and returns a wrapped element.- Specified by:
parsein interfaceParser- Parameters:
is- Input stream- Returns:
- Wrapped element
- Throws:
XOMException- on error
-
setKeepPositions
public void setKeepPositions(boolean keepPositions) Description copied from interface:ParserSets whether to retain position information.- Specified by:
setKeepPositionsin interfaceParser- Parameters:
keepPositions- Whether to keep position information.
-
isKeepPositions
public boolean isKeepPositions()Description copied from interface:ParserReturns whether the parser is retaining position information.- Specified by:
isKeepPositionsin interfaceParser- Returns:
- Whether to keep position information.
-
parse
Description copied from interface:ParserParses a string and returns a wrapped element.- Specified by:
parsein interfaceParser- Parameters:
xmlString- XML string- Returns:
- Wrapped element
- Throws:
XOMException- on error
-
parse
Description copied from interface:ParserParses the contents of a reader and returns a wrapped element.- Specified by:
parsein 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:
warningin interfaceErrorHandler
-
error
Error.- Specified by:
errorin interfaceErrorHandler
-
fatalError
Fatal error.- Specified by:
fatalErrorin interfaceErrorHandler- Throws:
SAXException
-
parse
Description copied from interface:ParserParses the contents of a URL and returns a wrapped element.- Specified by:
parsein interfaceParser- Parameters:
url- URL- Returns:
- Wrapped element
- Throws:
XOMException- on error
-
prepareParse
protected void prepareParse() -
handleErrors
- Throws:
XOMException
-
getLocation
- Specified by:
getLocationin interfaceLocator
-