Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.beans.parsers
Class IfsXmlParser

    java.lang.Object
      org.xml.sax.HandlerBase
          oracle.xml.parser.v2.DefaultXMLDocumentHandler
              oracle.ifs.beans.parsers.IfsXmlParser

All Implemented Interfaces:
  Parser, oracle.xml.parser.v2.XMLDocumentHandler, org.xml.sax.DocumentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

    public class IfsXmlParser

extends oracle.xml.parser.v2.DefaultXMLDocumentHandler
implements Parser

An IfsXmlParser is an XML parser that acts as the entry point for all iFS XML parsing functionality.

The main function of the parser is to determine the nature of the XML document it is processing, then select the appropriate content-specific parser and submit the document for processing by that parser.

As such, the parser provides for the transparent processing of iFS-specific XML documents, meaning those XML documents that are used to create iFS objects and configure iFS, as well as non-iFS XML documents that are meant to be simply stored in iFS, with or without validation.

The parser uses a PropertyBundle called XmlParserLookup to find the appropriate parser, then instantiates it. If the parser determines the document to be an iFS-specific XML document, it instantiates the standard iFS parser. Otherwise, the parser looks for a custom parser and instantiates that instead. Finally, the parser will look for a parser that would simply create a literal iFS document from the XML document.

The parser can create a DOM tree from the XML document, if required. It uses the Oracle DOM parser to create the DOM. The content-specific parsers instantiated by the parser can get the DOM by calling `createDOM`. The parser object is passed to the content-specific parsers for this purpose.

The parser implements the Parser interface, while the content-specific parsers instantiated by the parser implement the XmlParserInterface.

(Unpublished)

Field Summary
`static java.lang.String` | `CUSTOM_PARSER` The name associated with the registered custom parser, in the property bundle containing the class path of registered parsers.
`static java.lang.String` | `DEFAULT_DTD_VALIDATION` The name associated with the default DTD validation option, in the property bundle containing the class path of registered parsers.
`static java.lang.String` | `DEFAULT_NAMESPACE` The name associated with the default namespace, in the property bundle containing the class path of registered parsers.
`static java.lang.String` | `DTD_NAME` The key associated with the DTD found by preparsing
`static java.lang.String` | `LITERAL_DOCUMENT_PARSER` The name associated with the registered literal document parser, in the property bundle containing the class path of registered parsers.
`protected java.util.Hashtable` | `m_PreParseElements` Hashtable for holding interesting objects encountered during pre-parsing
`protected boolean` | `m_RoundtripEnabled` Boolean indicating whether Roundtrip functionality has been enabled
`protected LibrarySession` | `m_Session` The LibrarySession which constructed this XmlParser
`static java.lang.String` | `OBJECT_LIST_TAG` The tag which specificies a collection of objects
`static java.lang.String` | `PARSER_PROPERTYBUNDLE` The name of the property bundle containing the class path of registered parsers.
`static java.lang.String` | `ROOT_ELEMENT` The key associated with the root element type found by preparsing
`static java.lang.String` | `ROUNDTRIP_ENABLED` The property name associated with the boolean indicating whether Roundtrip functionality is enabled, in the property bundle containing the class path of registered parsers.
`static java.lang.String` | `SIMPLE_USER_TAG` The tag which specificies creation of a user through UserManager

Fields inherited from interface oracle.ifs.beans.parsers.Parser
`CURRENT_NAME_OPTION, CURRENT_PATH_OPTION, DOCUMENT_CHARSET_OPTION, DOCUMENT_LANGUAGE_OPTION, LITERAL_DOCUMENT_OPTION, UPDATE_OBJECT_OPTION, VALIDATE_DOCUMENT_OPTION`

Constructor Summary
`IfsXmlParser(LibrarySession session)` Constucts an IfsXmlParser

Method Summary
`oracle.xml.parser.v2.XMLDocument` | `createDOM(java.io.InputStream stream, boolean validate)` Creates the DOM object from an InputStream, using the Oracle DOM Parser.
`oracle.xml.parser.v2.XMLDocument` | `createDOM(java.io.Reader reader, boolean validate)` Creates the DOM object from a Reader, using the Oracle DOM Parser.
`boolean` | `isRoundtripEnabled()` Returns true if Roundtrip functionality is enabled, false otherwise.
`LibraryObject` | `parse(java.io.InputStream stream, ParserCallback callback, java.util.Hashtable options)` Inherited from Parser
`LibraryObject` | `parse(java.io.Reader reader, ParserCallback callback, java.util.Hashtable options)` Inherited from Parser
`void` | `setDoctype(oracle.xml.parser.v2.DTD dtd)` Handles the event that occurs when the SAX parser encounters the DTD declaration in an XML document during pre-parsing.
`void` | `startElement(oracle.xml.parser.v2.NSName name, oracle.xml.parser.v2.SAXAttrList atts)` Handles the event that occurs when the SAX parser encounters the Root Element in an XML document during pre-parsing.

