1 /*
2 (C) Copyright IBM Corp. 2006, 2009
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 * 1663270 2007-02-19 ebak Minor performance problems
17 * 1660756 2007-02-22 ebak Embedded object support
18 * 1720707 2007-05-17 ebak Conventional Node factory for CIM-XML SAX parser
19 * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
20 * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
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.CIMObjectPath;
46 import org.metricshub.wbem.sblim.cimclient.internal.cimxml.LocalPathBuilder;
47 import org.metricshub.wbem.sblim.cimclient.internal.cimxml.sax.SAXSession;
48 import org.xml.sax.Attributes;
49 import org.xml.sax.SAXException;
50
51 /**
52 * <pre>
53 * ELEMENT CLASSNAME EMPTY
54 * ATTLIST CLASSNAME
55 * %CIMName;
56 * </pre>
57 */
58 public class ClassNameNode extends AbstractPathNode {
59 private String iClassName;
60
61 private CIMObjectPath iLocalPath;
62
63 /**
64 * Ctor.
65 */
66 public ClassNameNode() {
67 super(CLASSNAME);
68 }
69
70 @Override
71 public void init(Attributes pAttribs, SAXSession pSession) throws SAXException {
72 this.iLocalPath = pSession.getDefLocalPath();
73 this.iClassName = getCIMName(pAttribs);
74 }
75
76 /**
77 * @param pData
78 */
79 @Override
80 public void parseData(String pData) {
81 // no data
82 }
83
84 /**
85 * @param pNodeNameEnum
86 */
87 @Override
88 public void testChild(String pNodeNameEnum) throws SAXException {
89 throw new SAXException("CLASSNAME node cannot have any child node!");
90 }
91
92 @Override
93 public void testCompletness() {
94 // no child nodes to test
95 }
96
97 /**
98 * @param pChild
99 */
100 @Override
101 public void childParsed(Node pChild) {
102 // nothing to do
103 }
104
105 /**
106 * getClassName
107 *
108 * @return String
109 */
110 public String getClassName() {
111 return this.iClassName;
112 }
113
114 public CIMObjectPath getCIMObjectPath() {
115 return LocalPathBuilder.build(this.iLocalPath, this.iClassName, null);
116 }
117 }