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 SimpleXmlParserImpl

    java.lang.Object
      oracle.ifs.beans.parsers.SimpleXmlParserImpl

    public class SimpleXmlParserImpl

extends java.lang.Object

Performs most of the parsing. Stores the callback class, options table, localizer and the number of objects created so far. How the SimpleXmlParserImpl works: Each instance of a SimpleXmlParserImpl parses a single DOM Tree. The DOM Tree is recursed (on the stack) and actions are performed based on the content of the tree. An XML tag can represent either The object which the XML creates is represented by a DefinitionHolder object. The DefinitionHolder object is a struct which contains a LibraryObjectDefinition and some other gunk (Updates info, PropertyBundle stuff, User password) which cannot be directly set on a LOD. As the tree is traversed, information is added to the DefinitionHolder and the LOD it contains. For each attribute being set in a DH, an AttributeDescription object is created. The AD object holds information about the attribute being parsed. This information includes the Name of the attribute, the datatype of the attribute and the ClassDomain (if applicable) of the attribute. Note that an AD may represent a "virtual" attribute for which no corresponding Attribute object exists in iFS. Such virtual attributes are used for tags which do not directly correspond to real Object attributes (e.g. Password). After an attribute has been completely parsed, it is set on the DH, and the calls return. Note that the attribute parsing functions do NOT return a value which is set by the top-level attribute handled. Instead, each attribute parsing function sets the value in the DH itself.

(Unpublished)

Field Summary
`protected java.util.Hashtable` | `m_Options`
`protected LibrarySession` | `m_Session`

Method Summary
`protected static boolean` | `checkAction(org.w3c.dom.Element element)` Checks to see if the element represents an Add or Remove action.
`protected LibraryObject` | `createObject(DefinitionHolder dh, DefinitionHolder parentDh)` Creates an object given a LibraryObjectDefinition.
`protected LibraryObject` | `createObject(org.w3c.dom.Element parent, DefinitionHolder parentDh, AttributeDescription attribute)` Creates a libraryObject based on an DOM element.
`protected LibraryObject` | `createObjectWithClass(DefinitionHolder parentDh, org.w3c.dom.Element element, AttributeDescription attribute)` Creates an object from an XMLElement
`protected void` | `ensureLegalPublicObjectDefinition(PublicObjectDefinition pod, LibrarySession session, PublicObject objectForUpdate)` Ensure that the specified PublicObjectDefinition is legal, and fix if possible.
`protected static java.lang.String` | `getCaseInsensitiveAttribute(org.w3c.dom.Element element, java.lang.String attributeName)` Returns the attribute on the element with the given name.
`protected static int` | `getDatatypeFromName(java.lang.String type)` Returns the integer datatype number (defined in Attribute.java) for the given String datatype descriptor.
`protected LibraryObjectDefinition` | `getDefinitionInstance(java.lang.String name)` Creates the instance of the passed in definition classname
`protected static org.w3c.dom.Element` | `getFirstElementChild(org.w3c.dom.Node element)` Returns the first non-comment, non-processingIntruction child of the passed in Node.
`protected static org.w3c.dom.Node` | `getFirstNodeChild(org.w3c.dom.Node element)` Returns the first non-comment, non-processingIntruction, non-DTD child of the passed in Node.
`protected static org.w3c.dom.Element` | `getNextElementSibling(org.w3c.dom.Node element)` Returns the next non-comment, non-processingIntruction sibling of the passed in Node.
`int` | `getObjectsCreatedCount()` Returns the number of objects created (excluding master-detail objects).
`protected java.util.Hashtable` | `getOptions()` Returns the options hashtable this parser was invoked with.
`protected LibraryObject` | `handleExistingRef(DefinitionHolder dh, AttributeDescription attribute)` Reads an existing object out of an object which is being updated.
`protected LibraryObject` | `handleIdRef(org.w3c.dom.Element element, int datatype)` Finds an object by Object Id
`protected PublicObject` | `handlePathRef(org.w3c.dom.Element element, AttributeDescription attribute)` Finds an object by path
`protected LibraryObject` | `handleRef(DefinitionHolder dh, org.w3c.dom.Element element, AttributeDescription attribute)` Finds an object by reference.
`protected LibraryObject` | `handleRefType(DefinitionHolder dh, org.w3c.dom.Element element, java.lang.String refType, AttributeDescription attribute)` Finds an object by reference.
`protected LibraryObject` | `handleSearchRef(org.w3c.dom.Element element, AttributeDescription attribute, java.lang.String searchAttributeName)` Reads an existing object out of an object which is being updated.
`protected LibraryObject` | `handleValueDefaultRef(org.w3c.dom.Element element, AttributeDescription attribute)` Finds an object referenced by a named ValueDefault
`protected boolean` | `ignoreUnsettable()`
`protected java.lang.String` | `lookupDefinitionName(ClassObject co)` Looks up the definition classname for the ClassObject.
`protected void` | `processChildTag(DefinitionHolder dh, ClassObject co, org.w3c.dom.Element currentChild)` Process a node, using the classObject for the document and altering the current definition if neccessary.
`protected DefinitionHolder` | `processDefinition(java.lang.String definitionName, ClassObject co, DefinitionHolder parentDh, AttributeDescription attribute, org.w3c.dom.Element parent)` Create DefinitionHolder given the name of the Definition class to use and the ClassObject of the object being created.
`protected LibraryObject` | `readLibraryObject(DefinitionHolder dh, org.w3c.dom.Element element, AttributeDescription attribute)` Reads in a LibraryObject from an XMLElement.
`protected java.lang.Object` | `readValue(DefinitionHolder dh, org.w3c.dom.Element currentChild, AttributeDescription attribute)` Reads a value from a DOM element, assuming the value has the specified datatype.
`protected void` | `signalException(IfsException e)` Calls CallBack.signalException() if a Callback is defined.

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

