if (listFormat != null) { if (! listFormat.hasObjects) { listFormat.object.addField (listFormat.name, listFormat.type, atts.getValue ("value"), false, true); } } else if (debug) System.out.println ("SchedulingData.startElement - expecting listFormat to be set when hit VALUE tag.");
if (listFormat != null) { if (! listFormat.hasObjects) { listFormat.object.addField (listFormat.name, listFormat.type, atts.getValue ("value"), false, true); } } else if (debug) System.out.println ("SchedulingData.startElement - expecting " + "listFormat to be set when hit VALUE tag.");
    public void startElement (String uri, String local,                              String name, Attributes atts) {      if (name.equals ("FIELD")) {        fieldname = atts.getValue ("name");        FieldFormat ff = (FieldFormat)          ((HashMap) formats.get (objectType)).get (fieldname);        if (ff == null) {		  if (throwExceptionOnMissingField) {			throw new RuntimeException ("Undefined field named " + fieldname +										" for object type " + objectType);		  }		  else {			if (debug)			  System.out.println ("SchedulingData.startElement - NOTE : found undefined field " +								  fieldname + " for object type " + objectType +								  ". Ignoring.");			prefixes.push (prefix);			return;		  }		}        prefixes.push (prefix);        if (ff.is_list) {          listFormats.push (listFormat);          listFormat = new ListFormat();          listFormat.name = prefix + fieldname;          listFormat.type = ff.datatype;          listFormat.hasObjects = ff.is_subobject;          listFormat.object = object;          object.addListField (listFormat.name);          objects.push (object);          object = null;          prefix = "";        }        else if (ff.is_subobject) {          prefix = prefix + fieldname + ".";        }        else {          object.addField (prefix + fieldname, ff.datatype,                           atts.getValue ("value"), ff.is_key, false);          if (ff.is_key && (object instanceof Task)) {            addTask ((Task) object);          }          if (ff.is_key && (object instanceof Resource))            resources.put (((Resource) object).getKey(), object);          if (predefined != null)            predefined.addField (fieldname, ff.datatype,                                 atts.getValue ("value"), false, false);        }      }      else if (name.equals ("OBJECT")) {        objectTypes.push (objectType);        objectType = atts.getValue ("type");        if ((object != null) && predefinedTypes.contains (objectType)) {          predefined = new SchObject (timeOps);          object.addField (((String) prefixes.peek()) + fieldname,                           objectType, predefined, false, false);        }        objects.push (object);        if (objectType.equals (taskObject))          object = new Task (timeOps);        else if (objectType.equals (resourceObject))          object = new Resource (timeOps);        else if (object == null) {          object = new SchObject (timeOps);          if (listFormat != null) {            listFormat.object.addField (listFormat.name, listFormat.type,                                        object, false, true);          }        }        if (globalName != null) {          addGlobal (globalName, objectType, object);          globalName = null;        }      }      else if (name.equals ("VALUE")) {		if (listFormat != null) {		  if (! listFormat.hasObjects) {			listFormat.object.addField (listFormat.name, listFormat.type,										atts.getValue ("value"), false, true);		  }		}		else if (debug)		  System.out.println ("SchedulingData.startElement - expecting listFormat to be set when hit VALUE tag.");      }      else if (name.equals ("FIELDFORMAT")) {        FieldFormat ff = new FieldFormat          (atts.getValue ("datatype"),           atts.getValue ("is_key").equals ("true"),           atts.getValue ("is_subobject").equals ("true"),           atts.getValue ("is_list").equals ("true"));        if (ff.datatype.startsWith ("string"))          ff.datatype = "string";        currentFormat.put (atts.getValue ("name"), ff);      }      else if (name.equals ("OBJECTFORMAT")) {        currentFormat = new HashMap();        formats.put (atts.getValue ("name"), currentFormat);        if ((taskObject == null) &&            atts.getValue ("is_task").equals ("true"))          taskObject = atts.getValue ("name");        if ((resourceObject == null) &&            atts.getValue ("is_resource").equals ("true"))          resourceObject = atts.getValue ("name");      }      else if (name.equals ("GLOBAL")) {        globalName = atts.getValue ("name");      }      else if (name.equals ("WINDOW")) {        startTime = timeOps.stringToTime (atts.getValue ("starttime"));        if (atts.getValue ("endtime") != null)          endTime = timeOps.stringToTime (atts.getValue ("endtime"));      }    }