Package com.microstrategy.utils.xml
Class SAXHelper
- java.lang.Object
-
- com.microstrategy.utils.xml.SAXHelper
-
public class SAXHelper extends java.lang.ObjectThis is a helper class that assists in the parsing of XML files using SAX. It provides three class level methods:parseXmlFile(File, DefaultContentHandler, boolean, MessageRouter),parseXmlStream(InputStream, String, DefaultContentHandler, boolean, MessageRouter)andparseXmlSource(InputSource, DefaultContentHandler, boolean, MessageRouter). It uses standard classes for a content handler and message router.- Since:
- MicroStrategy Web 8.1.0
- See Also:
DefaultContentHandler,MessageRouter
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringXML_FEATURE_VALIDATION
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetSystemID(java.io.File file)Constructs a SYSTEM ID from a supplied File (which should represent the XML File being parsed).static voidparseXmlFile(java.io.File file, DefaultContentHandler contentHandler, boolean validate, MessageRouter msgRouter)Parse an XML file using the specified Content Handler and storing results in the supplied Subteam object.static voidparseXmlSource(org.xml.sax.InputSource inputSource, DefaultContentHandler contentHandler, boolean validate, MessageRouter msgRouter)Parse an XMLInputSourceobject.static voidparseXmlStream(java.io.InputStream inputStream, java.lang.String systemID, DefaultContentHandler contentHandler, boolean validate, MessageRouter msgRouter)Parses an XML InputStream using the specified Content Handler and storing results in the supplied Subteam object.
-
-
-
Field Detail
-
XML_FEATURE_VALIDATION
public static final java.lang.String XML_FEATURE_VALIDATION
- See Also:
- Constant Field Values
-
-
Method Detail
-
parseXmlFile
public static void parseXmlFile(java.io.File file, DefaultContentHandler contentHandler, boolean validate, MessageRouter msgRouter) throws SAXParsingExceptionParse an XML file using the specified Content Handler and storing results in the supplied Subteam object.- Parameters:
file- The XML File to process.contentHandler- The ContentHandler to use to parse this file.validate- Whether we should validate the XML document or not.msgRouter- TheMessageRouterobject to use for routing information, warning and error messages.- Throws:
SAXParsingException- If something fails while parsing.
-
parseXmlStream
public static void parseXmlStream(java.io.InputStream inputStream, java.lang.String systemID, DefaultContentHandler contentHandler, boolean validate, MessageRouter msgRouter) throws SAXParsingExceptionParses an XML InputStream using the specified Content Handler and storing results in the supplied Subteam object.- Parameters:
inputStream- The XML InputStream to process.systemID- The SystemID associated with the input stream.contentHandler- The ContentHandler to use to parse this file.validate- Whether we should validate the XML document or not.msgRouter- TheMessageRouterobject to use for routing information, warning and error messages.- Throws:
SAXParsingException- If something fails while parsing.
-
parseXmlSource
public static void parseXmlSource(org.xml.sax.InputSource inputSource, DefaultContentHandler contentHandler, boolean validate, MessageRouter msgRouter) throws SAXParsingExceptionParse an XMLInputSourceobject.- Parameters:
inputSource- TheInputSourceobject that corresponds to the XML source.contentHandler- The ContentHandler to use to parse this file.validate- Whether we should validate the XML document or not.msgRouter- TheMessageRouterobject to use for routing information, warning and error messages.- Throws:
SAXParsingException- If something fails while parsing.
-
getSystemID
public static java.lang.String getSystemID(java.io.File file)
Constructs a SYSTEM ID from a supplied File (which should represent the XML File being parsed).- Parameters:
file- TheFilerepresenting the XML file being parsed.- Returns:
- A SYSTEM ID for the file.
- Since:
- MicroStrategy Web 8.1.2
-
-