Class StAXSAXParser
java.lang.Object
com.nomagic.magicreport.engine.xml.StAXSAXParser
Provides a SAX interface for reading an XML document using StAX parser.
- Since:
- Dec 24, 2009
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidparse(InputStream stream, DefaultHandler dh) Parse the content given InputStream as XML using the specifiedDefaultHandler.voidparse(Reader reader, DefaultHandler dh) Parse the content given Reader as XML using the specifiedDefaultHandler.voidparse(InputSource is, DefaultHandler dh) Parse the content givenInputSourceas XML using the specifiedDefaultHandler.voidsetNamespaceAware(boolean awareness) Specifies that the parser produced by this code will provide support for XML namespaces.voidsetProperty(String name, Object value) Allows the user to set specific feature/property on the underlying implementation.voidsetValidating(boolean validating) Specifies that the parser produced by this code will validate documents as they are parsed.
-
Constructor Details
-
StAXSAXParser
public StAXSAXParser()
-
-
Method Details
-
setNamespaceAware
public void setNamespaceAware(boolean awareness) Specifies that the parser produced by this code will provide support for XML namespaces. By default the value of this is set tofalse.- Parameters:
awareness- true if the parser produced by this code will provide support for XML namespaces; false otherwise.
-
setValidating
public void setValidating(boolean validating) Specifies that the parser produced by this code will validate documents as they are parsed. By default the value of this is set tofalse.- Parameters:
validating- true if the parser produced by this code will validate documents as they are parsed; false otherwise.
-
setProperty
Allows the user to set specific feature/property on the underlying implementation. The underlying implementation is not required to support every setting of every property in the specification and may use IllegalArgumentException to signal that an unsupported property may not be set with the specified value.- Parameters:
name- The name of the property (may not be null)value- The value of the property- Throws:
IllegalArgumentException- if the property is not supported
-
parse
Parse the content given Reader as XML using the specifiedDefaultHandler.- Parameters:
reader- The Reader containing the content to be parsed.dh- The SAX DefaultHandler to use.- Throws:
IllegalArgumentException- If theInputSourceobject isnull.IOException- If any IO errors occur.SAXException- If any SAX errors occur during processing.- See Also:
-
parse
Parse the content given InputStream as XML using the specifiedDefaultHandler.- Parameters:
stream- The InputStream containing the content to be parsed.dh- The SAX DefaultHandler to use.- Throws:
IllegalArgumentException- If theInputSourceobject isnull.IOException- If any IO errors occur.SAXException- If any SAX errors occur during processing.- See Also:
-
parse
Parse the content givenInputSourceas XML using the specifiedDefaultHandler.- Parameters:
is- The InputSource containing the content to be parsed.dh- The SAX DefaultHandler to use.- Throws:
IllegalArgumentException- If theInputSourceobject isnull.IOException- If any IO errors occur.SAXException- If any SAX errors occur during processing.- See Also:
-