Class Node
java.lang.Object
org.sblim.cimclient.internal.cimxml.sax.node.Node
- All Implemented Interfaces:
NodeConstIf
- Direct Known Subclasses:
AbstractMessageNode, AbstractMethodCallNode, AbstractObjectNode, AbstractParameterNode, AbstractParamValueNode, AbstractPathNode, AbstractPropertyNode, AbstractValueNode, CIMNode, CorrelatorNode, ErrorNode, ExpMethodCallNode, ExpMethodResponseNode, ExpParamValueNode, HostNode, IMethodResponseNode, IReturnValueNode, KeyBindingNode, MessageNode, MethodNode, MethodResponseNode, NameSpaceNode, NameSpacePathNode, QualiDeclNode, QualifierNode, ReturnValueNode, ScopeNode
Class Node is the abstract base class of all parseable XML elements. It
contains helper functions for the implementations.
-
Field Summary
Fields inherited from interface NodeConstIf
CIM, CLASS, CLASSNAME, CLASSPATH, CORRELATOR, DECLARATION, DECLGROUP, DECLGROUP_WITHNAME, DECLGROUP_WITHPATH, ERROR, EXPMETHODCALL, EXPMETHODRESPONSE, EXPPARAMVALUE, HOST, IMETHODCALL, IMETHODRESPONSE, INSTANCE, INSTANCENAME, INSTANCEPATH, IPARAMVALUE, IRETURNVALUE, KEYBINDING, KEYVALUE, LOCALCLASSPATH, LOCALINSTANCEPATH, LOCALNAMESPACEPATH, MESSAGE, METHOD, METHODCALL, METHODRESPONSE, MULTIEXPREQ, MULTIEXPRSP, MULTIREQ, MULTIRSP, NAMESPACE, NAMESPACEPATH, OBJECTPATH, PARAMETER, PARAMETER_ARRAY, PARAMETER_REFARRAY, PARAMETER_REFERENCE, PARAMVALUE, PROPERTY, PROPERTY_ARRAY, PROPERTY_REFERENCE, QUALIFIER, QUALIFIER_DECLARATION, RETURNVALUE, SCOPE, SIMPLEEXPREQ, SIMPLEEXPRSP, SIMPLEREQ, SIMPLERSP, VALUE, VALUE_ARRAY, VALUE_INSTANCEWITHPATH, VALUE_NAMEDINSTANCE, VALUE_NAMEDOBJECT, VALUE_NULL, VALUE_OBJECT, VALUE_OBJECTWITHLOCALPATH, VALUE_OBJECTWITHPATH, VALUE_REFARRAY, VALUE_REFERENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidchildParsed(Node pChild) Have to be called by SAX's DefaultHandler.endElement()voidWhen a Node instance is going to be reused, this function must be called before.voidduplicatedNode(String pParsedNodeName, String pNewNodeName) duplicatedNodestatic intgetArraySize(Attributes pAttribs) ENTITY % ArraySize "ARRAYSIZE CDATA #IMPLIED"static booleangetBoolAttribute(Attributes pAttribs, String pName, boolean pDefVal) getBoolAttributestatic StringgetCIMName(Attributes pAttribs) ENTITY % CIMName "NAME CDATA #REQUIRED"static CIMDataTypegetCIMType(Attributes pAttribs) getCIMType(pAttribs, pOptional=false);static CIMDataTypegetCIMType(Attributes pAttribs, boolean pOptional) ENTITY % CIMType "TYPE (boolean|string|char16|uint8|sint8|uint16|sint16|uint32 |sint32|uint64|sint64|datetime|real32|real64)" getCIMTypestatic StringgetClassName(Attributes pAttribs) ENTITY % ClassName "CLASSNAME CDATA #REQUIRED"static StringgetClassOrigin(Attributes pAttribs) ENTITY % ClassOrigin "CLASSORIGIN CDATA #IMPLIEDgetNodeNamestatic CIMDataTypegetParamType(Attributes pAttribs) ENTITY % ParamType "PARAMTYPE ( boolean|string|char16|uint8|sint8|uint16|sint16 |uint32|sint32|uint64|sint64|datetime| real32|real64|reference)static booleangetPropagated(Attributes pAttribs) ENTITY % Propagated "PROPAGATED (true|false) 'false'" getPropagatedintgetQualifierFlavor(Attributes pAttribs) ENTITY % QualifierFlavor " OVERRIDABLE (true|false) 'true' TOSUBCLASS (true|false) 'true' TOINSTANCE (true|false) 'false' TRANSLATABLE (true|false) 'false'"static StringgetReferenceClass(Attributes pAttribs) ENTITY % ReferenceClass "REFERENCECLASS CDATA #IMPLIED"static booleanhasTrueAttribute(Attributes pAttribs, String pName) hasTrueAttributevoidillegalChildNodePair(String pNodeName0, String pNodeName1) illegalChildNodePairabstract voidinit(Attributes pAttribs, SAXSession pSession) The SAX ContentHandler implementation calls this method after testChild() and addChild() calls.booleancompletedabstract voidXML element's data have to be passedvoidHave to be called by SAX's DefaultHandler at endElement(), after calling testCompletness().abstract voidIt have to be called by SAX's DefaultHandler implementation when it detects a new child element (startElement()).abstract voidIt have to be called by SAX's DefaultHandler.endElement().
-
Constructor Details
-
Node
Ctor.- Parameters:
pNameEnum- The name of the node which must be a String constant which is defined inside this class (because the implementation compares by reference).
-
-
Method Details
-
getNodeName
getNodeName- Returns:
- The name of the node. This name have to be one of the String constant defined in the class.
-
init
The SAX ContentHandler implementation calls this method after testChild() and addChild() calls. The implementation must reset it's instance unless it implements NonVolatileIf- Parameters:
pAttribs-pSession- - stores variables which are common for the whole SAX parsing session- Throws:
SAXException
-
parseData
XML element's data have to be passed- Parameters:
pData- - String which is concatenated in SAX's DefaultHandler.characters() implementation.- Throws:
SAXException
-
testChild
It have to be called by SAX's DefaultHandler implementation when it detects a new child element (startElement()).- Parameters:
pNodeNameEnum- - the name of the child element, it must be one of the String constant defined in class Node, because the implementer subclasses uses reference based equals comparisons (==)- Throws:
SAXException- - It have to be thrown when the Node cannot have pNodeNameEnum named child Node.
-
testCompletness
It have to be called by SAX's DefaultHandler.endElement(). It's task is to check that the Element is built up correctly. The implementer function can do some post processing here. testCompletness- Throws:
SAXException- It must be thrown when the Node is not valid.
-
childParsed
Have to be called by SAX's DefaultHandler.endElement()- Parameters:
pChild-- Throws:
SAXException- - parent Nodes can make conversions here (e.g. type string into CIMDataType), failed operation should throw SAXException)
-
isCompleted
public boolean isCompleted()completed- Returns:
- true if the parsing of the node is completed
-
setCompleted
public void setCompleted()Have to be called by SAX's DefaultHandler at endElement(), after calling testCompletness(). -
clearCompleted
public void clearCompleted()When a Node instance is going to be reused, this function must be called before. -
getCIMName
ENTITY % CIMName "NAME CDATA #REQUIRED"- Parameters:
pAttribs-- Returns:
- String
- Throws:
SAXException
-
getClassName
ENTITY % ClassName "CLASSNAME CDATA #REQUIRED"- Parameters:
pAttribs-- Returns:
- String
- Throws:
SAXException
-
getReferenceClass
ENTITY % ReferenceClass "REFERENCECLASS CDATA #IMPLIED"- Parameters:
pAttribs-- Returns:
- String
-
getClassOrigin
ENTITY % ClassOrigin "CLASSORIGIN CDATA #IMPLIED- Parameters:
pAttribs-- Returns:
- String
-
getPropagated
ENTITY % Propagated "PROPAGATED (true|false) 'false'" getPropagated- Parameters:
pAttribs-- Returns:
- boolean
-
getArraySize
ENTITY % ArraySize "ARRAYSIZE CDATA #IMPLIED"- Parameters:
pAttribs-- Returns:
- int
- Throws:
SAXException
-
getCIMType
ENTITY % CIMType "TYPE (boolean|string|char16|uint8|sint8|uint16|sint16|uint32 |sint32|uint64|sint64|datetime|real32|real64)" getCIMType- Parameters:
pAttribs-pOptional-- Returns:
- CIMDataType
- Throws:
SAXException
-
getCIMType
getCIMType(pAttribs, pOptional=false);- Parameters:
pAttribs-- Returns:
- CIMDataType
- Throws:
SAXException
-
getParamType
ENTITY % ParamType "PARAMTYPE ( boolean|string|char16|uint8|sint8|uint16|sint16 |uint32|sint32|uint64|sint64|datetime| real32|real64|reference)- Parameters:
pAttribs-- Returns:
- CIMDataType
- Throws:
SAXException
-
getQualifierFlavor
ENTITY % QualifierFlavor " OVERRIDABLE (true|false) 'true' TOSUBCLASS (true|false) 'true' TOINSTANCE (true|false) 'false' TRANSLATABLE (true|false) 'false'"
- Parameters:
pAttribs-- Returns:
- int - CIMFlavor bit mixture
-
hasTrueAttribute
hasTrueAttribute- Parameters:
pAttribs-pName-- Returns:
- boolean
-
getBoolAttribute
getBoolAttribute- Parameters:
pAttribs-pName-pDefVal-- Returns:
- boolean
-
duplicatedNode
duplicatedNode- Parameters:
pParsedNodeName-pNewNodeName-- Throws:
SAXException
-
illegalChildNodePair
illegalChildNodePair- Parameters:
pNodeName0-pNodeName1-- Throws:
SAXException
-