View Javadoc
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   * 1663270    2007-02-19  ebak         Minor performance problems
17   * 1660756    2007-02-22  ebak         Embedded object support
18   * 1689085    2007-04-10  ebak         Embedded object enhancements for Pegasus
19   * 1735693    2007-06-12  ebak         Empty VALUE.ARRAY elements are parsed as nulls
20   * 2003590    2008-06-30  blaschke-oss Change licensing from CPL to EPL
21   * 2524131    2009-01-21  raman_arora  Upgrade client to JDK 1.5 (Phase 1)
22   * 2531371    2009-02-10  raman_arora  Upgrade client to JDK 1.5 (Phase 2)
23   * 2763216    2009-04-14  blaschke-oss Code cleanup: visible spelling/grammar errors
24   * 2823494    2009-08-03  rgummada     Change Boolean constructor to static
25   * 3023340    2010-07-02  blaschke-oss CIMObjectFactory uses # constructor instead of valueOf
26   * 3027615    2010-07-12  blaschke-oss Use CLASS_ARRAY_T instead of new CIMDataType(CLASS,0)
27   * 3513349    2012-03-31  blaschke-oss TCK: CIMDataType must not accept null string
28   * 3572993    2012-10-01  blaschke-oss parseDouble("2.2250738585072012e-308") DoS vulnerability
29   *    2693    2013-10-21  blaschke-oss ReturnValueNode allows invalid PARAMTYPE attribute
30   */
31  
32  package org.metricshub.wbem.sblim.cimclient.internal.cimxml.sax;
33  
34  /*-
35   * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
36   * WBEM Java Client
37   * ჻჻჻჻჻჻
38   * Copyright 2023 - 2025 MetricsHub
39   * ჻჻჻჻჻჻
40   * Licensed under the Apache License, Version 2.0 (the "License");
41   * you may not use this file except in compliance with the License.
42   * You may obtain a copy of the License at
43   *
44   *      http://www.apache.org/licenses/LICENSE-2.0
45   *
46   * Unless required by applicable law or agreed to in writing, software
47   * distributed under the License is distributed on an "AS IS" BASIS,
48   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
49   * See the License for the specific language governing permissions and
50   * limitations under the License.
51   * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
52   */
53  
54  import java.io.ByteArrayInputStream;
55  import java.util.ArrayList;
56  import java.util.HashMap;
57  import javax.xml.parsers.SAXParser;
58  import javax.xml.parsers.SAXParserFactory;
59  import org.metricshub.wbem.javax.cim.CIMClass;
60  import org.metricshub.wbem.javax.cim.CIMDataType;
61  import org.metricshub.wbem.javax.cim.CIMDateTime;
62  import org.metricshub.wbem.javax.cim.CIMDateTimeAbsolute;
63  import org.metricshub.wbem.javax.cim.CIMDateTimeInterval;
64  import org.metricshub.wbem.javax.cim.CIMInstance;
65  import org.metricshub.wbem.javax.cim.CIMObjectPath;
66  import org.metricshub.wbem.javax.cim.UnsignedInteger16;
67  import org.metricshub.wbem.javax.cim.UnsignedInteger32;
68  import org.metricshub.wbem.javax.cim.UnsignedInteger64;
69  import org.metricshub.wbem.javax.cim.UnsignedInteger8;
70  import org.metricshub.wbem.sblim.cimclient.internal.cimxml.sax.node.ClassNode;
71  import org.metricshub.wbem.sblim.cimclient.internal.cimxml.sax.node.InstanceNode;
72  import org.metricshub.wbem.sblim.cimclient.internal.cimxml.sax.node.Node;
73  import org.metricshub.wbem.sblim.cimclient.internal.cimxml.sax.node.ValueArrayNode;
74  import org.metricshub.wbem.sblim.cimclient.internal.cimxml.sax.node.ValueNode;
75  import org.metricshub.wbem.sblim.cimclient.internal.util.MOF;
76  import org.metricshub.wbem.sblim.cimclient.internal.util.Util;
77  import org.metricshub.wbem.sblim.cimclient.internal.util.WBEMConfiguration;
78  import org.xml.sax.SAXException;
79  
80  /**
81   * Class CIMObjectFactory is responsible for type String and value String
82   * parsing.
83   */
84  public class CIMObjectFactory {
85  
86  	/**
87  	 * getEmbbeddedObjectA
88  	 *
89  	 * @param pType
90  	 * @param pValueArrayNode
91  	 * @param pSession
92  	 * @return CIMInstance[], CIMClass[], String[] or null
93  	 * @throws SAXException
94  	 */
95  	public static Object[] getEmbeddedObjA(CIMDataType pType, ValueArrayNode pValueArrayNode, SAXSession pSession)
96  		throws SAXException {
97  		if (pValueArrayNode == null) return null;
98  		return getEmbeddedObjA(pType, (String[]) pValueArrayNode.getValue(), pSession);
99  	}
100 
101 	/**
102 	 * getEmbeddedObjectA
103 	 *
104 	 * @param pType
105 	 * @param pValueStrA
106 	 * @param pSession
107 	 * @return CIMInstance[], CIMClass[], String[] or null
108 	 * @throws SAXException
109 	 */
110 	public static Object[] getEmbeddedObjA(CIMDataType pType, String[] pValueStrA, SAXSession pSession)
111 		throws SAXException {
112 		embeddedObjTypeCheck(pType);
113 		if (pValueStrA == null || pValueStrA.length == 0) return null;
114 		CIMDataType type = null;
115 		ArrayList<Object> objAL = new ArrayList<Object>(pValueStrA.length);
116 		for (int i = 0; i < pValueStrA.length; i++) {
117 			Object obj = parseEmbeddedObj(pValueStrA[i], pSession);
118 			if (type == null) {
119 				type = getCIMObjScalarType(obj, false);
120 			} else {
121 				CIMDataType type2 = getCIMObjScalarType(obj, false);
122 				if (type2 != null && type != type2) throw new SAXException(
123 					"Embedded Object array contains both Instance and Class objects. " + "This is not handled!"
124 				);
125 			}
126 			objAL.add(obj);
127 		}
128 		if (type == CIMDataType.OBJECT_T) {
129 			return objAL.toArray(EMPTY_INST_A);
130 		} else if (type == CIMDataType.CLASS_T) {
131 			return objAL.toArray(EMPTY_CLASS_A);
132 		}
133 		return objAL.toArray(EMPTY_STR_A);
134 	}
135 
136 	/**
137 	 * getEmbeddedObject
138 	 *
139 	 * @param pType
140 	 * @param pValueStr
141 	 * @param pSession
142 	 * @return CIMInstance, CIMClass or null
143 	 * @throws SAXException
144 	 */
145 	public static Object getEmbeddedObj(CIMDataType pType, String pValueStr, SAXSession pSession) throws SAXException {
146 		embeddedObjTypeCheck(pType);
147 		return parseEmbeddedObj(pValueStr, pSession);
148 	}
149 
150 	/**
151 	 * getEmbeddedObj
152 	 *
153 	 * @param pType
154 	 * @param pValObj
155 	 * @param pSession
156 	 * @return Object CIMClass, CIMInstance, String, CIMClass[], CIMInstance[],
157 	 *         String[] or null
158 	 * @throws SAXException
159 	 */
160 	public static Object getEmbeddedObj(CIMDataType pType, Object pValObj, SAXSession pSession) throws SAXException {
161 		if (pValObj instanceof String) {
162 			return getEmbeddedObj(pType, (String) pValObj, pSession);
163 		}
164 		return getEmbeddedObjA(pType, (String[]) pValObj, pSession);
165 	}
166 
167 	/**
168 	 * @param pType
169 	 * @param pAL
170 	 * @return Object[]
171 	 */
172 	public static Object[] getObjectArray(CIMDataType pType, ArrayList<Object> pAL) {
173 		createValFactoryA();
174 		// if (pType==null) pType=CIMDataType.STRING_T;
175 		ValueFactory factory = cValFactoryA[pType.getType()];
176 		return factory.make(pAL);
177 	}
178 
179 	/**
180 	 * getObject
181 	 *
182 	 * @param pType
183 	 * @param pValueStr
184 	 * @return Object
185 	 * @throws SAXException
186 	 */
187 	public static Object getObject(CIMDataType pType, String pValueStr) throws SAXException {
188 		if (pValueStr == null) return null;
189 		createValFactoryA();
190 		ValueFactory factory = cValFactoryA[pType.getType()];
191 		try {
192 			return factory.make(pValueStr);
193 		} catch (NumberFormatException e) {
194 			throw new SAXException(e);
195 		}
196 	}
197 
198 	/**
199 	 * getObject
200 	 *
201 	 * @param pType
202 	 * @param pValueNode
203 	 * @return Object
204 	 * @throws SAXException
205 	 */
206 	public static Object getObject(CIMDataType pType, ValueNode pValueNode) throws SAXException {
207 		if (pValueNode == null) return null;
208 		return getObject(pType, (String) pValueNode.getValue());
209 	}
210 
211 	/**
212 	 * getObject
213 	 *
214 	 * @param pType
215 	 * @param pValueArrayNode
216 	 * @return Object
217 	 * @throws SAXException
218 	 */
219 	public static Object getObject(CIMDataType pType, ValueArrayNode pValueArrayNode) throws SAXException {
220 		if (pValueArrayNode == null) return null;
221 		ArrayList<Object> objAL = new ArrayList<Object>(pValueArrayNode.size());
222 		for (int i = 0; i < pValueArrayNode.size(); i++) objAL.add(getObject(pType, (String) pValueArrayNode.elementAt(i)));
223 		return getObjectArray(pType, objAL);
224 	}
225 
226 	/**
227 	 * getCIMObjType
228 	 *
229 	 * @param pObj
230 	 * @param pNullToString
231 	 * @return CIMDataType OBJECT_T, CLASS_T, STRING_T
232 	 * @throws SAXException
233 	 */
234 	public static CIMDataType getCIMObjScalarType(Object pObj, boolean pNullToString) throws SAXException {
235 		if (pObj == null) return pNullToString ? CIMDataType.STRING_T : null;
236 		if (pObj instanceof CIMInstance) {
237 			return CIMDataType.OBJECT_T;
238 		} else if (pObj instanceof CIMClass) {
239 			return CIMDataType.CLASS_T;
240 		} else if (pObj instanceof String) {
241 			return CIMDataType.STRING_T;
242 		}
243 		throw new SAXException(pObj.getClass().getName() + " is not a CIMObject!");
244 	}
245 
246 	/**
247 	 * getCIMObjType
248 	 *
249 	 * @param pObj
250 	 * @return CIMDataType OBJECT_T, OBJECT_ARRAY_T
251 	 * @throws SAXException
252 	 */
253 	public static CIMDataType getCIMObjScalarType(Object pObj) throws SAXException {
254 		return getCIMObjScalarType(pObj, true);
255 	}
256 
257 	/**
258 	 * getCIMObjArrayType
259 	 *
260 	 * @param pObj
261 	 * @return CIMDataType: OBJECT_ARRAY_T, CLASS_T array, STRING_ARRAY_T
262 	 * @throws SAXException
263 	 */
264 	public static CIMDataType getCIMObjArrayType(Object pObj) throws SAXException {
265 		return getCIMObjArrayType(pObj, true);
266 	}
267 
268 	/**
269 	 * getArrayCIMObjType
270 	 *
271 	 * @param pObj
272 	 * @param pNullToString
273 	 * @return CIMDataType: OBJECT_ARRAY_T, CLASS_T array, STRING_ARRAY_T or
274 	 *         null
275 	 * @throws SAXException
276 	 */
277 	public static CIMDataType getCIMObjArrayType(Object pObj, boolean pNullToString) throws SAXException {
278 		if (pObj == null) return pNullToString ? CIMDataType.STRING_ARRAY_T : null;
279 		if (pObj instanceof CIMInstance[]) {
280 			return CIMDataType.OBJECT_ARRAY_T;
281 		} else if (pObj instanceof CIMClass[]) {
282 			return CIMDataType.CLASS_ARRAY_T;
283 		} else if (pObj instanceof String[]) {
284 			return CIMDataType.STRING_ARRAY_T;
285 		}
286 		throw new SAXException(pObj.getClass().getName() + " is not a CIMObject array!");
287 	}
288 
289 	/**
290 	 * getType
291 	 *
292 	 * @param pTypeStr
293 	 * @return CIMDataType
294 	 * @throws SAXException
295 	 */
296 	public static CIMDataType getType(String pTypeStr) throws SAXException {
297 		if (pTypeStr == null) return null;
298 		createTypeStrMap();
299 		CIMDataType type = cTypeStrMap.get(pTypeStr);
300 		if (type == null && !cTypeStrMap.containsKey(pTypeStr)) throw new SAXException(pTypeStr + " is invalid PARAMTYPE!");
301 		return type;
302 	}
303 
304 	static final CIMInstance[] EMPTY_INST_A = new CIMInstance[0];
305 
306 	static final CIMClass[] EMPTY_CLASS_A = new CIMClass[0];
307 
308 	static final String[] EMPTY_STR_A = new String[0];
309 
310 	static final UnsignedInteger8[] EMPTY_UINT8_A = new UnsignedInteger8[0];
311 
312 	static final UnsignedInteger16[] EMPTY_UINT16_A = new UnsignedInteger16[0];
313 
314 	static final UnsignedInteger32[] EMPTY_UINT32_A = new UnsignedInteger32[0];
315 
316 	static final UnsignedInteger64[] EMPTY_UINT64_A = new UnsignedInteger64[0];
317 
318 	static final Byte[] EMPTY_BYTE_A = new Byte[0];
319 
320 	static final Short[] EMPTY_SHORT_A = new Short[0];
321 
322 	static final Integer[] EMPTY_INT_A = new Integer[0];
323 
324 	static final Long[] EMPTY_LONG_A = new Long[0];
325 
326 	static final Float[] EMPTY_FLOAT_A = new Float[0];
327 
328 	static final Double[] EMPTY_DOUBLE_A = new Double[0];
329 
330 	static final Character[] EMPTY_CHAR_A = new Character[0];
331 
332 	static final Boolean[] EMPTY_BOOL_A = new Boolean[0];
333 
334 	static final CIMDateTime[] EMPTY_DT_A = new CIMDateTime[0];
335 
336 	static final CIMObjectPath[] EMPTY_OP_A = new CIMObjectPath[0];
337 
338 	private static void embeddedObjTypeCheck(CIMDataType pType) throws SAXException {
339 		if (pType.getType() != CIMDataType.STRING) throw new SAXException(
340 			"TYPE attribute should be 'string' for EmbeddedObjects!"
341 		);
342 	}
343 
344 	private static Object parseEmbeddedObj(String pValueStr, SAXSession pSession) throws SAXException {
345 		if (pValueStr == null || pValueStr.length() == 0) return null;
346 		XMLDefaultHandlerImpl ourHandler = new XMLDefaultHandlerImpl(pSession, true);
347 		// XML String of embedded Object is parsed by the SAX parser
348 		SAXParserFactory factory = SAXParserFactory.newInstance();
349 		try {
350 			SAXParser saxParser = factory.newSAXParser();
351 			saxParser.parse(new ByteArrayInputStream(pValueStr.getBytes()), ourHandler);
352 		} catch (SAXException se) {
353 			throw se;
354 		} catch (Exception e) {
355 			throw new SAXException("Exception occurred during embedded object parsing!", e);
356 		}
357 		Node node = ourHandler.getRootNode();
358 		if (node instanceof InstanceNode) {
359 			return ((InstanceNode) node).getCIMInstance();
360 		}
361 		if (node instanceof ClassNode) {
362 			return ((ClassNode) node).getCIMClass();
363 		}
364 		throw new SAXException(node.getNodeName() + " root element is unexpected for Embedded Object XML String!");
365 	}
366 
367 	private static HashMap<String, CIMDataType> cTypeStrMap;
368 
369 	private static synchronized void createTypeStrMap() {
370 		if (cTypeStrMap != null) return;
371 		cTypeStrMap = new HashMap<String, CIMDataType>();
372 		cTypeStrMap.put(MOF.DT_UINT8, CIMDataType.UINT8_T);
373 		cTypeStrMap.put(MOF.DT_UINT16, CIMDataType.UINT16_T);
374 		cTypeStrMap.put(MOF.DT_UINT32, CIMDataType.UINT32_T);
375 		cTypeStrMap.put(MOF.DT_UINT64, CIMDataType.UINT64_T);
376 		cTypeStrMap.put(MOF.DT_SINT8, CIMDataType.SINT8_T);
377 		cTypeStrMap.put(MOF.DT_SINT16, CIMDataType.SINT16_T);
378 		cTypeStrMap.put(MOF.DT_SINT32, CIMDataType.SINT32_T);
379 		cTypeStrMap.put(MOF.DT_SINT64, CIMDataType.SINT64_T);
380 		cTypeStrMap.put(MOF.DT_REAL32, CIMDataType.REAL32_T);
381 		cTypeStrMap.put(MOF.DT_REAL64, CIMDataType.REAL64_T);
382 		cTypeStrMap.put(MOF.DT_CHAR16, CIMDataType.CHAR16_T);
383 		cTypeStrMap.put(MOF.DT_STR, CIMDataType.STRING_T);
384 		cTypeStrMap.put(MOF.DT_BOOL, CIMDataType.BOOLEAN_T);
385 		cTypeStrMap.put(MOF.DT_DATETIME, CIMDataType.DATETIME_T);
386 		cTypeStrMap.put(MOF.REFERENCE, new CIMDataType(""));
387 	}
388 
389 	private interface ValueFactory {
390 		/**
391 		 * make
392 		 *
393 		 * @param pStr
394 		 * @return Object
395 		 */
396 		Object make(String pStr);
397 
398 		/**
399 		 * make
400 		 *
401 		 * @param pAL
402 		 * @return Object[]
403 		 */
404 		Object[] make(ArrayList<Object> pAL);
405 	}
406 
407 	private static ValueFactory[] cValFactoryA;
408 
409 	private static void putFactory(int pTypeCode, ValueFactory pFactory) {
410 		cValFactoryA[pTypeCode] = pFactory;
411 	}
412 
413 	private static synchronized void createValFactoryA() {
414 		if (cValFactoryA != null) return;
415 		cValFactoryA = new ValueFactory[64];
416 		// unsigned integers
417 		putFactory(
418 			CIMDataType.UINT8,
419 			new ValueFactory() {
420 
421 				public Object make(String pStr) {
422 					return new UnsignedInteger8(pStr);
423 				}
424 
425 				public Object[] make(ArrayList<Object> pAL) {
426 					return pAL.toArray(EMPTY_UINT8_A);
427 				}
428 			}
429 		);
430 		putFactory(
431 			CIMDataType.UINT16,
432 			new ValueFactory() {
433 
434 				public Object make(String pStr) {
435 					return new UnsignedInteger16(pStr);
436 				}
437 
438 				public Object[] make(ArrayList<Object> pAL) {
439 					return pAL.toArray(EMPTY_UINT16_A);
440 				}
441 			}
442 		);
443 		putFactory(
444 			CIMDataType.UINT32,
445 			new ValueFactory() {
446 
447 				public Object make(String pStr) {
448 					return new UnsignedInteger32(pStr);
449 				}
450 
451 				public Object[] make(ArrayList<Object> pAL) {
452 					return pAL.toArray(EMPTY_UINT32_A);
453 				}
454 			}
455 		);
456 		putFactory(
457 			CIMDataType.UINT64,
458 			new ValueFactory() {
459 
460 				public Object make(String pStr) {
461 					return new UnsignedInteger64(pStr);
462 				}
463 
464 				public Object[] make(ArrayList<Object> pAL) {
465 					return pAL.toArray(EMPTY_UINT64_A);
466 				}
467 			}
468 		);
469 		// signed integers
470 		putFactory(
471 			CIMDataType.SINT8,
472 			new ValueFactory() {
473 
474 				public Object make(String pStr) {
475 					return new Byte(pStr);
476 				}
477 
478 				public Object[] make(ArrayList<Object> pAL) {
479 					return pAL.toArray(EMPTY_BYTE_A);
480 				}
481 			}
482 		);
483 		putFactory(
484 			CIMDataType.SINT16,
485 			new ValueFactory() {
486 
487 				public Object make(String pStr) {
488 					return new Short(pStr);
489 				}
490 
491 				public Object[] make(ArrayList<Object> pAL) {
492 					return pAL.toArray(EMPTY_SHORT_A);
493 				}
494 			}
495 		);
496 		putFactory(
497 			CIMDataType.SINT32,
498 			new ValueFactory() {
499 
500 				public Object make(String pStr) {
501 					return new Integer(pStr);
502 				}
503 
504 				public Object[] make(ArrayList<Object> pAL) {
505 					return pAL.toArray(EMPTY_INT_A);
506 				}
507 			}
508 		);
509 		putFactory(
510 			CIMDataType.SINT64,
511 			new ValueFactory() {
512 
513 				public Object make(String pStr) {
514 					return new Long(pStr);
515 				}
516 
517 				public Object[] make(ArrayList<Object> pAL) {
518 					return pAL.toArray(EMPTY_LONG_A);
519 				}
520 			}
521 		);
522 		// floats
523 		putFactory(
524 			CIMDataType.REAL32,
525 			new ValueFactory() {
526 
527 				public Object make(String pStr) {
528 					return new Float(pStr);
529 				}
530 
531 				public Object[] make(ArrayList<Object> pAL) {
532 					return pAL.toArray(EMPTY_FLOAT_A);
533 				}
534 			}
535 		);
536 		putFactory(
537 			CIMDataType.REAL64,
538 			new ValueFactory() {
539 
540 				public Object make(String pStr) {
541 					if (WBEMConfiguration.getGlobalConfiguration().verifyJavaLangDoubleStrings()) {
542 						if (Util.isBadDoubleString(pStr)) throw new IllegalArgumentException(
543 							"Double value string hangs older JVMs!\n" + pStr
544 						);
545 					}
546 					return new Double(pStr);
547 				}
548 
549 				public Object[] make(ArrayList<Object> pAL) {
550 					return pAL.toArray(EMPTY_DOUBLE_A);
551 				}
552 			}
553 		);
554 		// char
555 		putFactory(
556 			CIMDataType.CHAR16,
557 			new ValueFactory() {
558 
559 				public Object make(String pStr) {
560 					if (pStr == null || pStr.length() == 0) throw new IllegalArgumentException(
561 						"Cannot make Character from empty String!"
562 					);
563 					return Character.valueOf(pStr.charAt(0));
564 				}
565 
566 				public Object[] make(ArrayList<Object> pAL) {
567 					return pAL.toArray(EMPTY_CHAR_A);
568 				}
569 			}
570 		);
571 		// string
572 		putFactory(
573 			CIMDataType.STRING,
574 			new ValueFactory() {
575 
576 				public Object make(String pStr) {
577 					return pStr;
578 				}
579 
580 				public Object[] make(ArrayList<Object> pAL) {
581 					return pAL.toArray(EMPTY_STR_A);
582 				}
583 			}
584 		);
585 		// boolean
586 		putFactory(
587 			CIMDataType.BOOLEAN,
588 			new ValueFactory() {
589 
590 				public Object make(String pStr) {
591 					return Boolean.valueOf(pStr);
592 				}
593 
594 				public Object[] make(ArrayList<Object> pAL) {
595 					return pAL.toArray(EMPTY_BOOL_A);
596 				}
597 			}
598 		);
599 		// datetime
600 		putFactory(
601 			CIMDataType.DATETIME,
602 			new ValueFactory() {
603 
604 				public Object make(String pStr) {
605 					try {
606 						return new CIMDateTimeAbsolute(pStr);
607 					} catch (IllegalArgumentException eA) {
608 						try {
609 							return new CIMDateTimeInterval(pStr);
610 						} catch (IllegalArgumentException eI) {
611 							throw new IllegalArgumentException(
612 								"CIMDataTimeAbsolute:" + eA.getMessage() + "\nCIMDateTimeInterval:" + eI.getMessage()
613 							);
614 						}
615 					}
616 				}
617 
618 				public Object[] make(ArrayList<Object> pAL) {
619 					return pAL.toArray(EMPTY_DT_A);
620 				}
621 			}
622 		);
623 		// reference
624 		putFactory(
625 			CIMDataType.REFERENCE,
626 			new ValueFactory() {
627 
628 				public Object make(String pStr) {
629 					return new CIMObjectPath(pStr);
630 				}
631 
632 				public Object[] make(ArrayList<Object> pAL) {
633 					return pAL.toArray(EMPTY_OP_A);
634 				}
635 			}
636 		);
637 	}
638 }