Methods inherited from class oracle.xml.parser.v2.DefaultXMLDocumentHandler
`cDATASection, comment, endDoctype, endElement, endElement, endPrefixMapping, getHandler, setError, setHandler, setTextDecl, setXMLDecl, setXMLSchema, skippedEntity, startElement, startPrefixMapping`

Methods inherited from class org.xml.sax.HandlerBase
`characters, endDocument, endElement, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, startDocument, startElement, unparsedEntityDecl, warning`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.xml.sax.DocumentHandler
`characters, endDocument, endElement, ignorableWhitespace, processingInstruction, setDocumentLocator, startDocument, startElement`

Field Detail

### PARSER_PROPERTYBUNDLE

    public static final java.lang.String PARSER_PROPERTYBUNDLE

  Description copied from class: `IfsXmlParser`
  The name of the property bundle containing the class path of registered parsers.

  See Also:
    Constant Field Values
  (Unpublished)

### CUSTOM_PARSER

    public static final java.lang.String CUSTOM_PARSER

  Description copied from class: `IfsXmlParser`
  The name associated with the registered custom parser, in the property bundle containing the class path of registered parsers.

  See Also:
    Constant Field Values
  (Unpublished)

### LITERAL_DOCUMENT_PARSER

    public static final java.lang.String LITERAL_DOCUMENT_PARSER

  Description copied from class: `IfsXmlParser`
  The name associated with the registered literal document parser, in the property bundle containing the class path of registered parsers.

  See Also:
    Constant Field Values
  (Unpublished)

### DEFAULT_DTD_VALIDATION

    public static final java.lang.String DEFAULT_DTD_VALIDATION

  Description copied from class: `IfsXmlParser`
  The name associated with the default DTD validation option, in the property bundle containing the class path of registered parsers.

  See Also:
    Constant Field Values
  (Unpublished)

### DEFAULT_NAMESPACE

    public static final java.lang.String DEFAULT_NAMESPACE

  Description copied from class: `IfsXmlParser`
  The name associated with the default namespace, in the property bundle containing the class path of registered parsers.

  See Also:
    Constant Field Values
  (Unpublished)

### ROUNDTRIP_ENABLED

    public static final java.lang.String ROUNDTRIP_ENABLED

  Description copied from class: `IfsXmlParser`
  The property name associated with the boolean indicating whether Roundtrip functionality is enabled, in the property bundle containing the class path of registered parsers.

  See Also:
    Constant Field Values
  (Unpublished)

### ROOT_ELEMENT

    public static final java.lang.String ROOT_ELEMENT

  Description copied from class: `IfsXmlParser`
  The key associated with the root element type found by preparsing

  See Also:
    Constant Field Values
  (Unpublished)

### DTD_NAME

    public static final java.lang.String DTD_NAME

  Description copied from class: `IfsXmlParser`
  The key associated with the DTD found by preparsing

  See Also:
    Constant Field Values
  (Unpublished)

### OBJECT_LIST_TAG

    public static final java.lang.String OBJECT_LIST_TAG

  Description copied from class: `IfsXmlParser`
  The tag which specificies a collection of objects

  See Also:
    Constant Field Values
  (Unpublished)

### SIMPLE_USER_TAG

    public static final java.lang.String SIMPLE_USER_TAG

  Description copied from class: `IfsXmlParser`
  The tag which specificies creation of a user through UserManager

  See Also:
    Constant Field Values
  (Unpublished)

### m_PreParseElements

    protected java.util.Hashtable m_PreParseElements

  Description copied from class: `IfsXmlParser`
  Hashtable for holding interesting objects encountered during pre-parsing

  (Unpublished)

### m_RoundtripEnabled

    protected boolean m_RoundtripEnabled

  Description copied from class: `IfsXmlParser`
  Boolean indicating whether Roundtrip functionality has been enabled

  (Unpublished)

### m_Session

    protected LibrarySession m_Session

  Description copied from class: `IfsXmlParser`
  The LibrarySession which constructed this XmlParser

  (Unpublished)

Constructor Detail

### IfsXmlParser

    public IfsXmlParser(LibrarySession session)

  Constucts an IfsXmlParser

  Parameters:
    `session` - the LibrarySession
  (Unpublished)