Field Detail

### m_Session

    protected LibrarySession m_Session

### m_Options

    protected java.util.Hashtable m_Options

Method Detail

### getObjectsCreatedCount

    public final int getObjectsCreatedCount()

  Description copied from class: `SimpleXmlParserImpl`
  Returns the number of objects created (excluding master-detail objects).

  Returns:
    The number of objects created

### getOptions

    protected final java.util.Hashtable getOptions()

  Description copied from class: `SimpleXmlParserImpl`
  Returns the options hashtable this parser was invoked with.

  Returns:
    The options hashtable. May be null if none specified

### createObject

    protected final LibraryObject createObject(org.w3c.dom.Element parent,
                                               DefinitionHolder parentDh,
                                               AttributeDescription attribute)
                                        throws IfsException

  Description copied from class: `SimpleXmlParserImpl`
  Creates a libraryObject based on an DOM element.

  Parameters:
    `parent` - The node to create LibraryObject based on
    `parentDh` - The definition which will contain the definition created by this function. May be null if this is top-level.
    `attribute` - The attribute which will be set by this call. May be null if this is top-level or not an attribute- setting call.
  Returns:
    The create object, or null if no object could be created
  Throws:
    `IfsException` - thrown if the operation fails

### processDefinition

    protected DefinitionHolder processDefinition(java.lang.String definitionName,
                                                 ClassObject co,
                                                 DefinitionHolder parentDh,
                                                 AttributeDescription attribute,
                                                 org.w3c.dom.Element parent)
                                          throws IfsException

  Description copied from class: `SimpleXmlParserImpl`
  Create DefinitionHolder given the name of the Definition class to use and the ClassObject of the object being created.

  Parameters:
    `definitionName` - The name of the definition class to use for creating the object
    `co` - The ClassObject of the object to create
    `parentDh` - The DefinitionHolder of the object which will contain the created object (may be null).
    `attribute` - The attribute of the parent object which will contain the created object (may be null).
    `parent` - The root XMLElement which represents the object to be created.
  Returns:
    A DefinitionHolder which represents the XMLObject being created.
  Throws:
    `IfsException` - Thrown if the operation fails.

