public class SimpleXmlParserImpl extends Object
Modifier and Type | Field and Description |
---|---|
protected Hashtable |
m_Options |
protected LibrarySession |
m_Session |
Modifier and Type | Method and Description |
---|---|
protected static boolean |
checkAction(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(Element parent,
DefinitionHolder parentDh,
AttributeDescription attribute)
Creates a libraryObject based on an DOM element.
|
protected LibraryObject |
createObjectWithClass(DefinitionHolder parentDh,
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 String |
getCaseInsensitiveAttribute(Element element,
String attributeName)
Returns the attribute on the element with the given name.
|
protected static int |
getDatatypeFromName(String type)
Returns the integer datatype number (defined in Attribute.java) for
the given String datatype descriptor.
|
protected LibraryObjectDefinition |
getDefinitionInstance(String name)
Creates the instance of the passed in definition classname
|
protected static Element |
getFirstElementChild(Node element)
Returns the first non-comment, non-processingIntruction child of the
passed in Node.
|
protected static Node |
getFirstNodeChild(Node element)
Returns the first non-comment, non-processingIntruction, non-DTD
child of the passed in Node.
|
protected static Element |
getNextElementSibling(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 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(Element element,
int datatype)
Finds an object by Object Id
|
protected PublicObject |
handlePathRef(Element element,
AttributeDescription attribute)
Finds an object by path
|
protected LibraryObject |
handleRef(DefinitionHolder dh,
Element element,
AttributeDescription attribute)
Finds an object by reference.
|
protected LibraryObject |
handleRefType(DefinitionHolder dh,
Element element,
String refType,
AttributeDescription attribute)
Finds an object by reference.
|
protected LibraryObject |
handleSearchRef(Element element,
AttributeDescription attribute,
String searchAttributeName)
Reads an existing object out of an object which is being updated.
|
protected LibraryObject |
handleValueDefaultRef(Element element,
AttributeDescription attribute)
Finds an object referenced by a named ValueDefault
|
protected boolean |
ignoreUnsettable() |
protected String |
lookupDefinitionName(ClassObject co)
Looks up the definition classname for the ClassObject.
|
protected void |
processChildTag(DefinitionHolder dh,
ClassObject co,
Element currentChild)
Process a node, using the classObject for the document and altering
the current definition if neccessary.
|
protected DefinitionHolder |
processDefinition(String definitionName,
ClassObject co,
DefinitionHolder parentDh,
AttributeDescription attribute,
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,
Element element,
AttributeDescription attribute)
Reads in a LibraryObject from an XMLElement.
|
protected Object |
readValue(DefinitionHolder dh,
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.
|
protected LibrarySession m_Session
protected Hashtable m_Options
public final int getObjectsCreatedCount()
protected final Hashtable getOptions()
protected final LibraryObject createObject(Element parent, DefinitionHolder parentDh, AttributeDescription attribute) throws IfsException
parent
- The node to create LibraryObject based onparentDh
- 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.IfsException
- thrown if the operation failsprotected DefinitionHolder processDefinition(String definitionName, ClassObject co, DefinitionHolder parentDh, AttributeDescription attribute, Element parent) throws IfsException
definitionName
- The name of the definition class to use for
creating the objectco
- The ClassObject of the object to createparentDh
- 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.IfsException
- Thrown if the operation fails.protected String lookupDefinitionName(ClassObject co) throws IfsException
co
- The ClassObject to find a definition class forIfsException
- Thrown if the operation failedprotected LibraryObjectDefinition getDefinitionInstance(String name) throws IfsException
name
- The name of a LibraryObjectDefinition-derived classIfsException
- Thrown if the operation failsprotected LibraryObject createObject(DefinitionHolder dh, DefinitionHolder parentDh) throws IfsException
dh
- The definition to use (lod should not be null)IfsException
- Thrown if the operation failsprotected void processChildTag(DefinitionHolder dh, ClassObject co, Element currentChild) throws IfsException
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.
dh
- The definition to alterco
- The ClassObject for the object we are creatingcurrentChild
- The element being processedIfsException
- thrown if the operation failsprotected Object readValue(DefinitionHolder dh, Element currentChild, AttributeDescription attribute) throws IfsException
currentChild
- The node which contains the value to readattribute
- The current attribute to read.IfsException
protected boolean ignoreUnsettable()
protected void signalException(IfsException e) throws IfsException
IfsException
protected LibraryObject readLibraryObject(DefinitionHolder dh, Element element, AttributeDescription attribute) throws IfsException
dh
- The parent object of the object to returnelement
- The parent XMLElement of the object to returnattribute
- The attribute being set by the object to returnIfsException
- Thrown if the operation fails.protected LibraryObject createObjectWithClass(DefinitionHolder parentDh, Element element, AttributeDescription attribute) throws IfsException
parentDh
- The parent object of the object to createelement
- The XMLElement representing the object to createattribute
- The attribute being set by the created objectIfsException
- Thrown if the operation failsprotected LibraryObject handleRef(DefinitionHolder dh, Element element, AttributeDescription attribute) throws IfsException
dh
- The parent of the object being foundelement
- The element representing the referenceattribute
- The attribute being set by the referenceIfsException
- thrown if the operation failed.protected LibraryObject handleRefType(DefinitionHolder dh, Element element, String refType, AttributeDescription attribute) throws IfsException
dh
- The parent of the object being foundelement
- The element representing the referencerefType
- The type of reference being madeattribute
- The attribute being set by the referenceIfsException
- thrown if the operation failed.protected LibraryObject handleExistingRef(DefinitionHolder dh, AttributeDescription attribute) throws IfsException
dh
- The parent which contains the object to be foundattribute
- The attribute of the parent where the object isIfsException
- Thrown if the operation failedprotected LibraryObject handleValueDefaultRef(Element element, AttributeDescription attribute) throws IfsException
element
- The element which contains the referenceattribute
- The attribute which is being set by the referenceIfsException
- Thrown if the operation failedprotected PublicObject handlePathRef(Element element, AttributeDescription attribute) throws IfsException
element
- The element which contains the referenceattribute
- The attribute which is being set by the objectIfsException
- Thrown if the operation failedprotected LibraryObject handleSearchRef(Element element, AttributeDescription attribute, String searchAttributeName) throws IfsException
element
- The element which contains the referenceattribute
- The attribute which will be set by the returned LOsearchAttributeName
- The name of the attribute to search byIfsException
- Thrown if the operation failedprotected LibraryObject handleIdRef(Element element, int datatype) throws IfsException
element
- The element which contains the referencedatatype
- The datatype of the object to find.IfsException
- Thrown if the operation failedprotected static Element getFirstElementChild(Node element) throws IfsException
element
- The element to find the child ofIfsException
- (IFS-12631) thrown if the first non-comment,
non-processingIntruction child is not an Element.protected static Node getFirstNodeChild(Node element)
element
- The element to find the child ofprotected static Element getNextElementSibling(Node element) throws IfsException
element
- The element to find the next sibling ofIfsException
- (IFS-12631) thrown if the next non-comment,
non-processingIntruction sibling is not an Element.protected static String getCaseInsensitiveAttribute(Element element, String attributeName)
element
- The element with the attributesattributeName
- The name of the attribute to findprotected static boolean checkAction(Element element) throws IfsException
element
- The element to checkIfsException
- Thrown if the operation failsprotected void ensureLegalPublicObjectDefinition(PublicObjectDefinition pod, LibrarySession session, PublicObject objectForUpdate) throws IfsException
pod
- the PublicObjectDefinition to validatesession
- session that will use the definitionobjectForUpdate
- the Object that will be updated by this
definition; null if the definition will be
used to create a new object.IfsException
- if the definition is not legal and cannot be
fixed.protected static int getDatatypeFromName(String type) throws IfsException
type
- The String name of the datatype (Case-insensitive)IfsException
- (IFS-12635) Thrown if the type string could not be
matched.Copyright © 2023. All rights reserved.