Update of /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/cimxml/sax/node
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25992/src/org/sblim/cimclient/internal/cimxml/sax/node
Modified Files:
Tag: Experimental
ValueArrayNode.java ValueRefArrayNode.java
Log Message:
2715 Add VALUE.NULL support
Index: ValueArrayNode.java
===================================================================
RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/cimxml/sax/node/ValueArrayNode.java,v
retrieving revision 1.1.2.11
retrieving revision 1.1.2.12
diff -u -d -r1.1.2.11 -r1.1.2.12
--- ValueArrayNode.java 31 Mar 2012 00:02:16 -0000 1.1.2.11
+++ ValueArrayNode.java 26 Nov 2013 16:39:20 -0000 1.1.2.12
@@ -1,5 +1,5 @@
/**
- * (C) Copyright IBM Corp. 2006, 2012
+ * (C) Copyright IBM Corp. 2006, 2013
*
* THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
* ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
@@ -22,6 +22,7 @@
* 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
* 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
* 3513353 2012-03-30 blaschke-oss TCK: CIMDataType arrays must have length >= 1
+ * 2715 2013-11-26 blaschke-oss Add VALUE.NULL support
*/
package org.sblim.cimclient.internal.cimxml.sax.node;
@@ -37,7 +38,7 @@
import org.xml.sax.SAXException;
/**
- * ELEMENT VALUE.ARRAY (VALUE*)<br>
+ * ELEMENT VALUE.ARRAY (VALUE|VALUE.NULL)*<br>
* For non-standard CIMOMs the TYPE and PARAMTYPE attributes are handled.
*/
public class ValueArrayNode extends AbstractArrayValueNode {
@@ -81,16 +82,16 @@
@Override
public void testChild(String pNodeNameEnum) throws SAXException {
- if (pNodeNameEnum != VALUE) throw new SAXException(
- "Only VALUE nodes can be added to VALUE.ARRAY nodes but " + pNodeNameEnum
- + " found!");
-
+ if (pNodeNameEnum != VALUE && pNodeNameEnum != VALUE_NULL) throw new SAXException(
+ "Only VALUE and VALUE.NULL nodes can be added to VALUE.ARRAY nodes but "
+ + pNodeNameEnum + " found!");
}
@Override
public void childParsed(Node pChild) {
if (this.iValueAL == null) this.iValueAL = new ArrayList<Object>();
- this.iValueAL.add(((ValueNode) pChild).getValue());
+ if (pChild instanceof ValueNode) this.iValueAL.add(((ValueNode) pChild).getValue());
+ else if (pChild instanceof ValueNullNode) this.iValueAL.add(null);
}
@Override
Index: ValueRefArrayNode.java
===================================================================
RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/cimxml/sax/node/ValueRefArrayNode.java,v
retrieving revision 1.1.2.13
retrieving revision 1.1.2.14
diff -u -d -r1.1.2.13 -r1.1.2.14
--- ValueRefArrayNode.java 2 Jul 2013 01:55:25 -0000 1.1.2.13
+++ ValueRefArrayNode.java 26 Nov 2013 16:39:20 -0000 1.1.2.14
@@ -24,6 +24,7 @@
* 3513349 2012-03-31 blaschke-oss TCK: CIMDataType must not accept null string
* 3602604 2013-01-29 blaschke-oss Clean up SAXException messages
* 2604 2013-07-01 blaschke-oss SAXException messages should contain node name
+ * 2715 2013-11-26 blaschke-oss Add VALUE.NULL support
*/
package org.sblim.cimclient.internal.cimxml.sax.node;
@@ -39,7 +40,7 @@
import org.xml.sax.SAXException;
/**
- * ELEMENT VALUE.REFARRAY (VALUE.REFERENCE*)
+ * ELEMENT VALUE.REFARRAY (VALUE.REFERENCE|VALUE.NULL)*
*/
public class ValueRefArrayNode extends AbstractArrayValueNode {
@@ -72,14 +73,18 @@
@Override
public void testChild(String pNodeNameEnum) throws SAXException {
- if (pNodeNameEnum != VALUE_REFERENCE) throw new SAXException(getNodeName()
- + " node child node can be VALUE_REFERENCE only while it is " + pNodeNameEnum + "!");
+ if (pNodeNameEnum != VALUE_REFERENCE && pNodeNameEnum != VALUE_NULL) throw new SAXException(
+ getNodeName()
+ + " node child node can be VALUE.REFERENCE or VALUE.NULL only while it is "
+ + pNodeNameEnum + "!");
}
@Override
public void childParsed(Node pChild) {
if (this.iCIMObjPathAL == null) this.iCIMObjPathAL = new ArrayList<CIMObjectPath>();
- this.iCIMObjPathAL.add(((ValueReferenceNode) pChild).getCIMObjectPath());
+ if (pChild instanceof ValueReferenceNode) this.iCIMObjPathAL
+ .add(((ValueReferenceNode) pChild).getCIMObjectPath());
+ else if (pChild instanceof ValueNullNode) this.iCIMObjPathAL.add(null);
}
@Override
@@ -100,7 +105,7 @@
}
public CIMDataType getType() {
- return new CIMDataType("");
+ return new CIMDataType("", 0);
}
private static final CIMObjectPath[] EMPTY_OPA = new CIMObjectPath[0];
|