### lookupDefinitionName

    protected java.lang.String lookupDefinitionName(ClassObject co)
                                             throws IfsException

  Description copied from class: `SimpleXmlParserImpl`
  Looks up the definition classname for the ClassObject. Uses the definition table in IfsSimpleXmlParser.

  Parameters:
    `co` - The ClassObject to find a definition class for
  Returns:
    The name of the definition class
  Throws:
    `IfsException` - Thrown if the operation failed

### getDefinitionInstance

    protected LibraryObjectDefinition getDefinitionInstance(java.lang.String name)
                                                     throws IfsException

  Description copied from class: `SimpleXmlParserImpl`
  Creates the instance of the passed in definition classname

  Parameters:
    `name` - The name of a LibraryObjectDefinition-derived class
  Returns:
    An instance of the definition class
  Throws:
    `IfsException` - Thrown if the operation fails

### createObject

    protected LibraryObject createObject(DefinitionHolder dh,
                                         DefinitionHolder parentDh)
                                  throws IfsException

  Description copied from class: `SimpleXmlParserImpl`
  Creates an object given a LibraryObjectDefinition. Calls both the pre and post ParserCallbacks. Checks to see if this is an update or a create.

  Parameters:
    `dh` - The definition to use (lod should not be null)
  Returns:
    A LibraryObject created based on the definition. Returns null if no object could be created
  Throws:
    `IfsException` - Thrown if the operation fails

### processChildTag

    protected void processChildTag(DefinitionHolder dh,
                                   ClassObject co,
                                   org.w3c.dom.Element currentChild)
                            throws IfsException

  Description copied from class: `SimpleXmlParserImpl`
  Process a node, using the classObject for the document and altering the current definition if neccessary.

  Searches the explicitly-defined taghandlers to see if this tag should be handled by one of them. If no taghandler is defined, assume this is an attribute tag and process as an attribute tag.

  Parameters:
    `dh` - The definition to alter
    `co` - The ClassObject for the object we are creating
    `currentChild` - The element being processed
  Throws:
    `IfsException` - thrown if the operation fails

### readValue

    protected java.lang.Object readValue(DefinitionHolder dh,
                                         org.w3c.dom.Element currentChild,
                                         AttributeDescription attribute)
                                  throws IfsException

  Description copied from class: `SimpleXmlParserImpl`
  Reads a value from a DOM element, assuming the value has the specified datatype. Converts the string data read into an object of the datatype requested. There are 3 basic cases:
  - Array datatypes are handled by processArray()
  - Scalars are handle by the appropriate readXXX()
  - LibraryObjects are handled by readLibraryObject()

  Parameters:
    `currentChild` - The node which contains the value to read
    `attribute` - The current attribute to read.
  Returns:
    The object created. Will be of the appropriate class for The datatype.
  Throws:
    `IfsException`

### ignoreUnsettable

    protected boolean ignoreUnsettable()

### signalException

    protected void signalException(IfsException e)
                            throws IfsException

  Description copied from class: `SimpleXmlParserImpl`
  Calls CallBack.signalException() if a Callback is defined. Otherwise simple throws the given exception.

  Throws:
    `IfsException`

### readLibraryObject

    protected LibraryObject readLibraryObject(DefinitionHolder dh,
                                              org.w3c.dom.Element element,
                                              AttributeDescription attribute)
                                       throws IfsException

  Description copied from class: `SimpleXmlParserImpl`
  Reads in a LibraryObject from an XMLElement. Handles both references and object creation.

  Parameters:
    `dh` - The parent object of the object to return
    `element` - The parent XMLElement of the object to return
    `attribute` - The attribute being set by the object to return
  Returns:
    The object represented by the XML
  Throws:
    `IfsException` - Thrown if the operation fails.

