1 /*
2 (C) Copyright IBM Corp. 2006, 2013
3
4 THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
5 ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
6 CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
7
8 You can obtain a current copy of the Eclipse Public License from
9 http://www.opensource.org/licenses/eclipse-1.0.php
10
11 @author : Endre Bak, ebak@de.ibm.com
12 *
13 * Flag Date Prog Description
14 * -------------------------------------------------------------------------------
15 * 1565892 2006-12-04 ebak Make SBLIM client JSR48 compliant
16 * 1720707 2007-05-17 ebak Conventional Node factory for CIM-XML SAX parser
17 * 1820763 2007-10-29 ebak Supporting the EmbeddedInstance qualifier
18 * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
19 * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
20 * 2704 2013-11-11 blaschke-oss PARAMETER does not require TYPE attribute
21 */
22
23 package org.metricshub.wbem.sblim.cimclient.internal.cimxml.sax.node;
24
25 /*-
26 * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
27 * WBEM Java Client
28 * ჻჻჻჻჻჻
29 * Copyright 2023 - 2025 MetricsHub
30 * ჻჻჻჻჻჻
31 * Licensed under the Apache License, Version 2.0 (the "License");
32 * you may not use this file except in compliance with the License.
33 * You may obtain a copy of the License at
34 *
35 * http://www.apache.org/licenses/LICENSE-2.0
36 *
37 * Unless required by applicable law or agreed to in writing, software
38 * distributed under the License is distributed on an "AS IS" BASIS,
39 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
40 * See the License for the specific language governing permissions and
41 * limitations under the License.
42 * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
43 */
44
45 import org.metricshub.wbem.javax.cim.CIMDataType;
46 import org.metricshub.wbem.sblim.cimclient.internal.cimxml.sax.EmbObjHandler;
47 import org.xml.sax.Attributes;
48 import org.xml.sax.SAXException;
49
50 /**
51 * ELEMENT PARAMETER (QUALIFIER*) ATTLIST PARAMETER %CIMName; %CIMType;
52 */
53 public class ParameterNode extends AbstractParameterNode {
54 private CIMDataType iType;
55
56 private EmbObjHandler iEmbObjHandler;
57
58 /**
59 * Ctor.
60 */
61 public ParameterNode() {
62 super(PARAMETER);
63 }
64
65 @Override
66 protected void specificInit(Attributes pAttribs) throws SAXException {
67 if (getCIMType(pAttribs, true) == null) throw new SAXException("PARAMETER element missing TYPE attribute!");
68 this.iEmbObjHandler =
69 EmbObjHandler.init(this.iEmbObjHandler, getNodeName(), pAttribs, this.iSession, this.iQualiHandler, true);
70 }
71
72 @Override
73 public void testCompletness() throws SAXException {
74 this.iType = this.iEmbObjHandler.getType();
75 if (this.iType.isArray()) throw new SAXException("PARAMETER node's TYPE attribute cannot be an array!");
76 }
77
78 public CIMDataType getType() {
79 return this.iType;
80 }
81 }