String paramId = newparameter.getParamId(); if (paramId != null) {   if (ParamObj.containsKey(paramId)) Log.warnln("More than one param node with paramId=\""+paramId+"\", using latest node." );   ParamObj.put(paramId, newparameter);  }    String paramIdRef = newparameter.getParamIdRef(); if (paramIdRef != null) {  if (ParamObj.containsKey(paramIdRef)) {  Parameter refParamObj = (Parameter) ParamObj.get(paramIdRef); try { newparameter = (Parameter) refParamObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone param object. Aborting read."); System.exit(-1); }   newparameter.setXMLAttributes(attrs);  newparameter.setParamId(findUniqueIdName(ParamObj,newparameter.getParamId())); newparameter.setParamIdRef(null);   ParamObj.put(newparameter.getParamId(), newparameter);  } else { Log.warnln("Error: Reader got an param with ParamIdRef=\""+paramIdRef+"\" but no previous param has that id! Ignoring add param request."); return (Object) null; } }
       public Object action (SaxDocumentHandler handler, AttributeList attrs) {          // grab parent node name          String parentNodeName = getParentNodeName();          // create new object appropriately           Parameter newparameter = new Parameter();          newparameter.setXMLAttributes(attrs); // set XML attributes from passed list           // determine where this goes and then insert it           if( parentNodeName.equals(XDFNodeName.ARRAY) )           {            newparameter = CurrentArray.addParameter(newparameter);          } else if ( parentNodeName.equals(XDFNodeName.ROOT)               || parentNodeName.equals(XDFNodeName.STRUCTURE) )          {            newparameter = CurrentStructure.addParameter(newparameter);          } else if ( parentNodeName.equals(XDFNodeName.PARAMETERGROUP) )           {            // for now, just add as regular parameter             if(LastParameterGroupParentObject instanceof Array) {               newparameter = ((Array) LastParameterGroupParentObject).addParameter(newparameter);            } else if(LastParameterGroupParentObject instanceof Structure) {               newparameter = ((Structure) LastParameterGroupParentObject).addParameter(newparameter);            }          } else {            Log.warnln("Error: weird parent node "+parentNodeName+" for parameter, ignoring");            return (Object) null;          }          // add this object to all open groups          Iterator iter = CurrentParameterGroupList.iterator();          while (iter.hasNext()) {             ParameterGroup nextParamGroupObj = (ParameterGroup) iter.next();             newparameter.addToGroup(nextParamGroupObj);          }          LastParameterObject = newparameter;          return newparameter;       }