### createObjectWithClass

    protected LibraryObject createObjectWithClass(DefinitionHolder parentDh,
                                                  org.w3c.dom.Element element,
                                                  AttributeDescription attribute)
                                           throws IfsException

  Description copied from class: `SimpleXmlParserImpl`
  Creates an object from an XMLElement

  Parameters:
    `parentDh` - The parent object of the object to create
    `element` - The XMLElement representing the object to create
    `attribute` - The attribute being set by the created object
  Returns:
    The created object
  Throws:
    `IfsException` - Thrown if the operation fails

### handleRef

    protected LibraryObject handleRef(DefinitionHolder dh,
                                      org.w3c.dom.Element element,
                                      AttributeDescription attribute)
                               throws IfsException

  Description copied from class: `SimpleXmlParserImpl`
  Finds an object by reference. Reads the reference type from the element tag. If no type is specified and the attribute does not have a default reftype, then null is returned.

  Parameters:
    `dh` - The parent of the object being found
    `element` - The element representing the reference
    `attribute` - The attribute being set by the reference
  Returns:
    The referenced LO (or null if no reference type specified)
  Throws:
    `IfsException` - thrown if the operation failed.
  (Unpublished)

### handleRefType

    protected LibraryObject handleRefType(DefinitionHolder dh,
                                          org.w3c.dom.Element element,
                                          java.lang.String refType,
                                          AttributeDescription attribute)
                                   throws IfsException

  Description copied from class: `SimpleXmlParserImpl`
  Finds an object by reference.

  Parameters:
    `dh` - The parent of the object being found
    `element` - The element representing the reference
    `refType` - The type of reference being made
    `attribute` - The attribute being set by the reference
  Returns:
    The referenced LO.
  Throws:
    `IfsException` - thrown if the operation failed.
  (Unpublished)

### handleExistingRef

    protected LibraryObject handleExistingRef(DefinitionHolder dh,
                                              AttributeDescription attribute)
                                       throws IfsException

  Description copied from class: `SimpleXmlParserImpl`
  Reads an existing object out of an object which is being updated.

  Parameters:
    `dh` - The parent which contains the object to be found
    `attribute` - The attribute of the parent where the object is
  Returns:
    The LO which was referenced
  Throws:
    `IfsException` - Thrown if the operation failed
  (Unpublished)

### handleValueDefaultRef

    protected LibraryObject handleValueDefaultRef(org.w3c.dom.Element element,
                                                  AttributeDescription attribute)
                                           throws IfsException

  Description copied from class: `SimpleXmlParserImpl`
  Finds an object referenced by a named ValueDefault

  Parameters:
    `element` - The element which contains the reference
    `attribute` - The attribute which is being set by the reference
  Returns:
    The LO which was referenced, or null if no VD name was specified in the tag.
  Throws:
    `IfsException` - Thrown if the operation failed
  (Unpublished)

### handlePathRef

    protected PublicObject handlePathRef(org.w3c.dom.Element element,
                                         AttributeDescription attribute)
                                  throws IfsException

  Description copied from class: `SimpleXmlParserImpl`
  Finds an object by path

  Parameters:
    `element` - The element which contains the reference
    `attribute` - The attribute which is being set by the object
  Returns:
    The LO which was referenced
  Throws:
    `IfsException` - Thrown if the operation failed
  (Unpublished)

### handleSearchRef

    protected LibraryObject handleSearchRef(org.w3c.dom.Element element,
                                            AttributeDescription attribute,
                                            java.lang.String searchAttributeName)
                                     throws IfsException

  Description copied from class: `SimpleXmlParserImpl`
  Reads an existing object out of an object which is being updated.

  Parameters:
    `element` - The element which contains the reference
    `attribute` - The attribute which will be set by the returned LO
    `searchAttributeName` - The name of the attribute to search by
  Returns:
    The LO which was referenced
  Throws:
    `IfsException` - Thrown if the operation failed
  (Unpublished)

