1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 package org.metricshub.wbem.sblim.cimclient.internal.cimxml.sax.node;
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48 import org.metricshub.wbem.javax.cim.CIMArgument;
49 import org.metricshub.wbem.sblim.cimclient.internal.cimxml.sax.SAXSession;
50 import org.metricshub.wbem.sblim.cimclient.internal.wbem.CIMError;
51 import org.xml.sax.Attributes;
52 import org.xml.sax.SAXException;
53
54
55
56
57
58
59
60 public class SimpleExpRspNode extends AbstractSimpleRspNode {
61 private ExpMethodResponseNode iExpMethodRspNode;
62
63
64
65
66 public SimpleExpRspNode() {
67 super(SIMPLEEXPRSP);
68 }
69
70 public void addChild(Node pChild) {
71 this.iExpMethodRspNode = (ExpMethodResponseNode) pChild;
72 }
73
74
75
76
77
78 @Override
79 public void init(Attributes pAttribs, SAXSession pSession) {
80 this.iExpMethodRspNode = null;
81
82 }
83
84
85
86
87 @Override
88 public void parseData(String pData) {
89
90 }
91
92 @Override
93 public void testChild(String pNodeNameEnum) throws SAXException {
94 if (this.iExpMethodRspNode != null) throw new SAXException(getNodeName() + " node can have only one child node!");
95 if (pNodeNameEnum != EXPMETHODRESPONSE) throw new SAXException(
96 getNodeName() + " node's child node can be EXPMETHODRESPONSE only! " + pNodeNameEnum + " is invalid!"
97 );
98 }
99
100 @Override
101 public void testCompletness() throws SAXException {
102 if (this.iExpMethodRspNode == null) throw new SAXException(
103 getNodeName() + " node must have an EXPMETHODRESPONSE child node!"
104 );
105 }
106
107 @Override
108 public CIMError getCIMError() {
109
110 if (this.iExpMethodRspNode == null) return null;
111 return this.iExpMethodRspNode.getCIMError();
112 }
113
114 @Override
115 public CIMArgument<?>[] getCIMArguments() {
116
117 return null;
118 }
119
120 public int getReturnValueCount() {
121 return this.iExpMethodRspNode == null ? 0 : this.iExpMethodRspNode.getReturnValueCount();
122 }
123
124 public Object readReturnValue() {
125 return this.iExpMethodRspNode == null ? null : this.iExpMethodRspNode.readReturnValue();
126 }
127 }