Method Detail

### parse

    public final LibraryObject parse(java.io.InputStream stream,
                                     ParserCallback callback,
                                     java.util.Hashtable options)
                              throws IfsException

  Description copied from class: `IfsXmlParser`
  Inherited from Parser

  Specified by:
    `parse` in interface `Parser`
  Parameters:
    `stream` - the InputStream
    `callback` - an application object that interacts with the the parsing process; optional, can be null
    `options` - any Parser-specific options
  Returns:
    The primary object created. If there is only one top level object then this is returned. If no object is "primary" then null is returned.
  Throws:
    `IfsException` - (IFS-12601) if the operation fails
  (Unpublished)

### parse

    public final LibraryObject parse(java.io.Reader reader,
                                     ParserCallback callback,
                                     java.util.Hashtable options)
                              throws IfsException

  Description copied from class: `IfsXmlParser`
  Inherited from Parser

  Specified by:
    `parse` in interface `Parser`
  Parameters:
    `reader` - the Reader
    `callback` - an application object that interacts with the the parsing process; optional, can be null
    `options` - any Parser-specific options
  Returns:
    The primary object created. If there is only one top level object then this is returned. If no object is "primary" then null is returned.
  Throws:
    `IfsException` - (IFS-12602) if the operation fails
  (Unpublished)

### isRoundtripEnabled

    public boolean isRoundtripEnabled()
                               throws IfsException

  Description copied from class: `IfsXmlParser`
  Returns true if Roundtrip functionality is enabled, false otherwise.

  Returns:
    true if Roundtrip functionality is enabled
  Throws:
    `IfsException` - thrown if the operation fails
  (Unpublished)

### createDOM

    public oracle.xml.parser.v2.XMLDocument createDOM(java.io.InputStream stream,
                                                      boolean validate)
                                               throws IfsException

  Description copied from class: `IfsXmlParser`
  Creates the DOM object from an InputStream, using the Oracle DOM Parser.

  Parameters:
    `stream` - the InputStream representing the XML document
    `validate` - boolean indicating whether the DOM parser should be used in validating or non-validating mode
  Returns:
    the DOM object
  Throws:
    `IfsException` - thrown if the operation fails
  (Unpublished)

### createDOM

    public oracle.xml.parser.v2.XMLDocument createDOM(java.io.Reader reader,
                                                      boolean validate)
                                               throws IfsException

  Description copied from class: `IfsXmlParser`
  Creates the DOM object from a Reader, using the Oracle DOM Parser.

  Parameters:
    `reader` - the Reader representing the XML document
    `validate` - boolean indicating whether the DOM parser should be used in validating or non-validating mode
  Returns:
    the DOM object
  Throws:
    `IfsException` - thrown if the operation fails
  (Unpublished)

### setDoctype

    public void setDoctype(oracle.xml.parser.v2.DTD dtd)
                    throws org.xml.sax.SAXException

  Description copied from class: `IfsXmlParser`
  Handles the event that occurs when the SAX parser encounters the DTD declaration in an XML document during pre-parsing.

  The DTD name, which follows "

  Specified by:
    `setDoctype` in interface `oracle.xml.parser.v2.XMLDocumentHandler`
  Overrides:
    `setDoctype` in class `oracle.xml.parser.v2.DefaultXMLDocumentHandler`
  Parameters:
    `dtd` - holds the Document Type Definition information encountered in the XML document.
  Throws:
    `org.xml.sax.SAXException` - if an error occurs
  (Unpublished)

### startElement

    public void startElement(oracle.xml.parser.v2.NSName name,
                             oracle.xml.parser.v2.SAXAttrList atts)
                      throws org.xml.sax.SAXException

  Description copied from class: `IfsXmlParser`
  Handles the event that occurs when the SAX parser encounters the Root Element in an XML document during pre-parsing.

  Once the event occurs, we are no longer interested in continuing the pre-parsing with the SAX parser. So we throw to stop the SAX parser, and place the Root Element's name in the hashtable for subsequent use.

  Specified by:
    `startElement` in interface `oracle.xml.parser.v2.XMLDocumentHandler`
  Overrides:
    `startElement` in class `oracle.xml.parser.v2.DefaultXMLDocumentHandler`
  Parameters:
    `name` - holds the type (name) of the Root Element as well as namespace information about the Root Element
    `atts` - holds any attributes associated with the Root Element
  Throws:
    `org.xml.sax.SAXException` - if an error occurs
  (Unpublished)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD