oracle.ifs.beans.parsers
Class IfsXmlParser


oracle.ifs.beans.parsers.IfsXmlParser

All Implemented Interfaces:
Parser

public class IfsXmlParser
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.


Fields inherited from interface oracle.ifs.beans.parsers.Parser
CURRENT_NAME_OPTION, CURRENT_PATH_OPTION, DOCUMENT_CHARSET_OPTION, DOCUMENT_LANGUAGE_OPTION, UPDATE_OBJECT_OPTION, VALIDATE_DOCUMENT_OPTION
 
Constructor Summary
IfsXmlParser(LibrarySession ls)
          Constucts an XmlParser
 
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.
 LibraryObject parse(java.io.InputStream stream, ParserCallback callback, java.util.Hashtable options)
          Inherited from Parser
 

Constructor Detail


IfsXmlParser


public IfsXmlParser(LibrarySession ls)
Constucts an XmlParser
Parameters:
ls - the LibrarySession
Method Detail

parse


public final LibraryObject parse(java.io.InputStream stream,
                                 ParserCallback callback,
                                 java.util.Hashtable options)
                          throws IfsException
Inherited from Parser
Specified by:
parse in interface Parser
Following copied from interface: oracle.ifs.beans.parsers.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

createDOM


public oracle.xml.parser.v2.XMLDocument createDOM(java.io.InputStream stream,
                                                  boolean validate)
                                           throws IfsException
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