/** * Fills in the instance from a given AXIOM node. * * @param rootNode Starting point. */ private void parseObjectRefs(OMElement rootNode) { List<OMElement> list = XConfig.parseLevelOneNode(rootNode, "ObjectReference"); for (OMElement currentNode : list) { XConfigObjectRef objRef = new XConfigObjectRef(); objRef.parse(currentNode); this.objectRefs.add(objRef); } }
/** * @param name * @param type * @return */ public XConfigObject getXConfigObjectWithName(String name, String type) { XConfigObject configObject = null; for (XConfigObjectRef objRef : this.objectRefs) { if (objRef.getRefType().equals(type)) { if (objRef.getName().equals(name)) { configObject = objRef.getXConfigObject(); break; } } } return configObject; }
/** * @param type * @return */ public List<XConfigObject> getXConfigObjectsWithType(String type) { List<XConfigObject> configObjects = new ArrayList<XConfigObject>(); for (XConfigObjectRef objRef : this.objectRefs) { if (objRef.getRefType().equals(type)) { XConfigObject configObject = objRef.getXConfigObject(); if (configObject != null) { configObjects.add(configObject); } } } return configObjects; }