### handleIdRef

    protected LibraryObject handleIdRef(org.w3c.dom.Element element,
                                        int datatype)
                                 throws IfsException

  Description copied from class: `SimpleXmlParserImpl`
  Finds an object by Object Id

  Parameters:
    `element` - The element which contains the reference
    `datatype` - The datatype of the object to find.
  Returns:
    The LO which was referenced
  Throws:
    `IfsException` - Thrown if the operation failed
  (Unpublished)

### getFirstElementChild

    protected static org.w3c.dom.Element getFirstElementChild(org.w3c.dom.Node element)
                                                       throws IfsException

  Description copied from class: `SimpleXmlParserImpl`
  Returns the first non-comment, non-processingIntruction child of the passed in Node.

  Parameters:
    `element` - The element to find the child of
  Returns:
    The first child, or null if no suitable child exists
  Throws:
    `IfsException` - (IFS-12631) thrown if the first non-comment, non-processingIntruction child is not an Element.

### getFirstNodeChild

    protected static org.w3c.dom.Node getFirstNodeChild(org.w3c.dom.Node element)

  Description copied from class: `SimpleXmlParserImpl`
  Returns the first non-comment, non-processingIntruction, non-DTD child of the passed in Node.

  Parameters:
    `element` - The element to find the child of
  Returns:
    The first child, or null if no suitable child exists

### getNextElementSibling

    protected static org.w3c.dom.Element getNextElementSibling(org.w3c.dom.Node element)
                                                        throws IfsException

  Description copied from class: `SimpleXmlParserImpl`
  Returns the next non-comment, non-processingIntruction sibling of the passed in Node.

  Parameters:
    `element` - The element to find the next sibling of
  Returns:
    The next child, or null if no suitable child exists
  Throws:
    `IfsException` - (IFS-12631) thrown if the next non-comment, non-processingIntruction sibling is not an Element.

### getCaseInsensitiveAttribute

    protected static java.lang.String getCaseInsensitiveAttribute(org.w3c.dom.Element element,
                                                                  java.lang.String attributeName)

  Description copied from class: `SimpleXmlParserImpl`
  Returns the attribute on the element with the given name. The name is case-insensitive.

  Parameters:
    `element` - The element with the attributes
    `attributeName` - The name of the attribute to find
  Returns:
    The value of the attribute, or null if the attribute could not be found

### checkAction

    protected static boolean checkAction(org.w3c.dom.Element element)
                                  throws IfsException

  Description copied from class: `SimpleXmlParserImpl`
  Checks to see if the element represents an Add or Remove action.

  Parameters:
    `element` - The element to check
  Returns:
    True if the element represents an Add or if there is no action attribute specified on the XML element.False otherwise.
  Throws:
    `IfsException` - Thrown if the operation fails
  (Unpublished)

### ensureLegalPublicObjectDefinition

    protected void ensureLegalPublicObjectDefinition(PublicObjectDefinition pod,
                                                     LibrarySession session,
                                                     PublicObject objectForUpdate)
                                              throws IfsException

  Description copied from class: `SimpleXmlParserImpl`
  Ensure that the specified PublicObjectDefinition is legal, and fix if possible. This can be used for both insert and update, which is indicated through an explicit parameter. This method attempts to make the specified definition legal, but will throw if that is not possible.

  Parameters:
    `pod` - the PublicObjectDefinition to validate
    `session` - session that will use the definition
    `objectForUpdate` - the Object that will be updated by this definition; null if the definition will be used to create a new object.
  Throws:
    `IfsException` - if the definition is not legal and cannot be fixed.
  (Unpublished)

### getDatatypeFromName

    protected static int getDatatypeFromName(java.lang.String type)
                                      throws IfsException

  Description copied from class: `SimpleXmlParserImpl`
  Returns the integer datatype number (defined in Attribute.java) for the given String datatype descriptor.

  Parameters:
    `type` - The String name of the datatype (Case-insensitive)
  Returns:
    The integer datatype number, or -1 if input type was empty or null
  Throws:
    `IfsException` - (IFS-12635) Thrown if the type string could not be matched.

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