bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
|---|---|---|
private String dealWithClosingGroupNodes (BaseObject obj, OutputStream outputstream, String indent) { // Should *both* groupMemberHash and openGroupNodeHash be synchronized?? synchronized(obj.groupMemberHash) { synchronized(this.openGroupNodeHash) { Iterator iter = this.openGroupNodeHash.iterator(); // Must be in synchronized block while (iter.hasNext()) { Group openGroup = (Group) iter.next(); // determine if this group that we belong to is already // open or not. if(!obj.groupMemberHash.contains(openGroup)) { // its *not* a member of this group and its still open, // so we need to close it. if (sPrettyXDFOutput) writeOut(outputstream, indent); writeOut(outputstream, "</" + openGroup.classXDFNodeName + ">"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); this.openGroupNodeHash.remove(openGroup); // peel off some indent indent = indent.substring(0,indent.length() - sPrettyXDFOutputIndentation.length()); } } } } return indent; }
|
private String dealWithClosingGroupNodes (BaseObject obj, OutputStream outputstream, String indent) { // Should *both* groupMemberHash and openGroupNodeHash be synchronized?? synchronized(obj.groupMemberHash) { synchronized(this.openGroupNodeHash) { Iterator iter = this.openGroupNodeHash.iterator(); // Must be in synchronized block while (iter.hasNext()) { Group openGroup = (Group) iter.next(); // determine if this group that we belong to is already // open or not. if(!obj.groupMemberHash.contains(openGroup)) { // its *not* a member of this group and its still open, // so we need to close it. if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, indent); writeOut(outputstream, "</" + openGroup.classXDFNodeName + ">"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); this.openGroupNodeHash.remove(openGroup); // peel off some indent indent = indent.substring(0,indent.length() - sPrettyXDFOutputIndentation.length()); } } } } return indent; }
| 11,441
|
private String dealWithClosingGroupNodes (BaseObject obj, OutputStream outputstream, String indent) { // Should *both* groupMemberHash and openGroupNodeHash be synchronized?? synchronized(obj.groupMemberHash) { synchronized(this.openGroupNodeHash) { Iterator iter = this.openGroupNodeHash.iterator(); // Must be in synchronized block while (iter.hasNext()) { Group openGroup = (Group) iter.next(); // determine if this group that we belong to is already // open or not. if(!obj.groupMemberHash.contains(openGroup)) { // its *not* a member of this group and its still open, // so we need to close it. if (sPrettyXDFOutput) writeOut(outputstream, indent); writeOut(outputstream, "</" + openGroup.classXDFNodeName + ">"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); this.openGroupNodeHash.remove(openGroup); // peel off some indent indent = indent.substring(0,indent.length() - sPrettyXDFOutputIndentation.length()); } } } } return indent; }
|
private String dealWithClosingGroupNodes (BaseObject obj, OutputStream outputstream, String indent) { // Should *both* groupMemberHash and openGroupNodeHash be synchronized?? synchronized(obj.groupMemberHash) { synchronized(this.openGroupNodeHash) { Iterator iter = this.openGroupNodeHash.iterator(); // Must be in synchronized block while (iter.hasNext()) { Group openGroup = (Group) iter.next(); // determine if this group that we belong to is already // open or not. if(!obj.groupMemberHash.contains(openGroup)) { // its *not* a member of this group and its still open, // so we need to close it. if (sPrettyXDFOutput) writeOut(outputstream, indent); writeOut(outputstream, "</" + openGroup.classXDFNodeName + ">"); if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); this.openGroupNodeHash.remove(openGroup); // peel off some indent indent = indent.substring(0,indent.length() - sPrettyXDFOutputIndentation.length()); } } } } return indent; }
| 11,442
|
private String dealWithClosingGroupNodes (BaseObject obj, OutputStream outputstream, String indent) { // Should *both* groupMemberHash and openGroupNodeHash be synchronized?? synchronized(obj.groupMemberHash) { synchronized(this.openGroupNodeHash) { Iterator iter = this.openGroupNodeHash.iterator(); // Must be in synchronized block while (iter.hasNext()) { Group openGroup = (Group) iter.next(); // determine if this group that we belong to is already // open or not. if(!obj.groupMemberHash.contains(openGroup)) { // its *not* a member of this group and its still open, // so we need to close it. if (sPrettyXDFOutput) writeOut(outputstream, indent); writeOut(outputstream, "</" + openGroup.classXDFNodeName + ">"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); this.openGroupNodeHash.remove(openGroup); // peel off some indent indent = indent.substring(0,indent.length() - sPrettyXDFOutputIndentation.length()); } } } } return indent; }
|
private String dealWithClosingGroupNodes (BaseObject obj, OutputStream outputstream, String indent) { // Should *both* groupMemberHash and openGroupNodeHash be synchronized?? synchronized(obj.groupMemberHash) { synchronized(this.openGroupNodeHash) { Iterator iter = this.openGroupNodeHash.iterator(); // Must be in synchronized block while (iter.hasNext()) { Group openGroup = (Group) iter.next(); // determine if this group that we belong to is already // open or not. if(!obj.groupMemberHash.contains(openGroup)) { // its *not* a member of this group and its still open, // so we need to close it. if (sPrettyXDFOutput) writeOut(outputstream, indent); writeOut(outputstream, "</" + openGroup.classXDFNodeName + ">"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); this.openGroupNodeHash.remove(openGroup); // peel off some indent indent = indent.substring(0,indent.length() - Specification.getInstance().getPrettyXDFOutputIndentation().length()); } } } } return indent; }
| 11,443
|
private String dealWithOpeningGroupNodes (BaseObject obj, OutputStream outputstream, String indent) { StringBuffer newIndent = new StringBuffer(indent); // Should *both* groupMemberHash and openGroupNodeHash be synchronized?? synchronized(obj.groupMemberHash) { synchronized(this.openGroupNodeHash) { Iterator iter = obj.groupMemberHash.iterator(); // Must be in synchronized block while (iter.hasNext()) { Group memberGroup = (Group) iter.next(); // determine if this group that we belong to is already // open or not. if(!this.openGroupNodeHash.contains(memberGroup)) { // its *not* already open, so we bump up the indentation, // open it and add it to the open group node list. newIndent.append(sPrettyXDFOutputIndentation); memberGroup.toXMLOutputStream(outputstream, new Hashtable(), newIndent.toString(), true, null, null); this.openGroupNodeHash.add(memberGroup); } } } } return newIndent.toString(); }
|
private String dealWithOpeningGroupNodes (BaseObject obj, OutputStream outputstream, String indent) { StringBuffer newIndent = new StringBuffer(indent); // Should *both* groupMemberHash and openGroupNodeHash be synchronized?? synchronized(obj.groupMemberHash) { synchronized(this.openGroupNodeHash) { Iterator iter = obj.groupMemberHash.iterator(); // Must be in synchronized block while (iter.hasNext()) { Group memberGroup = (Group) iter.next(); // determine if this group that we belong to is already // open or not. if(!this.openGroupNodeHash.contains(memberGroup)) { // its *not* already open, so we bump up the indentation, // open it and add it to the open group node list. newIndent.append(Specification.getInstance().getPrettyXDFOutputIndentation()); memberGroup.toXMLOutputStream(outputstream, new Hashtable(), newIndent.toString(), true, null, null); this.openGroupNodeHash.add(memberGroup); } } } } return newIndent.toString(); }
| 11,444
|
protected Hashtable getXMLInfo () { Hashtable xmlInfo = new Hashtable(); ArrayList attribList = new ArrayList(); ArrayList objRefList = new ArrayList(); int size = attribHash.size(); for (int i = 0; i < size; i++) { String attribName = (String) attribOrder.get(i); XMLAttribute obj = (XMLAttribute) attribHash.get(attribName); if (obj != null && obj.attribValue != null) { if ( obj.attribType == Constants.STRING_TYPE) { if (attribName.equals(sPCDATAAttribute)) { xmlInfo.put("PCDATA", obj.attribValue); } else { Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); attribList.add(item); } } else { if(obj.attribType == Constants.NUMBER_TYPE || obj.attribType == Constants.STRING_OR_NUMBER_TYPE) { //it's an attribute of Number type Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue.toString()); attribList.add(item); } else {// add to list if it is not an empty list -k.z. if ((obj.attribType !=Constants.LIST_TYPE) || (((List)obj.attribValue).size()!=0)) { Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); item.put("type", obj.attribType); objRefList.add(item); } } } } } xmlInfo.put("attribList", attribList); xmlInfo.put("childObjList", objRefList); return xmlInfo; }
|
protected Hashtable getXMLInfo () { Hashtable xmlInfo = new Hashtable(); ArrayList attribList = new ArrayList(); ArrayList objRefList = new ArrayList(); int size = attribHash.size(); for (int i = 0; i < size; i++) { String attribName = (String) attribOrder.get(i); XMLAttribute obj = (XMLAttribute) attribHash.get(attribName); if (obj != null && obj.attribValue != null) { if ( obj.attribType == Constants.STRING_TYPE) { if (attribName.equals(sPCDATAAttribute)) { xmlInfo.put("PCDATA", obj.attribValue); } else { Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); attribList.add(item); } } else { if(obj.attribType == Constants.NUMBER_TYPE || obj.attribType == Constants.STRING_OR_NUMBER_TYPE) { //it's an attribute of Number type Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue.toString()); attribList.add(item); } else {// add to list if it is not an empty list -k.z. if ((obj.attribType !=Constants.LIST_TYPE) || (((List)obj.attribValue).size()!=0)) { Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); item.put("type", obj.attribType); objRefList.add(item); } } } } } xmlInfo.put("attribList", attribList); xmlInfo.put("childObjList", objRefList); return xmlInfo; }
| 11,445
|
protected Hashtable getXMLInfo () { Hashtable xmlInfo = new Hashtable(); ArrayList attribList = new ArrayList(); ArrayList objRefList = new ArrayList(); int size = attribHash.size(); for (int i = 0; i < size; i++) { String attribName = (String) attribOrder.get(i); XMLAttribute obj = (XMLAttribute) attribHash.get(attribName); if (obj != null && obj.attribValue != null) { if ( obj.attribType == Constants.STRING_TYPE) { if (attribName.equals(sPCDATAAttribute)) { xmlInfo.put("PCDATA", obj.attribValue); } else { Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); attribList.add(item); } } else { if(obj.attribType == Constants.NUMBER_TYPE || obj.attribType == Constants.STRING_OR_NUMBER_TYPE) { //it's an attribute of Number type Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue.toString()); attribList.add(item); } else {// add to list if it is not an empty list -k.z. if ((obj.attribType !=Constants.LIST_TYPE) || (((List)obj.attribValue).size()!=0)) { Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); item.put("type", obj.attribType); objRefList.add(item); } } } } } xmlInfo.put("attribList", attribList); xmlInfo.put("childObjList", objRefList); return xmlInfo; }
|
protected Hashtable getXMLInfo () { Hashtable xmlInfo = new Hashtable(); ArrayList attribList = new ArrayList(); ArrayList objRefList = new ArrayList(); int size = attribHash.size(); for (int i = 0; i < size; i++) { String attribName = (String) attribOrder.get(i); XMLAttribute obj = (XMLAttribute) attribHash.get(attribName); if (obj != null && obj.attribValue != null) { if ( obj.attribType == Constants.STRING_TYPE) { if (attribName.equals(sPCDATAAttribute)) { xmlInfo.put("PCDATA", obj.attribValue); } else { Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); attribList.add(item); } } else { if(obj.attribType == Constants.NUMBER_TYPE || obj.attribType == Constants.STRING_OR_NUMBER_TYPE) { //it's an attribute of Number type Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue.toString()); attribList.add(item); } else {// add to list if it is not an empty list -k.z. if ((obj.attribType !=Constants.LIST_TYPE) || (((List)obj.attribValue).size()!=0)) { Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); item.put("type", obj.attribType); objRefList.add(item); } } } } } xmlInfo.put("attribList", attribList); xmlInfo.put("childObjList", objRefList); return xmlInfo; }
| 11,446
|
protected Hashtable getXMLInfo () { Hashtable xmlInfo = new Hashtable(); ArrayList attribList = new ArrayList(); ArrayList objRefList = new ArrayList(); int size = attribHash.size(); for (int i = 0; i < size; i++) { String attribName = (String) attribOrder.get(i); XMLAttribute obj = (XMLAttribute) attribHash.get(attribName); if (obj != null && obj.attribValue != null) { if ( obj.attribType == Constants.STRING_TYPE) { if (attribName.equals(sPCDATAAttribute)) { xmlInfo.put("PCDATA", obj.attribValue); } else { Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); attribList.add(item); } } else { if(obj.attribType == Constants.NUMBER_TYPE || obj.attribType == Constants.STRING_OR_NUMBER_TYPE) { //it's an attribute of Number type Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue.toString()); attribList.add(item); } else {// add to list if it is not an empty list -k.z. if ((obj.attribType !=Constants.LIST_TYPE) || (((List)obj.attribValue).size()!=0)) { Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); item.put("type", obj.attribType); objRefList.add(item); } } } } } xmlInfo.put("attribList", attribList); xmlInfo.put("childObjList", objRefList); return xmlInfo; }
|
protected Hashtable getXMLInfo () { Hashtable xmlInfo = new Hashtable(); ArrayList attribList = new ArrayList(); ArrayList objRefList = new ArrayList(); int size = attribHash.size(); for (int i = 0; i < size; i++) { String attribName = (String) attribOrder.get(i); XMLAttribute obj = (XMLAttribute) attribHash.get(attribName); if (obj != null && obj.attribValue != null) { if ( obj.attribType == Constants.STRING_TYPE) { if (attribName.equals(sPCDATAAttribute)) { xmlInfo.put("PCDATA", obj.attribValue); } else { Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); attribList.add(item); } } else { if(obj.attribType == Constants.NUMBER_TYPE || obj.attribType == Constants.STRING_OR_NUMBER_TYPE) { //it's an attribute of Number type Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue.toString()); attribList.add(item); } else {// add to list if it is not an empty list -k.z. if ((obj.attribType !=Constants.LIST_TYPE) || (((List)obj.attribValue).size()!=0)) { Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); item.put("type", obj.attribType); objRefList.add(item); } } } } } xmlInfo.put("attribList", attribList); xmlInfo.put("childObjList", objRefList); return xmlInfo; }
| 11,447
|
protected Hashtable getXMLInfo () { Hashtable xmlInfo = new Hashtable(); ArrayList attribList = new ArrayList(); ArrayList objRefList = new ArrayList(); int size = attribHash.size(); for (int i = 0; i < size; i++) { String attribName = (String) attribOrder.get(i); XMLAttribute obj = (XMLAttribute) attribHash.get(attribName); if (obj != null && obj.attribValue != null) { if ( obj.attribType == Constants.STRING_TYPE) { if (attribName.equals(sPCDATAAttribute)) { xmlInfo.put("PCDATA", obj.attribValue); } else { Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); attribList.add(item); } } else { if(obj.attribType == Constants.NUMBER_TYPE || obj.attribType == Constants.STRING_OR_NUMBER_TYPE) { //it's an attribute of Number type Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue.toString()); attribList.add(item); } else {// add to list if it is not an empty list -k.z. if ((obj.attribType !=Constants.LIST_TYPE) || (((List)obj.attribValue).size()!=0)) { Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); item.put("type", obj.attribType); objRefList.add(item); } } } } } xmlInfo.put("attribList", attribList); xmlInfo.put("childObjList", objRefList); return xmlInfo; }
|
protected Hashtable getXMLInfo () { Hashtable xmlInfo = new Hashtable(); ArrayList attribList = new ArrayList(); ArrayList objRefList = new ArrayList(); int size = attribHash.size(); for (int i = 0; i < size; i++) { String attribName = (String) attribOrder.get(i); XMLAttribute obj = (XMLAttribute) attribHash.get(attribName); if (obj != null && obj.attribValue != null) { if ( obj.attribType == Constants.STRING_TYPE) { if (attribName.equals(sPCDATAAttribute)) { xmlInfo.put("PCDATA", obj.attribValue); else { Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); attribList.add(item); else { if(obj.attribType == Constants.NUMBER_TYPE || obj.attribType == Constants.STRING_OR_NUMBER_TYPE) { //it's an attribute of Number type Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue.toString()); attribList.add(item); else {// add to list if it is not an empty list -k.z. if ((obj.attribType !=Constants.LIST_TYPE) || (((List)obj.attribValue).size()!=0)) { Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); item.put("type", obj.attribType); objRefList.add(item); xmlInfo.put("attribList", attribList); xmlInfo.put("childObjList", objRefList); return xmlInfo; }
| 11,448
|
protected Hashtable getXMLInfo () { Hashtable xmlInfo = new Hashtable(); ArrayList attribList = new ArrayList(); ArrayList objRefList = new ArrayList(); int size = attribHash.size(); for (int i = 0; i < size; i++) { String attribName = (String) attribOrder.get(i); XMLAttribute obj = (XMLAttribute) attribHash.get(attribName); if (obj != null && obj.attribValue != null) { if ( obj.attribType == Constants.STRING_TYPE) { if (attribName.equals(sPCDATAAttribute)) { xmlInfo.put("PCDATA", obj.attribValue); } else { Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); attribList.add(item); } } else { if(obj.attribType == Constants.NUMBER_TYPE || obj.attribType == Constants.STRING_OR_NUMBER_TYPE) { //it's an attribute of Number type Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue.toString()); attribList.add(item); } else {// add to list if it is not an empty list -k.z. if ((obj.attribType !=Constants.LIST_TYPE) || (((List)obj.attribValue).size()!=0)) { Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); item.put("type", obj.attribType); objRefList.add(item); } } } } } xmlInfo.put("attribList", attribList); xmlInfo.put("childObjList", objRefList); return xmlInfo; }
|
protected Hashtable getXMLInfo () { Hashtable xmlInfo = new Hashtable(); ArrayList attribList = new ArrayList(); ArrayList objRefList = new ArrayList(); int size = attribHash.size(); for (int i = 0; i < size; i++) { String attribName = (String) attribOrder.get(i); XMLAttribute obj = (XMLAttribute) attribHash.get(attribName); if (obj != null && obj.attribValue != null) { if ( obj.attribType == Constants.STRING_TYPE) { if (attribName.equals(sPCDATAAttribute)) { xmlInfo.put("PCDATA", obj.attribValue); } else { Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); attribList.add(item); } } else { if(obj.attribType == Constants.NUMBER_TYPE || obj.attribType == Constants.STRING_OR_NUMBER_TYPE) { //it's an attribute of Number type Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue.toString()); attribList.add(item); } else {// add to list if it is not an empty list -k.z. if ((obj.attribType !=Constants.LIST_TYPE) || (((List)obj.attribValue).size()!=0)) { Hashtable item = new Hashtable(); item.put("name", attribName); item.put("value", obj.attribValue); item.put("type", obj.attribType); objRefList.add(item); } } } } } xmlInfo.put("attribList", attribList); xmlInfo.put("childObjList", objRefList); return xmlInfo; }
| 11,449
|
protected void hashtableInitXDFAttributes (Hashtable InitAttributeTable) { Object attribute; Object obj; int size = attribOrder.size(); for (int i = 0; i < size; i++) { attribute = attribOrder.get(i); obj = InitAttributeTable.get(attribute); // only if object exists if (obj != null) { XMLAttribute toRemove = (XMLAttribute) attribHash.remove(attribute); attribHash.put(attribute, new XMLAttribute(obj, toRemove.getAttribType())); } } }
|
protected void hashtableInitXDFAttributes (Hashtable InitAttributeTable) { Object attribute; Object obj; int size = attribOrder.size(); for (int i = 0; i < size; i++) { attribute = attribOrder.get(i); obj = InitAttributeTable.get(attribute); // only if object exists if (obj != null) { XMLAttribute toRemove = (XMLAttribute) attribHash.remove(attribute); attribHash.put(attribute, new XMLAttribute(obj, toRemove.getAttribType())); } } }
| 11,450
|
protected void hashtableInitXDFAttributes (Hashtable InitAttributeTable) { Object attribute; Object obj; int size = attribOrder.size(); for (int i = 0; i < size; i++) { attribute = attribOrder.get(i); obj = InitAttributeTable.get(attribute); // only if object exists if (obj != null) { XMLAttribute toRemove = (XMLAttribute) attribHash.remove(attribute); attribHash.put(attribute, new XMLAttribute(obj, toRemove.getAttribType())); } } }
|
protected void hashtableInitXDFAttributes (Hashtable InitAttributeTable) { Object attribute; Object obj; int size = attribOrder.size(); for (int i = 0; i < size; i++) { attribute = attribOrder.get(i); obj = InitAttributeTable.get(attribute); // only if object exists if (obj != null) { XMLAttribute toRemove = (XMLAttribute) attribHash.remove(attribute); attribHash.put(attribute, new XMLAttribute(obj, toRemove.getAttribType())); } } }
| 11,451
|
protected void hashtableInitXDFAttributes (Hashtable InitAttributeTable) { Object attribute; Object obj; int size = attribOrder.size(); for (int i = 0; i < size; i++) { attribute = attribOrder.get(i); obj = InitAttributeTable.get(attribute); // only if object exists if (obj != null) { XMLAttribute toRemove = (XMLAttribute) attribHash.remove(attribute); attribHash.put(attribute, new XMLAttribute(obj, toRemove.getAttribType())); } } }
|
protected void hashtableInitXDFAttributes (Hashtable InitAttributeTable) { Object attribute; Object obj; int size = attribOrder.size(); for (int i = 0; i < size; i++) { attribute = attribOrder.get(i); obj = InitAttributeTable.get(attribute); // only if object exists if (obj != null) { XMLAttribute toRemove = (XMLAttribute) attribHash.remove(attribute); attribHash.put(attribute, new XMLAttribute(obj, toRemove.getAttribType())); } } }
| 11,452
|
public boolean isGroupMember(Group groupObject) { if ( (groupObject != null) && groupMemberHash.contains(groupObject)) return true; else return false; }
|
public boolean isGroupMember(Group groupObject) { if ( groupMemberHash.contains(groupObject)) return true; else return false; }
| 11,453
|
public Group removeFromGroup (Group groupObject) { if (groupObject != null) { if (groupMemberHash.contains(groupObject)) { //this object does belong to the indicated Group object groupObject.removeMemberObject((Object) this); groupMemberHash.remove(groupObject); return groupObject; } else { Log.error("Can't delete from group. not a member of the group" + groupObject.getName()); return null; } } else { Log.error("Error: The group to add to is null"); return null; } }
|
public Group removeFromGroup (Group groupObject) { if (groupMemberHash.contains(groupObject)) { //this object does belong to the indicated Group object groupObject.removeMemberObject((Object) this); groupMemberHash.remove(groupObject); return groupObject; } else { Log.error("Can't delete from group. not a member of the group" + groupObject.getName()); return null; } } else { Log.error("Error: The group to add to is null"); return null; } }
| 11,454
|
public Group removeFromGroup (Group groupObject) { if (groupObject != null) { if (groupMemberHash.contains(groupObject)) { //this object does belong to the indicated Group object groupObject.removeMemberObject((Object) this); groupMemberHash.remove(groupObject); return groupObject; } else { Log.error("Can't delete from group. not a member of the group" + groupObject.getName()); return null; } } else { Log.error("Error: The group to add to is null"); return null; } }
|
public Group removeFromGroup (Group groupObject) { if (groupObject != null) { if (groupMemberHash.contains(groupObject)) { //this object does belong to the indicated Group object groupObject.removeMemberObject((Object) this); groupMemberHash.remove(groupObject); return groupObject; } else { Log.errorln("Can't delete from group. not a member of the group" + groupObject.getName()); return null; } } else { Log.error("Error: The group to add to is null"); return null; } }
| 11,455
|
public Group removeFromGroup (Group groupObject) { if (groupObject != null) { if (groupMemberHash.contains(groupObject)) { //this object does belong to the indicated Group object groupObject.removeMemberObject((Object) this); groupMemberHash.remove(groupObject); return groupObject; } else { Log.error("Can't delete from group. not a member of the group" + groupObject.getName()); return null; } } else { Log.error("Error: The group to add to is null"); return null; } }
|
public Group removeFromGroup (Group groupObject) { if (groupObject != null) { if (groupMemberHash.contains(groupObject)) { //this object does belong to the indicated Group object groupObject.removeMemberObject((Object) this); groupMemberHash.remove(groupObject); return groupObject; } else { Log.error("Can't delete from group. not a member of the group" + groupObject.getName()); return null; } } else { Log.error("Error: The group to add to is null"); return null; } }
| 11,456
|
protected boolean removeFromList ( Object what, List fromList, String listName ) { if (fromList != null) { if ( what != null) { int index = fromList.indexOf(what); if (index !=-1) { //object to be removed is found in the list fromList.remove(index); return true; } else { //cant find the object in the list Log.warn("warn: can't find object in" + listName + ", ignoring remove"); return false; } } else { //object to remove is null Log.error("Error: object to remove is null"); return false; } } else { //the list to remove from is null Log.error("Error: Passed list to remove from is null, no object to remove"); return false; } }
|
protected boolean removeFromList ( Object what, List fromList, String listName ) { if (fromList != null) { if ( what != null) { int index = fromList.indexOf(what); if (index !=-1) { //object to be removed is found in the list fromList.remove(index); return true; } else { //cant find the object in the list Log.warn("warn: can't find object in" + listName + ", ignoring remove"); return false; } } else { //object to remove is null Log.error("Error: object to remove is null"); return false; } } else { //the list to remove from is null Log.error("Error: Passed list to remove from is null, no object to remove"); return false; } }
| 11,457
|
protected boolean removeFromList ( Object what, List fromList, String listName ) { if (fromList != null) { if ( what != null) { int index = fromList.indexOf(what); if (index !=-1) { //object to be removed is found in the list fromList.remove(index); return true; } else { //cant find the object in the list Log.warn("warn: can't find object in" + listName + ", ignoring remove"); return false; } } else { //object to remove is null Log.error("Error: object to remove is null"); return false; } } else { //the list to remove from is null Log.error("Error: Passed list to remove from is null, no object to remove"); return false; } }
|
protected boolean removeFromList ( Object what, List fromList, String listName ) { if (fromList != null) { if ( what != null) { int index = fromList.indexOf(what); if (index !=-1) { //object to be removed is found in the list fromList.remove(index); return true; } else { //cant find the object in the list Log.warn("warn: can't find object in" + listName + ", ignoring remove"); return false; } } else { //object to remove is null Log.error("Error: object to remove is null"); return false; } } else { //the list to remove from is null Log.error("Error: Passed list to remove from is null, no object to remove"); return false; } }
| 11,458
|
protected void setXMLAttributes (AttributeList attrs) { // set object attributes from an AttributeList if (attrs != null) { // whip thru the list, setting each value int size = attrs.getLength(); for (int i = 0; i < size; i++) { String name = attrs.getName(i); String value = attrs.getValue(i); if (this.attribHash.containsKey(name)) { ((XMLAttribute) this.attribHash.get(name)).setAttribValue(value); } else Log.errorln("Error: cant set XMLAttribute:["+name+"], doesnt exist in object:"+this); } } }
|
protected void setXMLAttributes (AttributeList attrs) { // set object attributes from an AttributeList if (attrs != null) { // whip thru the list, setting each value int size = attrs.getLength(); for (int i = 0; i < size; i++) { String name = attrs.getName(i); String value = attrs.getValue(i); if (this.attribHash.containsKey(name)) { ((XMLAttribute) this.attribHash.get(name)).setAttribValue(value); } else Log.errorln("Error: cant set XMLAttribute:["+name+"], doesnt exist in object:"+this); } } }
| 11,460
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) nodeNameString = sXDFRootNodeName; writeOut(outputstream,"<" + nodeNameString); // print opening statement } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { int size = attribs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if ((sPrettyXDFOutput) && (pcdata == null)) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list int size = childObjs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName and close the node if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent + sPrettyXDFOutputIndentation); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { indent = dealWithClosingGroupNodes((BaseObject) this, outputstream, indent); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, indent); if (!dontCloseNode) writeOut(outputstream, "</"+nodeNameString+">"); } } else { if (dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) writeOut(outputstream, ">"); } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { synchronized (attribHash) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) nodeNameString = sXDFRootNodeName; writeOut(outputstream,"<" + nodeNameString); // print opening statement } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { int size = attribs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if ((sPrettyXDFOutput) && (pcdata == null)) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list int size = childObjs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName and close the node if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent + sPrettyXDFOutputIndentation); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { indent = dealWithClosingGroupNodes((BaseObject) this, outputstream, indent); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, indent); if (!dontCloseNode) writeOut(outputstream, "</"+nodeNameString+">"); } } else { if (dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) writeOut(outputstream, ">"); } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
| 11,461
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) nodeNameString = sXDFRootNodeName; writeOut(outputstream,"<" + nodeNameString); // print opening statement } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { int size = attribs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if ((sPrettyXDFOutput) && (pcdata == null)) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list int size = childObjs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName and close the node if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent + sPrettyXDFOutputIndentation); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { indent = dealWithClosingGroupNodes((BaseObject) this, outputstream, indent); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, indent); if (!dontCloseNode) writeOut(outputstream, "</"+nodeNameString+">"); } } else { if (dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) writeOut(outputstream, ">"); } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) nodeNameString = sXDFRootNodeName; writeOut(outputstream,"<" + nodeNameString); // print opening statement } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { int size = attribs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if ((sPrettyXDFOutput) && (pcdata == null)) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list int size = childObjs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName and close the node if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent + sPrettyXDFOutputIndentation); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { indent = dealWithClosingGroupNodes((BaseObject) this, outputstream, indent); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, indent); if (!dontCloseNode) writeOut(outputstream, "</"+nodeNameString+">"); } } else { if (dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) writeOut(outputstream, ">"); } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
| 11,462
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) nodeNameString = sXDFRootNodeName; writeOut(outputstream,"<" + nodeNameString); // print opening statement } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { int size = attribs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if ((sPrettyXDFOutput) && (pcdata == null)) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list int size = childObjs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName and close the node if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent + sPrettyXDFOutputIndentation); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { indent = dealWithClosingGroupNodes((BaseObject) this, outputstream, indent); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, indent); if (!dontCloseNode) writeOut(outputstream, "</"+nodeNameString+">"); } } else { if (dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) writeOut(outputstream, ">"); } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) nodeNameString = sXDFRootNodeName; writeOut(outputstream,"<" + nodeNameString); // print opening statement } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { int size = attribs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if ((sPrettyXDFOutput) && (pcdata == null)) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list int size = childObjs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName and close the node if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent + sPrettyXDFOutputIndentation); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { indent = dealWithClosingGroupNodes((BaseObject) this, outputstream, indent); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, indent); if (!dontCloseNode) writeOut(outputstream, "</"+nodeNameString+">"); } } else { if (dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) writeOut(outputstream, ">"); } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
| 11,463
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) nodeNameString = sXDFRootNodeName; writeOut(outputstream,"<" + nodeNameString); // print opening statement } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { int size = attribs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if ((sPrettyXDFOutput) && (pcdata == null)) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list int size = childObjs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName and close the node if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent + sPrettyXDFOutputIndentation); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { indent = dealWithClosingGroupNodes((BaseObject) this, outputstream, indent); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, indent); if (!dontCloseNode) writeOut(outputstream, "</"+nodeNameString+">"); } } else { if (dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) writeOut(outputstream, ">"); } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) nodeNameString = sXDFRootNodeName; writeOut(outputstream,"<" + nodeNameString); // print opening statement } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { int size = attribs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if ((sPrettyXDFOutput) && (pcdata == null)) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list int size = childObjs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName and close the node if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent + sPrettyXDFOutputIndentation); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { indent = dealWithClosingGroupNodes((BaseObject) this, outputstream, indent); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, indent); if (!dontCloseNode) writeOut(outputstream, "</"+nodeNameString+">"); } } else { if (dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) writeOut(outputstream, ">"); } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
| 11,464
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) nodeNameString = sXDFRootNodeName; writeOut(outputstream,"<" + nodeNameString); // print opening statement } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { int size = attribs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if ((sPrettyXDFOutput) && (pcdata == null)) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list int size = childObjs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName and close the node if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent + sPrettyXDFOutputIndentation); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { indent = dealWithClosingGroupNodes((BaseObject) this, outputstream, indent); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, indent); if (!dontCloseNode) writeOut(outputstream, "</"+nodeNameString+">"); } } else { if (dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) writeOut(outputstream, ">"); } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) nodeNameString = sXDFRootNodeName; writeOut(outputstream,"<" + nodeNameString); // print opening statement } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { int size = attribs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if ((sPrettyXDFOutput) && (pcdata == null)) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list int size = childObjs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName and close the node if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent + sPrettyXDFOutputIndentation); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { indent = dealWithClosingGroupNodes((BaseObject) this, outputstream, indent); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, indent); if (!dontCloseNode) writeOut(outputstream, "</"+nodeNameString+">"); } } else { if (dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) writeOut(outputstream, ">"); } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
| 11,465
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) nodeNameString = sXDFRootNodeName; writeOut(outputstream,"<" + nodeNameString); // print opening statement } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { int size = attribs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if ((sPrettyXDFOutput) && (pcdata == null)) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list int size = childObjs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName and close the node if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent + sPrettyXDFOutputIndentation); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { indent = dealWithClosingGroupNodes((BaseObject) this, outputstream, indent); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, indent); if (!dontCloseNode) writeOut(outputstream, "</"+nodeNameString+">"); } } else { if (dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) writeOut(outputstream, ">"); } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) nodeNameString = sXDFRootNodeName; writeOut(outputstream,"<" + nodeNameString); // print opening statement } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { int size = attribs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if ((sPrettyXDFOutput) && (pcdata == null)) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list int size = childObjs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName and close the node if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent + sPrettyXDFOutputIndentation); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { indent = dealWithClosingGroupNodes((BaseObject) this, outputstream, indent); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, indent); if (!dontCloseNode) writeOut(outputstream, "</"+nodeNameString+">"); } } else { if (dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) writeOut(outputstream, ">"); } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
| 11,466
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) nodeNameString = sXDFRootNodeName; writeOut(outputstream,"<" + nodeNameString); // print opening statement } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { int size = attribs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if ((sPrettyXDFOutput) && (pcdata == null)) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list int size = childObjs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName and close the node if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent + sPrettyXDFOutputIndentation); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { indent = dealWithClosingGroupNodes((BaseObject) this, outputstream, indent); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, indent); if (!dontCloseNode) writeOut(outputstream, "</"+nodeNameString+">"); } } else { if (dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) writeOut(outputstream, ">"); } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) nodeNameString = sXDFRootNodeName; writeOut(outputstream,"<" + nodeNameString); // print opening statement } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { int size = attribs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if ((sPrettyXDFOutput) && (pcdata == null)) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list int size = childObjs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName and close the node if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent + sPrettyXDFOutputIndentation); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { indent = dealWithClosingGroupNodes((BaseObject) this, outputstream, indent); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, indent); if (!dontCloseNode) writeOut(outputstream, "</"+nodeNameString+">"); } } else { if (dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) writeOut(outputstream, ">"); } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
| 11,467
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) nodeNameString = sXDFRootNodeName; writeOut(outputstream,"<" + nodeNameString); // print opening statement } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { int size = attribs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if ((sPrettyXDFOutput) && (pcdata == null)) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list int size = childObjs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName and close the node if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent + sPrettyXDFOutputIndentation); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { indent = dealWithClosingGroupNodes((BaseObject) this, outputstream, indent); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, indent); if (!dontCloseNode) writeOut(outputstream, "</"+nodeNameString+">"); } } else { if (dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) writeOut(outputstream, ">"); } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) nodeNameString = sXDFRootNodeName; writeOut(outputstream,"<" + nodeNameString); // print opening statement } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { int size = attribs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if ((sPrettyXDFOutput) && (pcdata == null)) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list int size = childObjs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + Specification.getInstance().getPrettyXDFOutputIndentation(); containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + Specification.getInstance().getPrettyXDFOutputIndentation(); containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName and close the node if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent + sPrettyXDFOutputIndentation); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { indent = dealWithClosingGroupNodes((BaseObject) this, outputstream, indent); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, indent); if (!dontCloseNode) writeOut(outputstream, "</"+nodeNameString+">"); } } else { if (dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) writeOut(outputstream, ">"); } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
| 11,468
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) nodeNameString = sXDFRootNodeName; writeOut(outputstream,"<" + nodeNameString); // print opening statement } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { int size = attribs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if ((sPrettyXDFOutput) && (pcdata == null)) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list int size = childObjs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName and close the node if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent + sPrettyXDFOutputIndentation); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { indent = dealWithClosingGroupNodes((BaseObject) this, outputstream, indent); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, indent); if (!dontCloseNode) writeOut(outputstream, "</"+nodeNameString+">"); } } else { if (dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) writeOut(outputstream, ">"); } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) nodeNameString = sXDFRootNodeName; writeOut(outputstream,"<" + nodeNameString); // print opening statement } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { int size = attribs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if ((sPrettyXDFOutput) && (pcdata == null)) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list int size = childObjs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } } if(pcdata != null) { writeOut(outputstream, pcdata); }; if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName and close the node if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent + sPrettyXDFOutputIndentation); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { indent = dealWithClosingGroupNodes((BaseObject) this, outputstream, indent); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, indent); if (!dontCloseNode) writeOut(outputstream, "</"+nodeNameString+">"); } } else { if (dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) writeOut(outputstream, ">"); } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
| 11,469
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) nodeNameString = sXDFRootNodeName; writeOut(outputstream,"<" + nodeNameString); // print opening statement } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { int size = attribs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if ((sPrettyXDFOutput) && (pcdata == null)) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list int size = childObjs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName and close the node if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent + sPrettyXDFOutputIndentation); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { indent = dealWithClosingGroupNodes((BaseObject) this, outputstream, indent); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, indent); if (!dontCloseNode) writeOut(outputstream, "</"+nodeNameString+">"); } } else { if (dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) writeOut(outputstream, ">"); } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) nodeNameString = sXDFRootNodeName; writeOut(outputstream,"<" + nodeNameString); // print opening statement } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { int size = attribs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if ((sPrettyXDFOutput) && (pcdata == null)) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list int size = childObjs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName and close the node if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent + sPrettyXDFOutputIndentation); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { indent = dealWithClosingGroupNodes((BaseObject) this, outputstream, indent); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, indent); if (!dontCloseNode) writeOut(outputstream, "</"+nodeNameString+">"); } } else { if (dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) writeOut(outputstream, ">"); } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
| 11,470
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) nodeNameString = sXDFRootNodeName; writeOut(outputstream,"<" + nodeNameString); // print opening statement } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { int size = attribs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if ((sPrettyXDFOutput) && (pcdata == null)) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list int size = childObjs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName and close the node if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent + sPrettyXDFOutputIndentation); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { indent = dealWithClosingGroupNodes((BaseObject) this, outputstream, indent); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, indent); if (!dontCloseNode) writeOut(outputstream, "</"+nodeNameString+">"); } } else { if (dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) writeOut(outputstream, ">"); } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) nodeNameString = sXDFRootNodeName; writeOut(outputstream,"<" + nodeNameString); // print opening statement } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { int size = attribs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if ((sPrettyXDFOutput) && (pcdata == null)) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list int size = childObjs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? writeOut(outputstream, "/>"); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName and close the node if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent + sPrettyXDFOutputIndentation); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { indent = dealWithClosingGroupNodes((BaseObject) this, outputstream, indent); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, indent); if (!dontCloseNode) writeOut(outputstream, "</"+nodeNameString+">"); } } else { if (dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) writeOut(outputstream, ">"); } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
| 11,471
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) nodeNameString = sXDFRootNodeName; writeOut(outputstream,"<" + nodeNameString); // print opening statement } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { int size = attribs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if ((sPrettyXDFOutput) && (pcdata == null)) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list int size = childObjs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName and close the node if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent + sPrettyXDFOutputIndentation); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { indent = dealWithClosingGroupNodes((BaseObject) this, outputstream, indent); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, indent); if (!dontCloseNode) writeOut(outputstream, "</"+nodeNameString+">"); } } else { if (dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) writeOut(outputstream, ">"); } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) nodeNameString = sXDFRootNodeName; writeOut(outputstream,"<" + nodeNameString); // print opening statement } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { int size = attribs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if ((sPrettyXDFOutput) && (pcdata == null)) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list int size = childObjs.size(); for (int i = 0; i < size; i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { indent = dealWithOpeningGroupNodes(containedObj, outputstream, indent); indent = dealWithClosingGroupNodes(containedObj, outputstream, indent); String newindent = indent + sPrettyXDFOutputIndentation; containedObj.toXMLOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName and close the node if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent + sPrettyXDFOutputIndentation); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { indent = dealWithClosingGroupNodes((BaseObject) this, outputstream, indent); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, indent); if (!dontCloseNode) writeOut(outputstream, "</"+nodeNameString+">"); } } else { if (dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) writeOut(outputstream, ">"); } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
| 11,472
|
private void writeXMLDeclToOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs ) { // initial statement writeOut(outputstream, "<?xml"); writeOut(outputstream, " version=\"" + sXMLSpecVersion + "\""); // print attributes Enumeration keys = XMLDeclAttribs.keys(); while ( keys.hasMoreElements() ) { String attribName = (String) keys.nextElement(); if (attribName.equals("version") ) { Log.errorln("XMLDeclAttrib hash has version attribute, not allowed and ignoring."); } else if ( attribName.equals("dtdName") || attribName.equals("rootName") ) { // skip over it } else writeOut(outputstream, " " + attribName + "=\"" + XMLDeclAttribs.get(attribName) + "\""); } writeOut(outputstream, " ?>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); // Print the DOCTYPE DECL only if right info exists if (XMLDeclAttribs.containsKey("rootName") && XMLDeclAttribs.containsKey("dtdName")) { // print the DOCTYPE DECL IF its a structure node if(classXDFNodeName != null && classXDFNodeName.equals(sXDFStructureNodeName) ) { writeOut(outputstream, "<!DOCTYPE " + XMLDeclAttribs.get("rootName") + " SYSTEM \"" + XMLDeclAttribs.get("dtdName") + "\">"); } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } else Log.errorln("Passed XMLDeclAttributes table lacks either dtdName, rootName entries, ignoring DOCTYPE line printout"); }
|
private void writeXMLDeclToOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs ) { // initial statement writeOut(outputstream, "<?xml"); writeOut(outputstream, " version=\"" + Specification.getInstance().getXMLSpecVersion() + "\""); // print attributes Enumeration keys = XMLDeclAttribs.keys(); while ( keys.hasMoreElements() ) { String attribName = (String) keys.nextElement(); if (attribName.equals("version") ) { Log.errorln("XMLDeclAttrib hash has version attribute, not allowed and ignoring."); } else if ( attribName.equals("dtdName") || attribName.equals("rootName") ) { // skip over it } else writeOut(outputstream, " " + attribName + "=\"" + XMLDeclAttribs.get(attribName) + "\""); } writeOut(outputstream, " ?>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); // Print the DOCTYPE DECL only if right info exists if (XMLDeclAttribs.containsKey("rootName") && XMLDeclAttribs.containsKey("dtdName")) { // print the DOCTYPE DECL IF its a structure node if(classXDFNodeName != null && classXDFNodeName.equals(sXDFStructureNodeName) ) { writeOut(outputstream, "<!DOCTYPE " + XMLDeclAttribs.get("rootName") + " SYSTEM \"" + XMLDeclAttribs.get("dtdName") + "\">"); } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } else Log.errorln("Passed XMLDeclAttributes table lacks either dtdName, rootName entries, ignoring DOCTYPE line printout"); }
| 11,473
|
private void writeXMLDeclToOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs ) { // initial statement writeOut(outputstream, "<?xml"); writeOut(outputstream, " version=\"" + sXMLSpecVersion + "\""); // print attributes Enumeration keys = XMLDeclAttribs.keys(); while ( keys.hasMoreElements() ) { String attribName = (String) keys.nextElement(); if (attribName.equals("version") ) { Log.errorln("XMLDeclAttrib hash has version attribute, not allowed and ignoring."); } else if ( attribName.equals("dtdName") || attribName.equals("rootName") ) { // skip over it } else writeOut(outputstream, " " + attribName + "=\"" + XMLDeclAttribs.get(attribName) + "\""); } writeOut(outputstream, " ?>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); // Print the DOCTYPE DECL only if right info exists if (XMLDeclAttribs.containsKey("rootName") && XMLDeclAttribs.containsKey("dtdName")) { // print the DOCTYPE DECL IF its a structure node if(classXDFNodeName != null && classXDFNodeName.equals(sXDFStructureNodeName) ) { writeOut(outputstream, "<!DOCTYPE " + XMLDeclAttribs.get("rootName") + " SYSTEM \"" + XMLDeclAttribs.get("dtdName") + "\">"); } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } else Log.errorln("Passed XMLDeclAttributes table lacks either dtdName, rootName entries, ignoring DOCTYPE line printout"); }
|
private void writeXMLDeclToOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs ) { // initial statement writeOut(outputstream, "<?xml"); writeOut(outputstream, " version=\"" + sXMLSpecVersion + "\""); // print attributes Enumeration keys = XMLDeclAttribs.keys(); while ( keys.hasMoreElements() ) { String attribName = (String) keys.nextElement(); if (attribName.equals("version") ) { Log.errorln("XMLDeclAttrib hash has version attribute, not allowed and ignoring."); } else if ( attribName.equals("dtdName") || attribName.equals("rootName") ) { // skip over it } else writeOut(outputstream, " " + attribName + "=\"" + XMLDeclAttribs.get(attribName) + "\""); } writeOut(outputstream, " ?>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); // Print the DOCTYPE DECL only if right info exists if (XMLDeclAttribs.containsKey("rootName") && XMLDeclAttribs.containsKey("dtdName")) { // print the DOCTYPE DECL IF its a structure node if(classXDFNodeName != null && classXDFNodeName.equals(sXDFStructureNodeName) ) { writeOut(outputstream, "<!DOCTYPE " + XMLDeclAttribs.get("rootName") + " SYSTEM \"" + XMLDeclAttribs.get("dtdName") + "\">"); } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } else Log.errorln("Passed XMLDeclAttributes table lacks either dtdName, rootName entries, ignoring DOCTYPE line printout"); }
| 11,474
|
private void writeXMLDeclToOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs ) { // initial statement writeOut(outputstream, "<?xml"); writeOut(outputstream, " version=\"" + sXMLSpecVersion + "\""); // print attributes Enumeration keys = XMLDeclAttribs.keys(); while ( keys.hasMoreElements() ) { String attribName = (String) keys.nextElement(); if (attribName.equals("version") ) { Log.errorln("XMLDeclAttrib hash has version attribute, not allowed and ignoring."); } else if ( attribName.equals("dtdName") || attribName.equals("rootName") ) { // skip over it } else writeOut(outputstream, " " + attribName + "=\"" + XMLDeclAttribs.get(attribName) + "\""); } writeOut(outputstream, " ?>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); // Print the DOCTYPE DECL only if right info exists if (XMLDeclAttribs.containsKey("rootName") && XMLDeclAttribs.containsKey("dtdName")) { // print the DOCTYPE DECL IF its a structure node if(classXDFNodeName != null && classXDFNodeName.equals(sXDFStructureNodeName) ) { writeOut(outputstream, "<!DOCTYPE " + XMLDeclAttribs.get("rootName") + " SYSTEM \"" + XMLDeclAttribs.get("dtdName") + "\">"); } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } else Log.errorln("Passed XMLDeclAttributes table lacks either dtdName, rootName entries, ignoring DOCTYPE line printout"); }
|
private void writeXMLDeclToOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs ) { // initial statement writeOut(outputstream, "<?xml"); writeOut(outputstream, " version=\"" + sXMLSpecVersion + "\""); // print attributes Enumeration keys = XMLDeclAttribs.keys(); while ( keys.hasMoreElements() ) { String attribName = (String) keys.nextElement(); if (attribName.equals("version") ) { Log.errorln("XMLDeclAttrib hash has version attribute, not allowed and ignoring."); } else if ( attribName.equals("dtdName") || attribName.equals("rootName") ) { // skip over it } else writeOut(outputstream, " " + attribName + "=\"" + XMLDeclAttribs.get(attribName) + "\""); } writeOut(outputstream, " ?>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); // Print the DOCTYPE DECL only if right info exists if (XMLDeclAttribs.containsKey("rootName") && XMLDeclAttribs.containsKey("dtdName")) { // print the DOCTYPE DECL IF its a structure node if(classXDFNodeName != null && classXDFNodeName.equals(sXDFStructureNodeName) ) { writeOut(outputstream, "<!DOCTYPE " + XMLDeclAttribs.get("rootName") + " SYSTEM \"" + XMLDeclAttribs.get("dtdName") + "\">"); } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } else Log.errorln("Passed XMLDeclAttributes table lacks either dtdName, rootName entries, ignoring DOCTYPE line printout"); }
| 11,475
|
private void writeXMLDeclToOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs ) { // initial statement writeOut(outputstream, "<?xml"); writeOut(outputstream, " version=\"" + sXMLSpecVersion + "\""); // print attributes Enumeration keys = XMLDeclAttribs.keys(); while ( keys.hasMoreElements() ) { String attribName = (String) keys.nextElement(); if (attribName.equals("version") ) { Log.errorln("XMLDeclAttrib hash has version attribute, not allowed and ignoring."); } else if ( attribName.equals("dtdName") || attribName.equals("rootName") ) { // skip over it } else writeOut(outputstream, " " + attribName + "=\"" + XMLDeclAttribs.get(attribName) + "\""); } writeOut(outputstream, " ?>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); // Print the DOCTYPE DECL only if right info exists if (XMLDeclAttribs.containsKey("rootName") && XMLDeclAttribs.containsKey("dtdName")) { // print the DOCTYPE DECL IF its a structure node if(classXDFNodeName != null && classXDFNodeName.equals(sXDFStructureNodeName) ) { writeOut(outputstream, "<!DOCTYPE " + XMLDeclAttribs.get("rootName") + " SYSTEM \"" + XMLDeclAttribs.get("dtdName") + "\">"); } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } else Log.errorln("Passed XMLDeclAttributes table lacks either dtdName, rootName entries, ignoring DOCTYPE line printout"); }
|
private void writeXMLDeclToOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs ) { // initial statement writeOut(outputstream, "<?xml"); writeOut(outputstream, " version=\"" + sXMLSpecVersion + "\""); // print attributes Enumeration keys = XMLDeclAttribs.keys(); while ( keys.hasMoreElements() ) { String attribName = (String) keys.nextElement(); if (attribName.equals("version") ) { Log.errorln("XMLDeclAttrib hash has version attribute, not allowed and ignoring."); } else if ( attribName.equals("dtdName") || attribName.equals("rootName") ) { // skip over it } else writeOut(outputstream, " " + attribName + "=\"" + XMLDeclAttribs.get(attribName) + "\""); } writeOut(outputstream, " ?>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); // Print the DOCTYPE DECL only if right info exists if (XMLDeclAttribs.containsKey("rootName") && XMLDeclAttribs.containsKey("dtdName")) { // print the DOCTYPE DECL IF its a structure node if(classXDFNodeName != null && classXDFNodeName.equals(sXDFStructureNodeName) ) { writeOut(outputstream, "<!DOCTYPE " + XMLDeclAttribs.get("rootName") + " SYSTEM \"" + XMLDeclAttribs.get("dtdName") + "\">"); } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } else Log.errorln("Passed XMLDeclAttributes table lacks either dtdName, rootName entries, ignoring DOCTYPE line printout"); }
| 11,476
|
private void writeXMLDeclToOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs ) { // initial statement writeOut(outputstream, "<?xml"); writeOut(outputstream, " version=\"" + sXMLSpecVersion + "\""); // print attributes Enumeration keys = XMLDeclAttribs.keys(); while ( keys.hasMoreElements() ) { String attribName = (String) keys.nextElement(); if (attribName.equals("version") ) { Log.errorln("XMLDeclAttrib hash has version attribute, not allowed and ignoring."); } else if ( attribName.equals("dtdName") || attribName.equals("rootName") ) { // skip over it } else writeOut(outputstream, " " + attribName + "=\"" + XMLDeclAttribs.get(attribName) + "\""); } writeOut(outputstream, " ?>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); // Print the DOCTYPE DECL only if right info exists if (XMLDeclAttribs.containsKey("rootName") && XMLDeclAttribs.containsKey("dtdName")) { // print the DOCTYPE DECL IF its a structure node if(classXDFNodeName != null && classXDFNodeName.equals(sXDFStructureNodeName) ) { writeOut(outputstream, "<!DOCTYPE " + XMLDeclAttribs.get("rootName") + " SYSTEM \"" + XMLDeclAttribs.get("dtdName") + "\">"); } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } else Log.errorln("Passed XMLDeclAttributes table lacks either dtdName, rootName entries, ignoring DOCTYPE line printout"); }
|
private void writeXMLDeclToOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs ) { // initial statement writeOut(outputstream, "<?xml"); writeOut(outputstream, " version=\"" + sXMLSpecVersion + "\""); // print attributes Enumeration keys = XMLDeclAttribs.keys(); while ( keys.hasMoreElements() ) { String attribName = (String) keys.nextElement(); if (attribName.equals("version") ) { Log.errorln("XMLDeclAttrib hash has version attribute, not allowed and ignoring."); } else if ( attribName.equals("dtdName") || attribName.equals("rootName") ) { // skip over it } else writeOut(outputstream, " " + attribName + "=\"" + XMLDeclAttribs.get(attribName) + "\""); } writeOut(outputstream, " ?>"); if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); // Print the DOCTYPE DECL only if right info exists if (XMLDeclAttribs.containsKey("rootName") && XMLDeclAttribs.containsKey("dtdName")) { // print the DOCTYPE DECL IF its a structure node if(classXDFNodeName != null && classXDFNodeName.equals(sXDFStructureNodeName) ) { writeOut(outputstream, "<!DOCTYPE " + XMLDeclAttribs.get("rootName") + " SYSTEM \"" + XMLDeclAttribs.get("dtdName") + "\">"); } if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); } else Log.errorln("Passed XMLDeclAttributes table lacks either dtdName, rootName entries, ignoring DOCTYPE line printout"); }
| 11,477
|
private void writeXMLDeclToOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs ) { // initial statement writeOut(outputstream, "<?xml"); writeOut(outputstream, " version=\"" + sXMLSpecVersion + "\""); // print attributes Enumeration keys = XMLDeclAttribs.keys(); while ( keys.hasMoreElements() ) { String attribName = (String) keys.nextElement(); if (attribName.equals("version") ) { Log.errorln("XMLDeclAttrib hash has version attribute, not allowed and ignoring."); } else if ( attribName.equals("dtdName") || attribName.equals("rootName") ) { // skip over it } else writeOut(outputstream, " " + attribName + "=\"" + XMLDeclAttribs.get(attribName) + "\""); } writeOut(outputstream, " ?>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); // Print the DOCTYPE DECL only if right info exists if (XMLDeclAttribs.containsKey("rootName") && XMLDeclAttribs.containsKey("dtdName")) { // print the DOCTYPE DECL IF its a structure node if(classXDFNodeName != null && classXDFNodeName.equals(sXDFStructureNodeName) ) { writeOut(outputstream, "<!DOCTYPE " + XMLDeclAttribs.get("rootName") + " SYSTEM \"" + XMLDeclAttribs.get("dtdName") + "\">"); } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } else Log.errorln("Passed XMLDeclAttributes table lacks either dtdName, rootName entries, ignoring DOCTYPE line printout"); }
|
private void writeXMLDeclToOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs ) { // initial statement writeOut(outputstream, "<?xml"); writeOut(outputstream, " version=\"" + sXMLSpecVersion + "\""); // print attributes Enumeration keys = XMLDeclAttribs.keys(); while ( keys.hasMoreElements() ) { String attribName = (String) keys.nextElement(); if (attribName.equals("version") ) { Log.errorln("XMLDeclAttrib hash has version attribute, not allowed and ignoring."); } else if ( attribName.equals("dtdName") || attribName.equals("rootName") ) { // skip over it } else writeOut(outputstream, " " + attribName + "=\"" + XMLDeclAttribs.get(attribName) + "\""); } writeOut(outputstream, " ?>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); // Print the DOCTYPE DECL only if right info exists if (XMLDeclAttribs.containsKey("rootName") && XMLDeclAttribs.containsKey("dtdName")) { // print the DOCTYPE DECL IF its a structure node if(classXDFNodeName != null && classXDFNodeName.equals(sXDFStructureNodeName) ) { writeOut(outputstream, "<!DOCTYPE " + XMLDeclAttribs.get("rootName") + " SYSTEM \"" + XMLDeclAttribs.get("dtdName") + "\">"); } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } else Log.errorln("Passed XMLDeclAttributes table lacks either dtdName, rootName entries, ignoring DOCTYPE line printout"); }
| 11,478
|
private void writeXMLDeclToOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs ) { // initial statement writeOut(outputstream, "<?xml"); writeOut(outputstream, " version=\"" + sXMLSpecVersion + "\""); // print attributes Enumeration keys = XMLDeclAttribs.keys(); while ( keys.hasMoreElements() ) { String attribName = (String) keys.nextElement(); if (attribName.equals("version") ) { Log.errorln("XMLDeclAttrib hash has version attribute, not allowed and ignoring."); } else if ( attribName.equals("dtdName") || attribName.equals("rootName") ) { // skip over it } else writeOut(outputstream, " " + attribName + "=\"" + XMLDeclAttribs.get(attribName) + "\""); } writeOut(outputstream, " ?>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); // Print the DOCTYPE DECL only if right info exists if (XMLDeclAttribs.containsKey("rootName") && XMLDeclAttribs.containsKey("dtdName")) { // print the DOCTYPE DECL IF its a structure node if(classXDFNodeName != null && classXDFNodeName.equals(sXDFStructureNodeName) ) { writeOut(outputstream, "<!DOCTYPE " + XMLDeclAttribs.get("rootName") + " SYSTEM \"" + XMLDeclAttribs.get("dtdName") + "\">"); } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } else Log.errorln("Passed XMLDeclAttributes table lacks either dtdName, rootName entries, ignoring DOCTYPE line printout"); }
|
private void writeXMLDeclToOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs ) { // initial statement writeOut(outputstream, "<?xml"); writeOut(outputstream, " version=\"" + sXMLSpecVersion + "\""); // print attributes Enumeration keys = XMLDeclAttribs.keys(); while ( keys.hasMoreElements() ) { String attribName = (String) keys.nextElement(); if (attribName.equals("version") ) { Log.errorln("XMLDeclAttrib hash has version attribute, not allowed and ignoring."); } else if ( attribName.equals("dtdName") || attribName.equals("rootName") ) { // skip over it } else writeOut(outputstream, " " + attribName + "=\"" + XMLDeclAttribs.get(attribName) + "\""); } writeOut(outputstream, " ?>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); // Print the DOCTYPE DECL only if right info exists if (XMLDeclAttribs.containsKey("rootName") && XMLDeclAttribs.containsKey("dtdName")) { // print the DOCTYPE DECL IF its a structure node if(classXDFNodeName != null && classXDFNodeName.equals(sXDFStructureNodeName) ) { writeOut(outputstream, "<!DOCTYPE " + XMLDeclAttribs.get("rootName") + " SYSTEM \"" + XMLDeclAttribs.get("dtdName") + "\">"); } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } else Log.errorln("Passed XMLDeclAttributes table lacks either dtdName, rootName entries, ignoring DOCTYPE line printout"); }
| 11,479
|
My5250 () { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch(Exception e) { } frame = new Gui5250Frame(this); loadSessions(); int width = 600; int height = 500; if (sessions.containsKey("emul.width")) width = Integer.parseInt(sessions.getProperty("emul.width")); if (sessions.containsKey("emul.height")) height = Integer.parseInt(sessions.getProperty("emul.height")); frame.setSize(width,height); centerFrame(); frame.sessionPane.addChangeListener(this); focused = createImageIcon("focused.gif"); unfocused = createImageIcon("unfocused.gif"); ImageIcon tnicon = createImageIcon("tnicon.jpg"); frame.setIconImage(tnicon.getImage()); sessionsV = new Vector(); setDefaultLocale(); manager = new SessionManager(); manager.setController(this); }
|
My5250 () { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch(Exception e) { } loadSessions(); int width = 600; int height = 500; if (sessions.containsKey("emul.width")) width = Integer.parseInt(sessions.getProperty("emul.width")); if (sessions.containsKey("emul.height")) height = Integer.parseInt(sessions.getProperty("emul.height")); frame.setSize(width,height); centerFrame(); frame.sessionPane.addChangeListener(this); focused = createImageIcon("focused.gif"); unfocused = createImageIcon("unfocused.gif"); ImageIcon tnicon = createImageIcon("tnicon.jpg"); frame.setIconImage(tnicon.getImage()); sessionsV = new Vector(); setDefaultLocale(); manager = new SessionManager(); manager.setController(this); }
| 11,480
|
My5250 () { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch(Exception e) { } frame = new Gui5250Frame(this); loadSessions(); int width = 600; int height = 500; if (sessions.containsKey("emul.width")) width = Integer.parseInt(sessions.getProperty("emul.width")); if (sessions.containsKey("emul.height")) height = Integer.parseInt(sessions.getProperty("emul.height")); frame.setSize(width,height); centerFrame(); frame.sessionPane.addChangeListener(this); focused = createImageIcon("focused.gif"); unfocused = createImageIcon("unfocused.gif"); ImageIcon tnicon = createImageIcon("tnicon.jpg"); frame.setIconImage(tnicon.getImage()); sessionsV = new Vector(); setDefaultLocale(); manager = new SessionManager(); manager.setController(this); }
|
My5250 () { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch(Exception e) { } frame = new Gui5250Frame(this); loadSessions(); int width = 600; int height = 500; if (sessions.containsKey("emul.width")) width = Integer.parseInt(sessions.getProperty("emul.width")); if (sessions.containsKey("emul.height")) height = Integer.parseInt(sessions.getProperty("emul.height")); frame.setSize(width,height); centerFrame(); frame.sessionPane.addChangeListener(this); focused = createImageIcon("focused.gif"); unfocused = createImageIcon("unfocused.gif"); ImageIcon tnicon = createImageIcon("tnicon.jpg"); frame.setIconImage(tnicon.getImage()); sessionsV = new Vector(); setDefaultLocale(); manager = new SessionManager(); manager.setController(this); }
| 11,481
|
My5250 () { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch(Exception e) { } frame = new Gui5250Frame(this); loadSessions(); int width = 600; int height = 500; if (sessions.containsKey("emul.width")) width = Integer.parseInt(sessions.getProperty("emul.width")); if (sessions.containsKey("emul.height")) height = Integer.parseInt(sessions.getProperty("emul.height")); frame.setSize(width,height); centerFrame(); frame.sessionPane.addChangeListener(this); focused = createImageIcon("focused.gif"); unfocused = createImageIcon("unfocused.gif"); ImageIcon tnicon = createImageIcon("tnicon.jpg"); frame.setIconImage(tnicon.getImage()); sessionsV = new Vector(); setDefaultLocale(); manager = new SessionManager(); manager.setController(this); }
|
My5250 () { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch(Exception e) { } frame = new Gui5250Frame(this); loadSessions(); int width = 600; int height = 500; if (sessions.containsKey("emul.width")) width = Integer.parseInt(sessions.getProperty("emul.width")); if (sessions.containsKey("emul.height")) height = Integer.parseInt(sessions.getProperty("emul.height")); frame.setSize(width,height); centerFrame(); frame.sessionPane.addChangeListener(this); focused = createImageIcon("focused.gif"); unfocused = createImageIcon("unfocused.gif"); ImageIcon tnicon = createImageIcon("tnicon.jpg"); frame.setIconImage(tnicon.getImage()); sessionsV = new Vector(); setDefaultLocale(); manager = new SessionManager(); manager.setController(this); }
| 11,482
|
protected void closeSession(Session targetSession) { int tabs = frame.sessionPane.getTabCount(); Sessions sessions = manager.getSessions(); Session session = null; if (tabs > 1) { if ((sessions.item(targetSession)) != null) { int index = frame.sessionPane.indexOfComponent(targetSession); System.out.println("session found and closing down " + index); frame.sessionPane.remove(index); manager.closeSession(targetSession); targetSession = null; if (index < (tabs - 2)) { frame.sessionPane.setSelectedIndex(index); frame.sessionPane.setForegroundAt(index,Color.blue); frame.sessionPane.setIconAt(index,focused); } else { frame.sessionPane.setSelectedIndex(0); frame.sessionPane.setForegroundAt(0,Color.blue); frame.sessionPane.setIconAt(0,focused); } } } else { closingDown(frame); } }
|
protected void closeSession(Session targetSession) { Gui5250Frame f = getParentView(targetSession); int tabs = f.getSessionViewCount(); Sessions sessions = manager.getSessions(); Session session = null; if (tabs > 1) { if ((sessions.item(targetSession)) != null) { int index = frame.sessionPane.indexOfComponent(targetSession); System.out.println("session found and closing down " + index); frame.sessionPane.remove(index); manager.closeSession(targetSession); targetSession = null; if (index < (tabs - 2)) { frame.sessionPane.setSelectedIndex(index); frame.sessionPane.setForegroundAt(index,Color.blue); frame.sessionPane.setIconAt(index,focused); } else { frame.sessionPane.setSelectedIndex(0); frame.sessionPane.setForegroundAt(0,Color.blue); frame.sessionPane.setIconAt(0,focused); } } } else { closingDown(frame); } }
| 11,484
|
protected void closeSession(Session targetSession) { int tabs = frame.sessionPane.getTabCount(); Sessions sessions = manager.getSessions(); Session session = null; if (tabs > 1) { if ((sessions.item(targetSession)) != null) { int index = frame.sessionPane.indexOfComponent(targetSession); System.out.println("session found and closing down " + index); frame.sessionPane.remove(index); manager.closeSession(targetSession); targetSession = null; if (index < (tabs - 2)) { frame.sessionPane.setSelectedIndex(index); frame.sessionPane.setForegroundAt(index,Color.blue); frame.sessionPane.setIconAt(index,focused); } else { frame.sessionPane.setSelectedIndex(0); frame.sessionPane.setForegroundAt(0,Color.blue); frame.sessionPane.setIconAt(0,focused); } } } else { closingDown(frame); } }
|
protected void closeSession(Session targetSession) { int tabs = frame.sessionPane.getTabCount(); Sessions sessions = manager.getSessions(); Session session = null; if (tabs > 1) { if ((sessions.item(targetSession)) != null) { int index = frame.sessionPane.indexOfComponent(targetSession); System.out.println("session found and closing down " + index); frame.sessionPane.remove(index); manager.closeSession(targetSession); targetSession = null; if (index < (tabs - 2)) { frame.sessionPane.setSelectedIndex(index); frame.sessionPane.setForegroundAt(index,Color.blue); frame.sessionPane.setIconAt(index,focused); } else { frame.sessionPane.setSelectedIndex(0); frame.sessionPane.setForegroundAt(0,Color.blue); frame.sessionPane.setIconAt(0,focused); } } } else { closingDown(frame); } }
| 11,485
|
protected void closeSession(Session targetSession) { int tabs = frame.sessionPane.getTabCount(); Sessions sessions = manager.getSessions(); Session session = null; if (tabs > 1) { if ((sessions.item(targetSession)) != null) { int index = frame.sessionPane.indexOfComponent(targetSession); System.out.println("session found and closing down " + index); frame.sessionPane.remove(index); manager.closeSession(targetSession); targetSession = null; if (index < (tabs - 2)) { frame.sessionPane.setSelectedIndex(index); frame.sessionPane.setForegroundAt(index,Color.blue); frame.sessionPane.setIconAt(index,focused); } else { frame.sessionPane.setSelectedIndex(0); frame.sessionPane.setForegroundAt(0,Color.blue); frame.sessionPane.setIconAt(0,focused); } } } else { closingDown(frame); } }
|
protected void closeSession(Session targetSession) { int tabs = frame.sessionPane.getTabCount(); Sessions sessions = manager.getSessions(); Session session = null; if (tabs > 1) { if ((sessions.item(targetSession)) != null) { int index = frame.sessionPane.indexOfComponent(targetSession); System.out.println("session found and closing down " + index); frame.sessionPane.remove(index); manager.closeSession(targetSession); targetSession = null; if (index < (tabs - 2)) { frame.sessionPane.setSelectedIndex(index); frame.sessionPane.setForegroundAt(index,Color.blue); frame.sessionPane.setIconAt(index,focused); } else { frame.sessionPane.setSelectedIndex(0); frame.sessionPane.setForegroundAt(0,Color.blue); frame.sessionPane.setIconAt(0,focused); } } } else { closingDown(frame); } }
| 11,486
|
protected void closeSession(Session targetSession) { int tabs = frame.sessionPane.getTabCount(); Sessions sessions = manager.getSessions(); Session session = null; if (tabs > 1) { if ((sessions.item(targetSession)) != null) { int index = frame.sessionPane.indexOfComponent(targetSession); System.out.println("session found and closing down " + index); frame.sessionPane.remove(index); manager.closeSession(targetSession); targetSession = null; if (index < (tabs - 2)) { frame.sessionPane.setSelectedIndex(index); frame.sessionPane.setForegroundAt(index,Color.blue); frame.sessionPane.setIconAt(index,focused); } else { frame.sessionPane.setSelectedIndex(0); frame.sessionPane.setForegroundAt(0,Color.blue); frame.sessionPane.setIconAt(0,focused); } } } else { closingDown(frame); } }
|
protected void closeSession(Session targetSession) { int tabs = frame.sessionPane.getTabCount(); Sessions sessions = manager.getSessions(); Session session = null; if (tabs > 1) { if ((sessions.item(targetSession)) != null) { int index = frame.sessionPane.indexOfComponent(targetSession); System.out.println("session found and closing down " + index); frame.sessionPane.remove(index); manager.closeSession(targetSession); targetSession = null; if (index < (tabs - 2)) { frame.sessionPane.setSelectedIndex(index); frame.sessionPane.setForegroundAt(index,Color.blue); frame.sessionPane.setIconAt(index,focused); } else { frame.sessionPane.setSelectedIndex(0); frame.sessionPane.setForegroundAt(0,Color.blue); frame.sessionPane.setIconAt(0,focused); } } } else { closingDown(f); } }
| 11,487
|
void closingDown() { closingDown(frame); }
|
void closingDown(Session targetSession) { closingDown(frame); }
| 11,488
|
void closingDown() { closingDown(frame); }
|
void closingDown() { closingDown(getParentView(targetSession)); }
| 11,489
|
static public void main(String[] args) { if (!isSpecified("-nc",args)) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap deamon to allow checking // for running instances if (isSpecified("-d",args)) { strapper = new BootStrapper(); strapper.start(); } } else { System.exit(0); } } My5250 m = new My5250(); if (strapper != null) strapper.addBootListener(m); if (args.length > 0) { if (isSpecified("-width",args) || isSpecified("-height",args)) { int width = m.frame.getWidth(); int height = m.frame.getHeight(); if (isSpecified("-width",args)) { width = Integer.parseInt(m.getParm("-width",args)); } if (isSpecified("-height",args)) { height = Integer.parseInt(m.getParm("-height",args)); } m.frame.setSize(width,height); m.centerFrame(); } /** * @todo this crap needs to be rewritten it is a mess */ if (args[0].startsWith("-")) { // check if a session parameter is specified on the command line if (isSpecified("-s",args)) { String sd = getParm("-s",args); if (sessions.containsKey(sd)) { sessions.setProperty("emul.default",sd); } else { args = null; } } // check if a locale parameter is specified on the command line if (isSpecified("-L",args)) { Locale.setDefault(parseLocal(getParm("-L",args))); LangTool.init(); if (args[0].startsWith("-")) { m.sessionArgs = null; } else { m.frame.setVisible(true); LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); if (isSpecified("-s",args)) m.sessionArgs = args; else m.sessionArgs = null; } } else { LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); m.sessionArgs = null; } if (m.sessionArgs != null) { // BEGIN // 2001/09/19 natural computing MR Vector os400_sessions = new Vector(); Vector session_params = new Vector(); for (int x = 0; x < args.length; x++) { if (args[x].equals("-s")) { x++; if (args[x] != null && sessions.containsKey(args[x])) { os400_sessions.addElement(args[x]); }else{ x--; session_params.addElement(args[x]); } }else{ session_params.addElement(args[x]); } } for (int x = 0; x < session_params.size(); x++) m.sessionArgs[x] = session_params.elementAt(x).toString(); m.startNewSession(); for (int x = 1; x < os400_sessions.size(); x++ ) { String sel = os400_sessions.elementAt(x).toString(); if (!m.frame.isVisible()) m.frame.setVisible(true); m.sessionArgs = new String[NUM_PARMS]; m.parseArgs(sessions.getProperty(sel),m.sessionArgs); m.newSession(sel,m.sessionArgs); } // 2001/09/19 natural computing MR // END } else { m.startNewSession(); } }
|
static public void main(String[] args) { if (!isSpecified("-nc",args)) { if (!checkBootStrapper(args)) { // if we did not find a running instance and the -d options is // specified start up the bootstrap deamon to allow checking // for running instances if (isSpecified("-d",args)) { strapper = new BootStrapper(); strapper.start(); } } else { System.exit(0); } } My5250 m = new My5250(); if (strapper != null) strapper.addBootListener(m); if (args.length > 0) { if (isSpecified("-width",args) || isSpecified("-height",args)) { int width = m.frame.getWidth(); int height = m.frame.getHeight(); if (isSpecified("-width",args)) { width = Integer.parseInt(m.getParm("-width",args)); } if (isSpecified("-height",args)) { height = Integer.parseInt(m.getParm("-height",args)); } m.frame.setSize(width,height); m.frame.centerFrame(); } /** * @todo this crap needs to be rewritten it is a mess */ if (args[0].startsWith("-")) { // check if a session parameter is specified on the command line if (isSpecified("-s",args)) { String sd = getParm("-s",args); if (sessions.containsKey(sd)) { sessions.setProperty("emul.default",sd); } else { args = null; } } // check if a locale parameter is specified on the command line if (isSpecified("-L",args)) { Locale.setDefault(parseLocal(getParm("-L",args))); LangTool.init(); if (args[0].startsWith("-")) { m.sessionArgs = null; } else { m.frame.setVisible(true); LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); if (isSpecified("-s",args)) m.sessionArgs = args; else m.sessionArgs = null; } } else { LangTool.init(); m.sessionArgs = args; } } else { LangTool.init(); m.sessionArgs = null; } if (m.sessionArgs != null) { // BEGIN // 2001/09/19 natural computing MR Vector os400_sessions = new Vector(); Vector session_params = new Vector(); for (int x = 0; x < args.length; x++) { if (args[x].equals("-s")) { x++; if (args[x] != null && sessions.containsKey(args[x])) { os400_sessions.addElement(args[x]); }else{ x--; session_params.addElement(args[x]); } }else{ session_params.addElement(args[x]); } } for (int x = 0; x < session_params.size(); x++) m.sessionArgs[x] = session_params.elementAt(x).toString(); m.startNewSession(); for (int x = 1; x < os400_sessions.size(); x++ ) { String sel = os400_sessions.elementAt(x).toString(); if (!m.frame.isVisible()) m.frame.setVisible(true); m.sessionArgs = new String[NUM_PARMS]; m.parseArgs(sessions.getProperty(sel),m.sessionArgs); m.newSession(sel,m.sessionArgs); } // 2001/09/19 natural computing MR // END } else { m.startNewSession(); } }
| 11,490
|
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // check if device name is specified if (isSpecified("-dn",args)) sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); Session s = manager.openSession(sesProps,propFileName,sel); if (isSpecified("-t",args)) frame.sessionPane.addTab(sel,focused,s); else frame.sessionPane.addTab(session,focused,s); frame.sessionPane.setForegroundAt(frame.sessionPane.getSelectedIndex(),Color.black); frame.sessionPane.setIconAt(frame.sessionPane.getSelectedIndex(),unfocused); frame.sessionPane.setSelectedIndex(frame.sessionPane.getTabCount()-1); frame.sessionPane.setForegroundAt(frame.sessionPane.getSelectedIndex(),Color.blue); frame.sessionPane.setIconAt(frame.sessionPane.getSelectedIndex(),focused); s.addSessionListener(this); s.connect(); }
|
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // check if device name is specified if (isSpecified("-dn",args)) sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); Session s = manager.openSession(sesProps,propFileName,sel); if (isSpecified("-t",args)) frame.addSessionView(sel,s); else frame.sessionPane.addTab(session,focused,s); frame.sessionPane.setForegroundAt(frame.sessionPane.getSelectedIndex(),Color.black); frame.sessionPane.setIconAt(frame.sessionPane.getSelectedIndex(),unfocused); frame.sessionPane.setSelectedIndex(frame.sessionPane.getTabCount()-1); frame.sessionPane.setForegroundAt(frame.sessionPane.getSelectedIndex(),Color.blue); frame.sessionPane.setIconAt(frame.sessionPane.getSelectedIndex(),focused); s.addSessionListener(this); s.connect(); }
| 11,491
|
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // check if device name is specified if (isSpecified("-dn",args)) sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); Session s = manager.openSession(sesProps,propFileName,sel); if (isSpecified("-t",args)) frame.sessionPane.addTab(sel,focused,s); else frame.sessionPane.addTab(session,focused,s); frame.sessionPane.setForegroundAt(frame.sessionPane.getSelectedIndex(),Color.black); frame.sessionPane.setIconAt(frame.sessionPane.getSelectedIndex(),unfocused); frame.sessionPane.setSelectedIndex(frame.sessionPane.getTabCount()-1); frame.sessionPane.setForegroundAt(frame.sessionPane.getSelectedIndex(),Color.blue); frame.sessionPane.setIconAt(frame.sessionPane.getSelectedIndex(),focused); s.addSessionListener(this); s.connect(); }
|
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // check if device name is specified if (isSpecified("-dn",args)) sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); Session s = manager.openSession(sesProps,propFileName,sel); if (isSpecified("-t",args)) frame.sessionPane.addTab(sel,focused,s); else frame.addSessionView(session,s); frame.sessionPane.setForegroundAt(frame.sessionPane.getSelectedIndex(),Color.black); frame.sessionPane.setIconAt(frame.sessionPane.getSelectedIndex(),unfocused); frame.sessionPane.setSelectedIndex(frame.sessionPane.getTabCount()-1); frame.sessionPane.setForegroundAt(frame.sessionPane.getSelectedIndex(),Color.blue); frame.sessionPane.setIconAt(frame.sessionPane.getSelectedIndex(),focused); s.addSessionListener(this); s.connect(); }
| 11,492
|
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // check if device name is specified if (isSpecified("-dn",args)) sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); Session s = manager.openSession(sesProps,propFileName,sel); if (isSpecified("-t",args)) frame.sessionPane.addTab(sel,focused,s); else frame.sessionPane.addTab(session,focused,s); frame.sessionPane.setForegroundAt(frame.sessionPane.getSelectedIndex(),Color.black); frame.sessionPane.setIconAt(frame.sessionPane.getSelectedIndex(),unfocused); frame.sessionPane.setSelectedIndex(frame.sessionPane.getTabCount()-1); frame.sessionPane.setForegroundAt(frame.sessionPane.getSelectedIndex(),Color.blue); frame.sessionPane.setIconAt(frame.sessionPane.getSelectedIndex(),focused); s.addSessionListener(this); s.connect(); }
|
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // check if device name is specified if (isSpecified("-dn",args)) sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); Session s = manager.openSession(sesProps,propFileName,sel); if (isSpecified("-t",args)) frame.sessionPane.addTab(sel,focused,s); else frame.sessionPane.addTab(session,focused,s); frame.sessionPane.setForegroundAt(frame.sessionPane.getSelectedIndex(),Color.black); frame.sessionPane.setIconAt(frame.sessionPane.getSelectedIndex(),unfocused); frame.sessionPane.setSelectedIndex(frame.sessionPane.getTabCount()-1); frame.sessionPane.setForegroundAt(frame.sessionPane.getSelectedIndex(),Color.blue); frame.sessionPane.setIconAt(frame.sessionPane.getSelectedIndex(),focused); s.addSessionListener(this); s.connect(); }
| 11,493
|
public void onSessionChanged(SessionChangeEvent changeEvent) { Session ses = (Session)changeEvent.getSource(); System.out.println(changeEvent.getState() + " " + ses.getAllocDeviceName()); if (changeEvent.getState() == STATE_CONNECTED) { final String d = ses.getAllocDeviceName(); if (d != null) { final int index = frame.sessionPane.indexOfComponent(ses); Runnable tc = new Runnable () { public void run() { frame.sessionPane.setTitleAt(index,d); } }; SwingUtilities.invokeLater(tc); } } }
|
public void onSessionChanged(SessionChangeEvent changeEvent) { Session ses = (Session)changeEvent.getSource(); System.out.println(changeEvent.getState() + " " + ses.getAllocDeviceName()); if (changeEvent.getState() == STATE_CONNECTED) { final String d = ses.getAllocDeviceName(); if (d != null) { final int index = frame.sessionPane.indexOfComponent(ses); Runnable tc = new Runnable () { public void run() { frame.sessionPane.setTitleAt(index,d); } }; SwingUtilities.invokeLater(tc); } } }
| 11,494
|
public void onSessionChanged(SessionChangeEvent changeEvent) { Session ses = (Session)changeEvent.getSource(); System.out.println(changeEvent.getState() + " " + ses.getAllocDeviceName()); if (changeEvent.getState() == STATE_CONNECTED) { final String d = ses.getAllocDeviceName(); if (d != null) { final int index = frame.sessionPane.indexOfComponent(ses); Runnable tc = new Runnable () { public void run() { frame.sessionPane.setTitleAt(index,d); } }; SwingUtilities.invokeLater(tc); } } }
|
public void onSessionChanged(SessionChangeEvent changeEvent) { Session ses = (Session)changeEvent.getSource(); System.out.println(changeEvent.getState() + " " + ses.getAllocDeviceName()); if (changeEvent.getState() == STATE_CONNECTED) { final String d = ses.getAllocDeviceName(); if (d != null) { final int index = frame.sessionPane.indexOfComponent(ses); Runnable tc = new Runnable () { public void run() { frame.sessionPane.setTitleAt(index,d); } }; SwingUtilities.invokeLater(tc); } } }
| 11,495
|
void startNewSession() { int result = 2; String sel = ""; if (sessionArgs != null && !sessionArgs[0].startsWith("-")) sel = sessionArgs[0]; else { sel = getDefaultSession(); } Sessions sess = manager.getSessions(); if (sel != null && sess.getCount() == 0 && sessions.containsKey(sel)){ sessionArgs = new String[NUM_PARMS]; parseArgs((String)sessions.getProperty(sel), sessionArgs); } if (sessionArgs == null || sess.getCount() > 0) { sel = getConnectSession(); if (sel != null) { String selArgs = sessions.getProperty(sel); sessionArgs = new String[NUM_PARMS]; parseArgs(selArgs, sessionArgs); if (!frame.isVisible()) frame.setVisible(true); newSession(sel,sessionArgs); } else { if (sess.getCount() == 0) System.exit(0); } } else { if (!frame.isVisible()) frame.setVisible(true); newSession(sel,sessionArgs); } }
|
void startNewSession() { int result = 2; String sel = ""; if (sessionArgs != null && !sessionArgs[0].startsWith("-")) sel = sessionArgs[0]; else { sel = getDefaultSession(); } Sessions sess = manager.getSessions(); if (sel != null && sess.getCount() == 0 && sessions.containsKey(sel)){ sessionArgs = new String[NUM_PARMS]; parseArgs((String)sessions.getProperty(sel), sessionArgs); } if (sessionArgs == null || sess.getCount() > 0) { sel = getConnectSession(); if (sel != null) { String selArgs = sessions.getProperty(sel); sessionArgs = new String[NUM_PARMS]; parseArgs(selArgs, sessionArgs); if (!frame.isVisible()) frame.setVisible(true); newSession(sel,sessionArgs); } else { if (sess.getCount() == 0) System.exit(0); } } else { if (!frame.isVisible()) frame.setVisible(true); newSession(sel,sessionArgs); } }
| 11,496
|
void startNewSession() { int result = 2; String sel = ""; if (sessionArgs != null && !sessionArgs[0].startsWith("-")) sel = sessionArgs[0]; else { sel = getDefaultSession(); } Sessions sess = manager.getSessions(); if (sel != null && sess.getCount() == 0 && sessions.containsKey(sel)){ sessionArgs = new String[NUM_PARMS]; parseArgs((String)sessions.getProperty(sel), sessionArgs); } if (sessionArgs == null || sess.getCount() > 0) { sel = getConnectSession(); if (sel != null) { String selArgs = sessions.getProperty(sel); sessionArgs = new String[NUM_PARMS]; parseArgs(selArgs, sessionArgs); if (!frame.isVisible()) frame.setVisible(true); newSession(sel,sessionArgs); } else { if (sess.getCount() == 0) System.exit(0); } } else { if (!frame.isVisible()) frame.setVisible(true); newSession(sel,sessionArgs); } }
|
void startNewSession() { int result = 2; String sel = ""; if (sessionArgs != null && !sessionArgs[0].startsWith("-")) sel = sessionArgs[0]; else { sel = getDefaultSession(); } Sessions sess = manager.getSessions(); if (sel != null && sess.getCount() == 0 && sessions.containsKey(sel)){ sessionArgs = new String[NUM_PARMS]; parseArgs((String)sessions.getProperty(sel), sessionArgs); } if (sessionArgs == null || sess.getCount() > 0) { sel = getConnectSession(); if (sel != null) { String selArgs = sessions.getProperty(sel); sessionArgs = new String[NUM_PARMS]; parseArgs(selArgs, sessionArgs); if (!frame.isVisible()) frame.setVisible(true); newSession(sel,sessionArgs); } else { if (sess.getCount() == 0) System.exit(0); } } else { if (!frame.isVisible()) frame.setVisible(true); newSession(sel,sessionArgs); } }
| 11,497
|
public PluginRegistryModel(URL[] pluginFiles) throws PluginException { this.extensionPoints = new BootableHashMap(); this.descriptorMap = new BootableHashMap(); loadDescriptors(pluginFiles); resolveDescriptors(); }
|
public PluginRegistryModel(URL[] pluginFiles) throws PluginException { this.extensionPoints = new BootableHashMap(); this.descriptorMap = new BootableHashMap(); loadDescriptors(pluginFiles); resolveDescriptors(); }
| 11,498
|
private void loadDescriptors(URL[] pluginUrls) throws PluginException { final int max = pluginUrls.length; for (int i = 0; i < max; i++) { //System.out.println(pluginUrls[i]); loadPlugin(pluginUrls[ i], false); } }
|
private List loadDescriptors(URL[] pluginUrls) throws PluginException { final int max = pluginUrls.length; for (int i = 0; i < max; i++) { //System.out.println(pluginUrls[i]); loadPlugin(pluginUrls[ i], false); } }
| 11,499
|
private void loadDescriptors(URL[] pluginUrls) throws PluginException { final int max = pluginUrls.length; for (int i = 0; i < max; i++) { //System.out.println(pluginUrls[i]); loadPlugin(pluginUrls[ i], false); } }
|
final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); privatefinal ArrayList descriptors = new ArrayList(max); voidfinal ArrayList descriptors = new ArrayList(max); loadDescriptors(URL[]final ArrayList descriptors = new ArrayList(max); pluginUrls)final ArrayList descriptors = new ArrayList(max); throwsfinal ArrayList descriptors = new ArrayList(max); PluginExceptionfinal ArrayList descriptors = new ArrayList(max); {final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); finalfinal ArrayList descriptors = new ArrayList(max); intfinal ArrayList descriptors = new ArrayList(max); maxfinal ArrayList descriptors = new ArrayList(max); =final ArrayList descriptors = new ArrayList(max); pluginUrls.length;final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); forfinal ArrayList descriptors = new ArrayList(max); (intfinal ArrayList descriptors = new ArrayList(max); ifinal ArrayList descriptors = new ArrayList(max); =final ArrayList descriptors = new ArrayList(max); 0;final ArrayList descriptors = new ArrayList(max); ifinal ArrayList descriptors = new ArrayList(max); <final ArrayList descriptors = new ArrayList(max); max;final ArrayList descriptors = new ArrayList(max); i++)final ArrayList descriptors = new ArrayList(max); {final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); //System.out.println(pluginUrls[i]);final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); loadPlugin(pluginUrls[final ArrayList descriptors = new ArrayList(max); i],final ArrayList descriptors = new ArrayList(max); false);final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); }final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); final ArrayList descriptors = new ArrayList(max); }
| 11,500
|
private void loadDescriptors(URL[] pluginUrls) throws PluginException { final int max = pluginUrls.length; for (int i = 0; i < max; i++) { //System.out.println(pluginUrls[i]); loadPlugin(pluginUrls[ i], false); } }
|
private void loadDescriptors(URL[] pluginUrls) throws PluginException { final int max = pluginUrls.length; for (int i = 0; i < max; i++) { //System.out.println(pluginUrls[i]); descriptors.add(loadPlugin(pluginUrls[ i], false)); } }
| 11,501
|
public PluginDescriptor loadPlugin(final URL pluginUrl) throws PluginException { return loadPlugin(pluginUrl, true); }
|
private PluginDescriptor loadPlugin(final URL pluginUrl, boolean resolve) throws PluginException { return loadPlugin(pluginUrl, true); }
| 11,503
|
public PluginDescriptor loadPlugin(final URL pluginUrl) throws PluginException { return loadPlugin(pluginUrl, true); }
|
public PluginDescriptor loadPlugin(final URL pluginUrl) throws PluginException { final PluginRegistryModel registry = this; final PluginJar pluginJar; try { pluginJar = (PluginJar) AccessController .doPrivileged(new PrivilegedExceptionAction() { public Object run() throws PluginException, IOException { return new PluginJar(registry, pluginUrl); } }); } catch (PrivilegedActionException pax) { final Throwable ex = pax.getException(); if (ex instanceof PluginException) { throw (PluginException) ex; } else { throw new PluginException(ex); } } final PluginDescriptorModel descr = pluginJar.getDescriptorModel(); if (resolve) { descr.resolve(this); } return descr; }
| 11,504
|
public void resolveDescriptors() throws PluginException { for (Iterator i = descriptorMap.values().iterator(); i.hasNext();) { final PluginDescriptorModel descr = (PluginDescriptorModel) i .next(); descr.resolve(); } }
|
public void resolveDescriptors() throws PluginException { for (Iterator i = descriptorMap.values().iterator(); i.hasNext();) { final PluginDescriptorModel descr = (PluginDescriptorModel) i .next(); descr.resolve(this); } }
| 11,505
|
public PathIterator getPathIterator(AffineTransform at) { // FIXME. return null; }
|
public PathIterator getPathIterator(final AffineTransform at) { // FIXME. return null; }
| 11,506
|
public PathIterator getPathIterator(AffineTransform at) { // FIXME. return null; }
|
public PathIterator getPathIterator(AffineTransform at) { // FIXME. final double minx = getX(); final double miny = getY(); final double maxx = minx + getWidth(); final double maxy = miny + getHeight(); final double arcwidth = getArcWidth(); final double archeight = getArcHeight(); return new PathIterator() { /** We iterate clockwise around the rectangle, starting in the * upper left. This variable tracks our current point, which * can be on either side of a given corner. */ private int current = 0; /** Child path iterator, used for corners. */ private PathIterator corner; /** This is used when rendering the corners. We re-use the arc * for each corner. */ private Arc2D arc = new Arc2D.Double(); /** Temporary array used by getPoint. */ private double[] temp = new double[2]; public int getWindingRule() { return WIND_NON_ZERO; } public boolean isDone() { return current > 9; } private void getPoint(int val) { switch (val) { case 0: case 8: temp[0] = minx; temp[1] = miny + archeight; break; case 1: temp[0] = minx + arcwidth; temp[1] = miny; break; case 2: temp[0] = maxx - arcwidth; temp[1] = maxy; break; case 3: temp[0] = maxx; temp[1] = miny + archeight; break; case 4: temp[0] = maxx; temp[1] = maxy - archeight; break; case 5: temp[0] = maxx - arcwidth; temp[1] = maxy; break; case 6: temp[0] = minx + arcwidth; temp[1] = maxy; break; case 7: temp[0] = minx; temp[1] = maxy - archeight; break; } } public void next() { if (current >= 8) ++current; else if (corner != null) { corner.next(); if (corner.isDone()) { corner = null; ++current; } } else { getPoint(current); double x1 = temp[0]; double y1 = temp[1]; getPoint(current + 1); arc.setFrameFromDiagonal(x1, y1, temp[0], temp[1]); arc.setAngles(x1, y1, temp[0], temp[1]); corner = arc.getPathIterator(at); } } public int currentSegment(float[] coords) { if (corner != null) { int r = corner.currentSegment(coords); if (r == SEG_MOVETO) r = SEG_LINETO; return r; } if (current < 9) { getPoint(current); coords[0] = (float) temp[0]; coords[1] = (float) temp[1]; } else if (current == 9) return SEG_CLOSE; else throw new NoSuchElementException("rect iterator out of bounds"); if (at != null) at.transform(coords, 0, coords, 0, 1); return current == 0 ? SEG_MOVETO : SEG_LINETO; } public int currentSegment(double[] coords) { if (corner != null) { int r = corner.currentSegment(coords); if (r == SEG_MOVETO) r = SEG_LINETO; return r; } if (current < 9) { getPoint(current); coords[0] = temp[0]; coords[1] = temp[1]; } else if (current == 9) return SEG_CLOSE; else throw new NoSuchElementException("rect iterator out of bounds"); if (at != null) at.transform(coords, 0, coords, 0, 1); return current == 0 ? SEG_MOVETO : SEG_LINETO; } }; }
| 11,507
|
public void setDividerLocation(JSplitPane jc, int location) { location = validLocation(location); Container p = jc.getParent(); Dimension rightPrefSize = jc.getRightComponent().getPreferredSize(); if (getOrientation() == 0 && location > jc.getSize().height) { location = jc.getSize().height; while (p != null) { p.setSize(p.getWidth(), p.getHeight() + rightPrefSize.height); p = p.getParent(); } } else if (location > jc.getSize().width) { location = jc.getSize().width; while (p != null) { p.setSize(p.getWidth() + rightPrefSize.width, p.getHeight()); p = p.getParent(); } } setLastDragLocation(getDividerLocation(splitPane)); splitPane.setLastDividerLocation(getDividerLocation(splitPane)); int[] tmpSizes = layoutManager.getSizes(); tmpSizes[0] = location - layoutManager.getInitialLocation(splitPane.getInsets()); tmpSizes[1] = layoutManager.getAvailableSize(splitPane.getSize(), splitPane.getInsets()) - tmpSizes[0]; layoutManager.setSizes(tmpSizes); splitPane.revalidate(); splitPane.repaint(); }
|
public void setDividerLocation(JSplitPane jc, int location) { location = validLocation(location); Container p = jc.getParent(); Dimension rightPrefSize = jc.getRightComponent().getPreferredSize(); Dimension size = jc.getSize(); if (size.width == 0 && size.height == 0) size = jc.getPreferredSize(); if (getOrientation() == 0 && location > size.height) { location = jc.getSize().height; while (p != null) { p.setSize(p.getWidth(), p.getHeight() + rightPrefSize.height); p = p.getParent(); } } else if (location > jc.getSize().width) { location = jc.getSize().width; while (p != null) { p.setSize(p.getWidth() + rightPrefSize.width, p.getHeight()); p = p.getParent(); } } setLastDragLocation(getDividerLocation(splitPane)); splitPane.setLastDividerLocation(getDividerLocation(splitPane)); int[] tmpSizes = layoutManager.getSizes(); tmpSizes[0] = location - layoutManager.getInitialLocation(splitPane.getInsets()); tmpSizes[1] = layoutManager.getAvailableSize(splitPane.getSize(), splitPane.getInsets()) - tmpSizes[0]; layoutManager.setSizes(tmpSizes); splitPane.revalidate(); splitPane.repaint(); }
| 11,510
|
public void setDividerLocation(JSplitPane jc, int location) { location = validLocation(location); Container p = jc.getParent(); Dimension rightPrefSize = jc.getRightComponent().getPreferredSize(); if (getOrientation() == 0 && location > jc.getSize().height) { location = jc.getSize().height; while (p != null) { p.setSize(p.getWidth(), p.getHeight() + rightPrefSize.height); p = p.getParent(); } } else if (location > jc.getSize().width) { location = jc.getSize().width; while (p != null) { p.setSize(p.getWidth() + rightPrefSize.width, p.getHeight()); p = p.getParent(); } } setLastDragLocation(getDividerLocation(splitPane)); splitPane.setLastDividerLocation(getDividerLocation(splitPane)); int[] tmpSizes = layoutManager.getSizes(); tmpSizes[0] = location - layoutManager.getInitialLocation(splitPane.getInsets()); tmpSizes[1] = layoutManager.getAvailableSize(splitPane.getSize(), splitPane.getInsets()) - tmpSizes[0]; layoutManager.setSizes(tmpSizes); splitPane.revalidate(); splitPane.repaint(); }
|
public void setDividerLocation(JSplitPane jc, int location) { location = validLocation(location); Container p = jc.getParent(); Dimension rightPrefSize = jc.getRightComponent().getPreferredSize(); if (getOrientation() == 0 && location > jc.getSize().height) { location = size.height; while (p != null) { p.setSize(p.getWidth(), p.getHeight() + rightPrefSize.height); p = p.getParent(); } } else if (location > jc.getSize().width) { location = jc.getSize().width; while (p != null) { p.setSize(p.getWidth() + rightPrefSize.width, p.getHeight()); p = p.getParent(); } } setLastDragLocation(getDividerLocation(splitPane)); splitPane.setLastDividerLocation(getDividerLocation(splitPane)); int[] tmpSizes = layoutManager.getSizes(); tmpSizes[0] = location - layoutManager.getInitialLocation(splitPane.getInsets()); tmpSizes[1] = layoutManager.getAvailableSize(splitPane.getSize(), splitPane.getInsets()) - tmpSizes[0]; layoutManager.setSizes(tmpSizes); splitPane.revalidate(); splitPane.repaint(); }
| 11,511
|
public void setDividerLocation(JSplitPane jc, int location) { location = validLocation(location); Container p = jc.getParent(); Dimension rightPrefSize = jc.getRightComponent().getPreferredSize(); if (getOrientation() == 0 && location > jc.getSize().height) { location = jc.getSize().height; while (p != null) { p.setSize(p.getWidth(), p.getHeight() + rightPrefSize.height); p = p.getParent(); } } else if (location > jc.getSize().width) { location = jc.getSize().width; while (p != null) { p.setSize(p.getWidth() + rightPrefSize.width, p.getHeight()); p = p.getParent(); } } setLastDragLocation(getDividerLocation(splitPane)); splitPane.setLastDividerLocation(getDividerLocation(splitPane)); int[] tmpSizes = layoutManager.getSizes(); tmpSizes[0] = location - layoutManager.getInitialLocation(splitPane.getInsets()); tmpSizes[1] = layoutManager.getAvailableSize(splitPane.getSize(), splitPane.getInsets()) - tmpSizes[0]; layoutManager.setSizes(tmpSizes); splitPane.revalidate(); splitPane.repaint(); }
|
public void setDividerLocation(JSplitPane jc, int location) { location = validLocation(location); Container p = jc.getParent(); Dimension rightPrefSize = jc.getRightComponent().getPreferredSize(); if (getOrientation() == 0 && location > jc.getSize().height) { location = jc.getSize().height; while (p != null) { p.setSize(p.getWidth(), p.getHeight() + rightPrefSize.height); p = p.getParent(); } } else if (location > size.width) { location = jc.getSize().width; while (p != null) { p.setSize(p.getWidth() + rightPrefSize.width, p.getHeight()); p = p.getParent(); } } setLastDragLocation(getDividerLocation(splitPane)); splitPane.setLastDividerLocation(getDividerLocation(splitPane)); int[] tmpSizes = layoutManager.getSizes(); tmpSizes[0] = location - layoutManager.getInitialLocation(splitPane.getInsets()); tmpSizes[1] = layoutManager.getAvailableSize(splitPane.getSize(), splitPane.getInsets()) - tmpSizes[0]; layoutManager.setSizes(tmpSizes); splitPane.revalidate(); splitPane.repaint(); }
| 11,512
|
public void setDividerLocation(JSplitPane jc, int location) { location = validLocation(location); Container p = jc.getParent(); Dimension rightPrefSize = jc.getRightComponent().getPreferredSize(); if (getOrientation() == 0 && location > jc.getSize().height) { location = jc.getSize().height; while (p != null) { p.setSize(p.getWidth(), p.getHeight() + rightPrefSize.height); p = p.getParent(); } } else if (location > jc.getSize().width) { location = jc.getSize().width; while (p != null) { p.setSize(p.getWidth() + rightPrefSize.width, p.getHeight()); p = p.getParent(); } } setLastDragLocation(getDividerLocation(splitPane)); splitPane.setLastDividerLocation(getDividerLocation(splitPane)); int[] tmpSizes = layoutManager.getSizes(); tmpSizes[0] = location - layoutManager.getInitialLocation(splitPane.getInsets()); tmpSizes[1] = layoutManager.getAvailableSize(splitPane.getSize(), splitPane.getInsets()) - tmpSizes[0]; layoutManager.setSizes(tmpSizes); splitPane.revalidate(); splitPane.repaint(); }
|
public void setDividerLocation(JSplitPane jc, int location) { location = validLocation(location); Container p = jc.getParent(); Dimension rightPrefSize = jc.getRightComponent().getPreferredSize(); if (getOrientation() == 0 && location > jc.getSize().height) { location = jc.getSize().height; while (p != null) { p.setSize(p.getWidth(), p.getHeight() + rightPrefSize.height); p = p.getParent(); } } else if (location > jc.getSize().width) { location = size.width; while (p != null) { p.setSize(p.getWidth() + rightPrefSize.width, p.getHeight()); p = p.getParent(); } } setLastDragLocation(getDividerLocation(splitPane)); splitPane.setLastDividerLocation(getDividerLocation(splitPane)); int[] tmpSizes = layoutManager.getSizes(); tmpSizes[0] = location - layoutManager.getInitialLocation(splitPane.getInsets()); tmpSizes[1] = layoutManager.getAvailableSize(splitPane.getSize(), splitPane.getInsets()) - tmpSizes[0]; layoutManager.setSizes(tmpSizes); splitPane.revalidate(); splitPane.repaint(); }
| 11,513
|
public void specificIOStyleToXDF (OutputStream outputstream, String what) { }
|
protected void specificIOStyleToXDF( OutputStream outputstream, String indent) { synchronized (attribHash) { writeOut(outputstream, "<" + classXDFNodeName); }
| 11,514
|
public void add(Area a) { // XXX Implement. throw new Error("not implemented"); }
|
public void add(Area area) { // XXX Implement. throw new Error("not implemented"); }
| 11,516
|
public void add(Area a) { // XXX Implement. throw new Error("not implemented"); }
|
public void add(Area a) { // XXX Implement. if (equals(area)) return; if (area.isEmpty()) return; Area B = (Area) area.clone(); Vector pathA = new Vector(); Vector pathB = new Vector(); pathA.addAll(solids); pathA.addAll(holes); pathB.addAll(B.solids); pathB.addAll(B.holes); int nNodes = 0; for (int i = 0; i < pathA.size(); i++) { Segment a = (Segment) pathA.elementAt(i); for (int j = 0; j < pathB.size(); j++) { Segment b = (Segment) pathB.elementAt(j); nNodes += createNodes(a, b); } } Vector paths = new Vector(); Segment v; Vector segments = new Vector(); for (int i = 0; i < pathA.size(); i++) { v = (Segment) pathA.elementAt(i); Segment path = v; do { if (v.isSegmentOutside(area)) segments.add(v); v = v.next; } while (v != path); } for (int i = 0; i < pathB.size(); i++) { v = (Segment) pathB.elementAt(i); Segment path = v; do { if (v.isSegmentOutside(this)) segments.add(v); v = v.next; } while (v != path); } paths = weilerAtherton(segments); deleteRedundantPaths(paths); }
| 11,517
|
public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException e) { throw (Error) new InternalError().initCause(e); // Impossible } }
|
public Object clone() { try { Area clone = new Area(); for (int i = 0; i < solids.size(); i++) clone.solids.add(((Segment) solids.elementAt(i)).cloneSegmentList()); for (int i = 0; i < holes.size(); i++) clone.holes.add(((Segment) holes.elementAt(i)).cloneSegmentList()); return clone; } catch (CloneNotSupportedException e) { throw (Error) new InternalError().initCause(e); // Impossible } }
| 11,518
|
public boolean equals(Area a) { // XXX Implement. throw new Error("not implemented"); }
|
public boolean equals(Area area) { // XXX Implement. throw new Error("not implemented"); }
| 11,519
|
public boolean equals(Area a) { // XXX Implement. throw new Error("not implemented"); }
|
public boolean equals(Area a) { // XXX Implement. if (area == null) return false; if (! getBounds2D().equals(area.getBounds2D())) return false; if (solids.size() != area.solids.size() || holes.size() != area.holes.size()) return false; Vector pathA = new Vector(); pathA.addAll(solids); pathA.addAll(holes); Vector pathB = new Vector(); pathB.addAll(area.solids); pathB.addAll(area.holes); int nPaths = pathA.size(); boolean[][] match = new boolean[2][nPaths]; for (int i = 0; i < nPaths; i++) { for (int j = 0; j < nPaths; j++) { Segment p1 = (Segment) pathA.elementAt(i); Segment p2 = (Segment) pathB.elementAt(j); if (! match[0][i] && ! match[1][j]) if (p1.pathEquals(p2)) match[0][i] = match[1][j] = true; } } boolean result = true; for (int i = 0; i < nPaths; i++) result = result && match[0][i] && match[1][i]; return result; }
| 11,520
|
public void exclusiveOr(Area a) { // XXX Implement. throw new Error("not implemented"); }
|
public void exclusiveOr(Area area) { // XXX Implement. throw new Error("not implemented"); }
| 11,521
|
public void exclusiveOr(Area a) { // XXX Implement. throw new Error("not implemented"); }
|
public void exclusiveOr(Area a) { // XXX Implement. if (area.isEmpty()) return; if (isEmpty()) { Area B = (Area) area.clone(); solids = B.solids; holes = B.holes; return; }
| 11,522
|
public PathIterator getPathIterator(AffineTransform at) { // XXX Implement. throw new Error("not implemented"); }
|
public PathIterator getPathIterator(AffineTransform at) { // XXX Implement. return (new AreaIterator(at)); }
| 11,524
|
public boolean intersects(double x, double y, double w, double h) { // XXX Implement. throw new Error("not implemented"); }
|
public boolean intersects(double x, double y, double w, double h) { // XXX Implement. if (solids.size() == 0) return false; LineSegment[] l = new LineSegment[4]; l[0] = new LineSegment(x, y, x + w, y); l[1] = new LineSegment(x, y + h, x + w, y + h); l[2] = new LineSegment(x, y, x, y + h); l[3] = new LineSegment(x + w, y, x + w, y + h); for (int i = 0; i < 4; i++) { for (int path = 0; path < solids.size(); path++) { Segment v; Segment start; start = v = (Segment) solids.elementAt(path); do { if (l[i].hasIntersections(v)) return true; v = v.next; } while (v != start); } for (int path = 0; path < holes.size(); path++) { Segment v; Segment start; start = v = (Segment) holes.elementAt(path); do { if (l[i].hasIntersections(v)) return true; v = v.next; } while (v != start); } } if (contains(x + w * 0.5, y + h * 0.5)) return true; Point2D p = ((Segment) solids.elementAt(0)).getMidPoint(); if ((new Rectangle2D.Double(x, y, w, h)).contains(p)) return true; return false; }
| 11,525
|
public boolean isEmpty() { // XXX Implement. throw new Error("not implemented"); }
|
public boolean isEmpty() { // XXX Implement. if (solids.size() == 0) return true; double totalArea = 0; for (int i = 0; i < solids.size(); i++) totalArea += Math.abs(((Segment) solids.elementAt(i)).getSignedArea()); for (int i = 0; i < holes.size(); i++) totalArea -= Math.abs(((Segment) holes.elementAt(i)).getSignedArea()); if (totalArea <= EPSILON) return true; return false; }
| 11,526
|
public boolean isPolygonal() { // XXX Implement. throw new Error("not implemented"); }
|
public boolean isPolygonal() { // XXX Implement. for (int i = 0; i < holes.size(); i++) if (! ((Segment) holes.elementAt(i)).isPolygonal()) return false; for (int i = 0; i < solids.size(); i++) if (! ((Segment) solids.elementAt(i)).isPolygonal()) return false; return true; }
| 11,527
|
public boolean isRectangular() { // XXX Implement. throw new Error("not implemented"); }
|
public boolean isRectangular() { // XXX Implement. if (isEmpty()) return true; if (holes.size() != 0 || solids.size() != 1) return false; Segment path = (Segment) solids.elementAt(0); if (! path.isPolygonal()) return false; int nCorners = 0; Segment s = path; do { Segment s2 = s.next; double d1 = (s.P2.getX() - s.P1.getX())*(s2.P2.getX() - s2.P1.getX())/ ((s.P1.distance(s.P2)) * (s2.P1.distance(s2.P2))); double d2 = (s.P2.getY() - s.P1.getY())*(s2.P2.getY() - s2.P1.getY())/ ((s.P1.distance(s.P2)) * (s2.P1.distance(s2.P2))); double dotproduct = d1 + d2; if (d1 != 0 && d2 != 0) return false; if (Math.abs(dotproduct) == 0) nCorners++; else if ((Math.abs(1.0 - dotproduct) > 0)) return false; s = s.next; }
| 11,528
|
public boolean isSingular() { // XXX Implement. throw new Error("not implemented"); }
|
public boolean isSingular() { // XXX Implement. return (holes.size() == 0 && solids.size() <= 1); }
| 11,530
|
public void reset() { // XXX Implement. throw new Error("not implemented"); }
|
public void reset() { // XXX Implement. solids = new Vector(); holes = new Vector(); }
| 11,531
|
public void subtract(Area a) { // XXX Implement. throw new Error("not implemented"); }
|
public void subtract(Area area) { // XXX Implement. throw new Error("not implemented"); }
| 11,532
|
public void subtract(Area a) { // XXX Implement. throw new Error("not implemented"); }
|
public void subtract(Area a) { // XXX Implement. if (isEmpty() || area.isEmpty()) return; if (equals(area)) { reset(); return; } Vector pathA = new Vector(); Area B = (Area) area.clone(); pathA.addAll(solids); pathA.addAll(holes); setDirection(B.holes, true); setDirection(B.solids, false); Vector pathB = new Vector(); pathB.addAll(B.solids); pathB.addAll(B.holes); int nNodes = 0; for (int i = 0; i < pathA.size(); i++) { Segment a = (Segment) pathA.elementAt(i); for (int j = 0; j < pathB.size(); j++) { Segment b = (Segment) pathB.elementAt(j); nNodes += createNodes(a, b); } } Vector paths = new Vector(); Vector segments = new Vector(); for (int i = 0; i < pathA.size(); i++) { Segment v = (Segment) pathA.elementAt(i); Segment path = v; if (v.isSegmentOutside(area) && v.node == null) segments.add(v); boolean node = false; do { if ((v.node != null || node)) { node = (v.node != null); if (v.isSegmentOutside(area)) segments.add(v); } v = v.next; } while (v != path); } for (int i = 0; i < pathB.size(); i++) { Segment v = (Segment) pathB.elementAt(i); Segment path = v; if (! v.isSegmentOutside(this) && v.node == null) segments.add(v); v = v.next; boolean node = false; do { if ((v.node != null || node)) { node = (v.node != null); if (! v.isSegmentOutside(this)) segments.add(v); } v = v.next; } while (v != path); } paths = weilerAtherton(segments); deleteRedundantPaths(paths); }
| 11,533
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Color oldColor = g.getColor(); try { g.setColor(lineColor); /* If width and height were not adjusted, the border would * appear one pixel too large in both directions. */ width -= 1; height -= 1; /* Blurred, too large appearance * ----------------------------- * While Java 2D has introduced line strokes of arbitrary width, * it seems desirable to keep this code independent of Java 2D. * Therefore, multiple nested rectangles (or rounded rectangles) * are drawn in order to simulate a line whose thickness is * greater than one pixel. * * This hack causes a blurred appearance when anti-aliasing is * on. Interestingly enough, though, the Sun JDK 1.3.1 (at least * on MacOS X 10.1.5) shows exactly the same appearance under * this condition. It thus seems likely that Sun does the same * hack for simulating thick lines. For this reason, the * blurred appearance seems acceptable -- especially since GNU * Classpath tries to be compatible with the Sun reference * implementation. */ for (int i = 0; i < thickness; i++) { if (roundedCorners) g.drawRoundRect(x, y, width, height, thickness, thickness); else g.drawRect(x, y, width, height); x += 1; y += 1; width -= 2; height -= 2; } } finally { g.setColor(oldColor); } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Color oldColor = g.getColor(); try { g.setColor(lineColor); /* If width and height were not adjusted, the border would * appear one pixel too large in both directions. */ width -= 1; height -= 1; /* Blurred, too large appearance * ----------------------------- * While Java 2D has introduced line strokes of arbitrary width, * it seems desirable to keep this code independent of Java 2D. * Therefore, multiple nested rectangles (or rounded rectangles) * are drawn in order to simulate a line whose thickness is * greater than one pixel. * * This hack causes a blurred appearance when anti-aliasing is * on. Interestingly enough, though, the Sun JDK 1.3.1 (at least * on MacOS X 10.1.5) shows exactly the same appearance under * this condition. It thus seems likely that Sun does the same * hack for simulating thick lines. For this reason, the * blurred appearance seems acceptable -- especially since GNU * Classpath tries to be compatible with the Sun reference * implementation. */ for (int i = 0; i < thickness; i++) { if (roundedCorners) g.drawRoundRect(x, y, width, height, thickness, thickness); else g.drawRect(x, y, width, height); x += 1; y += 1; width -= 2; height -= 2; } } finally { g.setColor(oldColor); } }
| 11,534
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Color oldColor = g.getColor(); try { g.setColor(lineColor); /* If width and height were not adjusted, the border would * appear one pixel too large in both directions. */ width -= 1; height -= 1; /* Blurred, too large appearance * ----------------------------- * While Java 2D has introduced line strokes of arbitrary width, * it seems desirable to keep this code independent of Java 2D. * Therefore, multiple nested rectangles (or rounded rectangles) * are drawn in order to simulate a line whose thickness is * greater than one pixel. * * This hack causes a blurred appearance when anti-aliasing is * on. Interestingly enough, though, the Sun JDK 1.3.1 (at least * on MacOS X 10.1.5) shows exactly the same appearance under * this condition. It thus seems likely that Sun does the same * hack for simulating thick lines. For this reason, the * blurred appearance seems acceptable -- especially since GNU * Classpath tries to be compatible with the Sun reference * implementation. */ for (int i = 0; i < thickness; i++) { if (roundedCorners) g.drawRoundRect(x, y, width, height, thickness, thickness); else g.drawRect(x, y, width, height); x += 1; y += 1; width -= 2; height -= 2; } } finally { g.setColor(oldColor); } }
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Color oldColor = g.getColor(); try { g.setColor(lineColor); /* If width and height were not adjusted, the border would * appear one pixel too large in both directions. */ width -= 1; height -= 1; /* Blurred, too large appearance * ----------------------------- * While Java 2D has introduced line strokes of arbitrary width, * it seems desirable to keep this code independent of Java 2D. * Therefore, multiple nested rectangles (or rounded rectangles) * are drawn in order to simulate a line whose thickness is * greater than one pixel. * * This hack causes a blurred appearance when anti-aliasing is * on. Interestingly enough, though, the Sun JDK 1.3.1 (at least * on MacOS X 10.1.5) shows exactly the same appearance under * this condition. It thus seems likely that Sun does the same * hack for simulating thick lines. For this reason, the * blurred appearance seems acceptable -- especially since GNU * Classpath tries to be compatible with the Sun reference * implementation. */ for (int i = 0; i < thickness; i++) { if (roundedCorners) g.drawRoundRect(x, y, width, height, thickness, thickness); else g.drawRect(x, y, width, height); x += 1; y += 1; width -= 2; height -= 2; } } finally { g.setColor(oldColor); } }
| 11,535
|
private void init () { classXDFNodeName = "ParameterGroup"; }
|
private void init () { classXDFNodeName = "parameterGroup"; }
| 11,536
|
public void paint(Graphics g) { super.paint(g); Insets insets = getInsets(); Rectangle bounds = getBounds(); int x = insets.left + (bounds.width - insets.left - insets.right - defaultSize) / 2; int y = insets.top + (bounds.height - insets.left - insets.right - defaultSize) / 2; paintTriangle(g, x, y, defaultSize, direction, isEnabled()); }
|
public void paint(Graphics g) { super.paint(g); Rectangle bounds = getBounds(); int x = insets.left + (bounds.width - insets.left - insets.right - defaultSize) / 2; int y = insets.top + (bounds.height - insets.left - insets.right - defaultSize) / 2; paintTriangle(g, x, y, defaultSize, direction, isEnabled()); }
| 11,537
|
public void paint(Graphics g) { super.paint(g); Insets insets = getInsets(); Rectangle bounds = getBounds(); int x = insets.left + (bounds.width - insets.left - insets.right - defaultSize) / 2; int y = insets.top + (bounds.height - insets.left - insets.right - defaultSize) / 2; paintTriangle(g, x, y, defaultSize, direction, isEnabled()); }
|
public void paint(Graphics g) { super.paint(g); Insets insets = getInsets(); Rectangle bounds = getBounds(); int x = insets.left + (bounds.width - insets.left - insets.right - defaultSize) / 2; int y = insets.top + (bounds.height - insets.left - insets.right - defaultSize) / 2; paintTriangle(g, x, y, defaultSize, direction, isEnabled()); }
| 11,538
|
public void paintTriangle(Graphics g, int x, int y, int size, int direction, boolean isEnabled) { Polygon arrow = null; switch (direction) { case NORTH: arrow = upIcon; break; case SOUTH: arrow = downIcon; break; case EAST: case RIGHT: arrow = rightIcon; break; case WEST: case LEFT: arrow = leftIcon; break; } int[] xPoints = arrow.xpoints; int[] yPoints = arrow.ypoints; int x1; int y1; int x2; int y2; x1 = y1 = x2 = y2 = 0; if (size != defaultSize) { float scale = size * 1f / defaultSize; for (int i = 0; i < 3; i++) { xPoints[i] *= scale; yPoints[i] *= scale; } } g.translate(x, y); switch (direction) { case NORTH: x1 = xPoints[0] + 2; y1 = yPoints[0]; y2 = y1; x2 = xPoints[2] - 1; break; case SOUTH: x1 = xPoints[1]; y1 = yPoints[1]; x2 = xPoints[2]; y2 = yPoints[2]; break; case LEFT: case WEST: x1 = xPoints[0] + 1; y1 = yPoints[0] + 1; x2 = x1; y2 = yPoints[2] + 1; break; case RIGHT: case EAST: x1 = xPoints[2]; y1 = yPoints[2] + 1; x2 = xPoints[1] - 1; y2 = yPoints[1] + 1; break; } Color saved = g.getColor(); if (isEnabled) { g.setColor(Color.DARK_GRAY); if (arrow != null) g.fillPolygon(xPoints, yPoints, 3); } else { g.setColor(Color.GRAY); g.fillPolygon(xPoints, yPoints, 3); g.setColor(Color.WHITE); g.drawLine(x1, y1, x2, y2); } g.setColor(saved); g.translate(-x, -y); }
|
public void paintTriangle(Graphics g, int x, int y, int size, int direction, boolean isEnabled) { Color savedColor = g.getColor(); switch (direction) { case NORTH: arrow = upIcon; break; case SOUTH: arrow = downIcon; break; case EAST: case RIGHT: arrow = rightIcon; break; case WEST: case LEFT: arrow = leftIcon; break; } int[] xPoints = arrow.xpoints; int[] yPoints = arrow.ypoints; int x1; int y1; int x2; int y2; x1 = y1 = x2 = y2 = 0; if (size != defaultSize) { float scale = size * 1f / defaultSize; for (int i = 0; i < 3; i++) { xPoints[i] *= scale; yPoints[i] *= scale; } } g.translate(x, y); switch (direction) { case NORTH: x1 = xPoints[0] + 2; y1 = yPoints[0]; y2 = y1; x2 = xPoints[2] - 1; break; case SOUTH: x1 = xPoints[1]; y1 = yPoints[1]; x2 = xPoints[2]; y2 = yPoints[2]; break; case LEFT: case WEST: x1 = xPoints[0] + 1; y1 = yPoints[0] + 1; x2 = x1; y2 = yPoints[2] + 1; break; case RIGHT: case EAST: x1 = xPoints[2]; y1 = yPoints[2] + 1; x2 = xPoints[1] - 1; y2 = yPoints[1] + 1; break; } Color saved = g.getColor(); if (isEnabled) { g.setColor(Color.DARK_GRAY); if (arrow != null) g.fillPolygon(xPoints, yPoints, 3); } else { g.setColor(Color.GRAY); g.fillPolygon(xPoints, yPoints, 3); g.setColor(Color.WHITE); g.drawLine(x1, y1, x2, y2); } g.setColor(saved); g.translate(-x, -y); }
| 11,539
|
public void paintTriangle(Graphics g, int x, int y, int size, int direction, boolean isEnabled) { Polygon arrow = null; switch (direction) { case NORTH: arrow = upIcon; break; case SOUTH: arrow = downIcon; break; case EAST: case RIGHT: arrow = rightIcon; break; case WEST: case LEFT: arrow = leftIcon; break; } int[] xPoints = arrow.xpoints; int[] yPoints = arrow.ypoints; int x1; int y1; int x2; int y2; x1 = y1 = x2 = y2 = 0; if (size != defaultSize) { float scale = size * 1f / defaultSize; for (int i = 0; i < 3; i++) { xPoints[i] *= scale; yPoints[i] *= scale; } } g.translate(x, y); switch (direction) { case NORTH: x1 = xPoints[0] + 2; y1 = yPoints[0]; y2 = y1; x2 = xPoints[2] - 1; break; case SOUTH: x1 = xPoints[1]; y1 = yPoints[1]; x2 = xPoints[2]; y2 = yPoints[2]; break; case LEFT: case WEST: x1 = xPoints[0] + 1; y1 = yPoints[0] + 1; x2 = x1; y2 = yPoints[2] + 1; break; case RIGHT: case EAST: x1 = xPoints[2]; y1 = yPoints[2] + 1; x2 = xPoints[1] - 1; y2 = yPoints[1] + 1; break; } Color saved = g.getColor(); if (isEnabled) { g.setColor(Color.DARK_GRAY); if (arrow != null) g.fillPolygon(xPoints, yPoints, 3); } else { g.setColor(Color.GRAY); g.fillPolygon(xPoints, yPoints, 3); g.setColor(Color.WHITE); g.drawLine(x1, y1, x2, y2); } g.setColor(saved); g.translate(-x, -y); }
|
public void paintTriangle(Graphics g, int x, int y, int size, int direction, boolean isEnabled) { Polygon arrow = null; switch (direction) { case NORTH: arrow = upIcon; break; case SOUTH: arrow = downIcon; break; case EAST: case RIGHT: arrow = rightIcon; break; case WEST: case LEFT: arrow = leftIcon; break; } int[] xPoints = arrow.xpoints; int[] yPoints = arrow.ypoints; int x1; int y1; int x2; int y2; x1 = y1 = x2 = y2 = 0; if (size != defaultSize) { float scale = size * 1f / defaultSize; for (int i = 0; i < 3; i++) { xPoints[i] *= scale; yPoints[i] *= scale; } } g.translate(x, y); switch (direction) { case NORTH: x1 = xPoints[0] + 2; y1 = yPoints[0]; y2 = y1; x2 = xPoints[2] - 1; break; case SOUTH: x1 = xPoints[1]; y1 = yPoints[1]; x2 = xPoints[2]; y2 = yPoints[2]; break; case LEFT: case WEST: x1 = xPoints[0] + 1; y1 = yPoints[0] + 1; x2 = x1; y2 = yPoints[2] + 1; break; case RIGHT: case EAST: x1 = xPoints[2]; y1 = yPoints[2] + 1; x2 = xPoints[1] - 1; y2 = yPoints[1] + 1; break; } Color saved = g.getColor(); if (isEnabled) { g.setColor(Color.DARK_GRAY); if (arrow != null) g.fillPolygon(xPoints, yPoints, 3); } else { g.setColor(Color.GRAY); g.fillPolygon(xPoints, yPoints, 3); g.setColor(Color.WHITE); g.drawLine(x1, y1, x2, y2); } g.setColor(saved); g.translate(-x, -y); }
| 11,540
|
public void paintTriangle(Graphics g, int x, int y, int size, int direction, boolean isEnabled) { Polygon arrow = null; switch (direction) { case NORTH: arrow = upIcon; break; case SOUTH: arrow = downIcon; break; case EAST: case RIGHT: arrow = rightIcon; break; case WEST: case LEFT: arrow = leftIcon; break; } int[] xPoints = arrow.xpoints; int[] yPoints = arrow.ypoints; int x1; int y1; int x2; int y2; x1 = y1 = x2 = y2 = 0; if (size != defaultSize) { float scale = size * 1f / defaultSize; for (int i = 0; i < 3; i++) { xPoints[i] *= scale; yPoints[i] *= scale; } } g.translate(x, y); switch (direction) { case NORTH: x1 = xPoints[0] + 2; y1 = yPoints[0]; y2 = y1; x2 = xPoints[2] - 1; break; case SOUTH: x1 = xPoints[1]; y1 = yPoints[1]; x2 = xPoints[2]; y2 = yPoints[2]; break; case LEFT: case WEST: x1 = xPoints[0] + 1; y1 = yPoints[0] + 1; x2 = x1; y2 = yPoints[2] + 1; break; case RIGHT: case EAST: x1 = xPoints[2]; y1 = yPoints[2] + 1; x2 = xPoints[1] - 1; y2 = yPoints[1] + 1; break; } Color saved = g.getColor(); if (isEnabled) { g.setColor(Color.DARK_GRAY); if (arrow != null) g.fillPolygon(xPoints, yPoints, 3); } else { g.setColor(Color.GRAY); g.fillPolygon(xPoints, yPoints, 3); g.setColor(Color.WHITE); g.drawLine(x1, y1, x2, y2); } g.setColor(saved); g.translate(-x, -y); }
|
public void paintTriangle(Graphics g, int x, int y, int size, int direction, boolean isEnabled) { Polygon arrow = null; switch (direction) { case NORTH: arrow = upIcon; break; case SOUTH: arrow = downIcon; break; case EAST: case RIGHT: arrow = rightIcon; break; case WEST: case LEFT: arrow = leftIcon; break; } int[] xPoints = arrow.xpoints; int[] yPoints = arrow.ypoints; int x1; int y1; int x2; int y2; x1 = y1 = x2 = y2 = 0; if (size != defaultSize) { float scale = size * 1f / defaultSize; for (int i = 0; i < 3; i++) { xPoints[i] *= scale; yPoints[i] *= scale; } } g.translate(x, y); switch (direction) { case NORTH: x1 = xPoints[0] + 2; y1 = yPoints[0]; y2 = y1; x2 = xPoints[2] - 1; break; case SOUTH: x1 = xPoints[1]; y1 = yPoints[1]; x2 = xPoints[2]; y2 = yPoints[2]; break; case LEFT: case WEST: x1 = xPoints[0] + 1; y1 = yPoints[0] + 1; x2 = x1; y2 = yPoints[2] + 1; break; case RIGHT: case EAST: x1 = xPoints[2]; y1 = yPoints[2] + 1; x2 = xPoints[1] - 1; y2 = yPoints[1] + 1; break; } Color saved = g.getColor(); if (isEnabled) { g.setColor(Color.DARK_GRAY); if (arrow != null) g.fillPolygon(xPoints, yPoints, 3); } else { g.setColor(Color.GRAY); g.fillPolygon(xPoints, yPoints, 3); g.setColor(Color.WHITE); g.drawLine(x1, y1, x2, y2); } g.setColor(saved); g.translate(-x, -y); }
| 11,541
|
public void paintTriangle(Graphics g, int x, int y, int size, int direction, boolean isEnabled) { Polygon arrow = null; switch (direction) { case NORTH: arrow = upIcon; break; case SOUTH: arrow = downIcon; break; case EAST: case RIGHT: arrow = rightIcon; break; case WEST: case LEFT: arrow = leftIcon; break; } int[] xPoints = arrow.xpoints; int[] yPoints = arrow.ypoints; int x1; int y1; int x2; int y2; x1 = y1 = x2 = y2 = 0; if (size != defaultSize) { float scale = size * 1f / defaultSize; for (int i = 0; i < 3; i++) { xPoints[i] *= scale; yPoints[i] *= scale; } } g.translate(x, y); switch (direction) { case NORTH: x1 = xPoints[0] + 2; y1 = yPoints[0]; y2 = y1; x2 = xPoints[2] - 1; break; case SOUTH: x1 = xPoints[1]; y1 = yPoints[1]; x2 = xPoints[2]; y2 = yPoints[2]; break; case LEFT: case WEST: x1 = xPoints[0] + 1; y1 = yPoints[0] + 1; x2 = x1; y2 = yPoints[2] + 1; break; case RIGHT: case EAST: x1 = xPoints[2]; y1 = yPoints[2] + 1; x2 = xPoints[1] - 1; y2 = yPoints[1] + 1; break; } Color saved = g.getColor(); if (isEnabled) { g.setColor(Color.DARK_GRAY); if (arrow != null) g.fillPolygon(xPoints, yPoints, 3); } else { g.setColor(Color.GRAY); g.fillPolygon(xPoints, yPoints, 3); g.setColor(Color.WHITE); g.drawLine(x1, y1, x2, y2); } g.setColor(saved); g.translate(-x, -y); }
|
public void paintTriangle(Graphics g, int x, int y, int size, int direction, boolean isEnabled) { Polygon arrow = null; switch (direction) { case NORTH: arrow = upIcon; break; case SOUTH: arrow = downIcon; break; case EAST: case RIGHT: arrow = rightIcon; break; case WEST: case LEFT: arrow = leftIcon; break; } int[] xPoints = arrow.xpoints; int[] yPoints = arrow.ypoints; int x1; int y1; int x2; int y2; x1 = y1 = x2 = y2 = 0; if (size != defaultSize) { float scale = size * 1f / defaultSize; for (int i = 0; i < 3; i++) { xPoints[i] *= scale; yPoints[i] *= scale; } } g.translate(x, y); switch (direction) { case NORTH: x1 = xPoints[0] + 2; y1 = yPoints[0]; y2 = y1; x2 = xPoints[2] - 1; break; case SOUTH: x1 = xPoints[1]; y1 = yPoints[1]; x2 = xPoints[2]; y2 = yPoints[2]; break; case LEFT: case WEST: x1 = xPoints[0] + 1; y1 = yPoints[0] + 1; x2 = x1; y2 = yPoints[2] + 1; break; case RIGHT: case EAST: x1 = xPoints[2]; y1 = yPoints[2] + 1; x2 = xPoints[1] - 1; y2 = yPoints[1] + 1; break; } Color saved = g.getColor(); if (isEnabled) { g.setColor(Color.DARK_GRAY); if (arrow != null) g.fillPolygon(xPoints, yPoints, 3); } else { g.setColor(Color.GRAY); g.fillPolygon(xPoints, yPoints, 3); g.setColor(Color.WHITE); g.drawLine(x1, y1, x2, y2); } g.setColor(saved); g.translate(-x, -y); }
| 11,542
|
public void paintTriangle(Graphics g, int x, int y, int size, int direction, boolean isEnabled) { Polygon arrow = null; switch (direction) { case NORTH: arrow = upIcon; break; case SOUTH: arrow = downIcon; break; case EAST: case RIGHT: arrow = rightIcon; break; case WEST: case LEFT: arrow = leftIcon; break; } int[] xPoints = arrow.xpoints; int[] yPoints = arrow.ypoints; int x1; int y1; int x2; int y2; x1 = y1 = x2 = y2 = 0; if (size != defaultSize) { float scale = size * 1f / defaultSize; for (int i = 0; i < 3; i++) { xPoints[i] *= scale; yPoints[i] *= scale; } } g.translate(x, y); switch (direction) { case NORTH: x1 = xPoints[0] + 2; y1 = yPoints[0]; y2 = y1; x2 = xPoints[2] - 1; break; case SOUTH: x1 = xPoints[1]; y1 = yPoints[1]; x2 = xPoints[2]; y2 = yPoints[2]; break; case LEFT: case WEST: x1 = xPoints[0] + 1; y1 = yPoints[0] + 1; x2 = x1; y2 = yPoints[2] + 1; break; case RIGHT: case EAST: x1 = xPoints[2]; y1 = yPoints[2] + 1; x2 = xPoints[1] - 1; y2 = yPoints[1] + 1; break; } Color saved = g.getColor(); if (isEnabled) { g.setColor(Color.DARK_GRAY); if (arrow != null) g.fillPolygon(xPoints, yPoints, 3); } else { g.setColor(Color.GRAY); g.fillPolygon(xPoints, yPoints, 3); g.setColor(Color.WHITE); g.drawLine(x1, y1, x2, y2); } g.setColor(saved); g.translate(-x, -y); }
|
public void paintTriangle(Graphics g, int x, int y, int size, int direction, boolean isEnabled) { Polygon arrow = null; switch (direction) { case NORTH: arrow = upIcon; break; case SOUTH: arrow = downIcon; break; case EAST: case RIGHT: arrow = rightIcon; break; case WEST: case LEFT: arrow = leftIcon; break; } int[] xPoints = arrow.xpoints; int[] yPoints = arrow.ypoints; int x1; int y1; int x2; int y2; x1 = y1 = x2 = y2 = 0; if (size != defaultSize) { float scale = size * 1f / defaultSize; for (int i = 0; i < 3; i++) { xPoints[i] *= scale; yPoints[i] *= scale; } } g.translate(x, y); switch (direction) { case NORTH: x1 = xPoints[0] + 2; y1 = yPoints[0]; y2 = y1; x2 = xPoints[2] - 1; break; case SOUTH: x1 = xPoints[1]; y1 = yPoints[1]; x2 = xPoints[2]; y2 = yPoints[2]; break; case LEFT: case WEST: x1 = xPoints[0] + 1; y1 = yPoints[0] + 1; x2 = x1; y2 = yPoints[2] + 1; break; case RIGHT: case EAST: x1 = xPoints[2]; y1 = yPoints[2] + 1; x2 = xPoints[1] - 1; y2 = yPoints[1] + 1; break; } Color saved = g.getColor(); if (isEnabled) { g.setColor(Color.DARK_GRAY); if (arrow != null) g.fillPolygon(xPoints, yPoints, 3); } else { g.setColor(Color.GRAY); g.fillPolygon(xPoints, yPoints, 3); g.setColor(Color.WHITE); g.drawLine(x1, y1, x2, y2); } g.setColor(saved); g.translate(-x, -y); }
| 11,543
|
public void paintTriangle(Graphics g, int x, int y, int size, int direction, boolean isEnabled) { Polygon arrow = null; switch (direction) { case NORTH: arrow = upIcon; break; case SOUTH: arrow = downIcon; break; case EAST: case RIGHT: arrow = rightIcon; break; case WEST: case LEFT: arrow = leftIcon; break; } int[] xPoints = arrow.xpoints; int[] yPoints = arrow.ypoints; int x1; int y1; int x2; int y2; x1 = y1 = x2 = y2 = 0; if (size != defaultSize) { float scale = size * 1f / defaultSize; for (int i = 0; i < 3; i++) { xPoints[i] *= scale; yPoints[i] *= scale; } } g.translate(x, y); switch (direction) { case NORTH: x1 = xPoints[0] + 2; y1 = yPoints[0]; y2 = y1; x2 = xPoints[2] - 1; break; case SOUTH: x1 = xPoints[1]; y1 = yPoints[1]; x2 = xPoints[2]; y2 = yPoints[2]; break; case LEFT: case WEST: x1 = xPoints[0] + 1; y1 = yPoints[0] + 1; x2 = x1; y2 = yPoints[2] + 1; break; case RIGHT: case EAST: x1 = xPoints[2]; y1 = yPoints[2] + 1; x2 = xPoints[1] - 1; y2 = yPoints[1] + 1; break; } Color saved = g.getColor(); if (isEnabled) { g.setColor(Color.DARK_GRAY); if (arrow != null) g.fillPolygon(xPoints, yPoints, 3); } else { g.setColor(Color.GRAY); g.fillPolygon(xPoints, yPoints, 3); g.setColor(Color.WHITE); g.drawLine(x1, y1, x2, y2); } g.setColor(saved); g.translate(-x, -y); }
|
public void paintTriangle(Graphics g, int x, int y, int size, int direction, boolean isEnabled) { Polygon arrow = null; switch (direction) { case NORTH: arrow = upIcon; break; case SOUTH: arrow = downIcon; break; case EAST: case RIGHT: arrow = rightIcon; break; case WEST: case LEFT: arrow = leftIcon; break; } int[] xPoints = arrow.xpoints; int[] yPoints = arrow.ypoints; int x1; int y1; int x2; int y2; x1 = y1 = x2 = y2 = 0; if (size != defaultSize) { float scale = size * 1f / defaultSize; for (int i = 0; i < 3; i++) { xPoints[i] *= scale; yPoints[i] *= scale; } } g.translate(x, y); switch (direction) { case NORTH: x1 = xPoints[0] + 2; y1 = yPoints[0]; y2 = y1; x2 = xPoints[2] - 1; break; case SOUTH: x1 = xPoints[1]; y1 = yPoints[1]; x2 = xPoints[2]; y2 = yPoints[2]; break; case LEFT: case WEST: x1 = xPoints[0] + 1; y1 = yPoints[0] + 1; x2 = x1; y2 = yPoints[2] + 1; break; case RIGHT: case EAST: x1 = xPoints[2]; y1 = yPoints[2] + 1; x2 = xPoints[1] - 1; y2 = yPoints[1] + 1; break; } Color saved = g.getColor(); if (isEnabled) { g.setColor(Color.DARK_GRAY); if (arrow != null) g.fillPolygon(xPoints, yPoints, 3); } else { g.setColor(Color.GRAY); g.fillPolygon(xPoints, yPoints, 3); g.setColor(Color.WHITE); g.drawLine(x1, y1, x2, y2); } g.setColor(saved); g.translate(-x, -y); }
| 11,544
|
public Any to_any() { if (isNull) { Any a0 = createAny(); a0.type(orb.get_primitive_tc(TCKind.tk_null)); return a0; } else { try { ValueFactory factory = ((org.omg.CORBA_2_3.ORB) orb).lookup_value_factory(official_type.id()); if (factory == null) throw new MARSHAL("Factory for " + official_type.id() + " not registered." ); OutputStream out = orb.create_output_stream(); for (int i = 0; i < array.length; i++) array [ i ].to_any().write_value(out); org.omg.CORBA_2_3.portable.InputStream in = (org.omg.CORBA_2_3.portable.InputStream) out.create_input_stream(); Serializable v = factory.read_value(in); Any g = createAny(); g.type(official_type); g.insert_Value(v, official_type); return g; } catch (Exception e) { throw new Unexpected(e); } } }
|
public Any to_any() { if (isNull) { Any a0 = createAny(); a0.type(orb.get_primitive_tc(TCKind.tk_null)); return a0; } else { try { ValueFactory factory = ((org.omg.CORBA_2_3.ORB) orb).lookup_value_factory(official_type.id()); if (factory == null) throw new MARSHAL("Factory for " + official_type.id() + " not registered." ); OutputStream out = orb.create_output_stream(); for (int i = 0; i < array.length; i++) array [ i ].to_any().write_value(out); org.omg.CORBA_2_3.portable.InputStream in = (org.omg.CORBA_2_3.portable.InputStream) out.create_input_stream(); Serializable v = factory.read_value(in); Any g = createAny(); g.type(official_type); g.insert_Value(v, official_type); return g; } catch (Exception e) { throw new Unexpected(e); } } }
| 11,545
|
public void run();
|
public void run();
| 11,546
|
private void ensureEntries() throws IOException { try { if (entries == null) { entries = new HashMap<String, FTPFSEntry>(); FTPFile[] ftpFiles = null; synchronized(fileSystem){ ftpFiles = fileSystem.listFiles(path()); } for (FTPFile f : ftpFiles) { FTPFSEntry e = f.isDirectory() ? new FTPFSDirectory(fileSystem, f) : new FTPFSFile(fileSystem, f); e.setParent(this); entries.put(f.getName(), e); } } } catch (Exception e) { e.printStackTrace(); throw new IOException("Read error"); } }
|
private void ensureEntries() throws IOException { try { if (entries == null) { entries = new HashMap<String, FTPFSEntry>(); FTPFile[] ftpFiles = null; synchronized(fileSystem){ ftpFiles = fileSystem.dirDetails(path()); } for (FTPFile f : ftpFiles) { FTPFSEntry e = f.isDirectory() ? new FTPFSDirectory(fileSystem, f) : new FTPFSFile(fileSystem, f); e.setParent(this); entries.put(f.getName(), e); } } } catch (Exception e) { e.printStackTrace(); throw new IOException("Read error"); } }
| 11,547
|
private void ensureEntries() throws IOException { try { if (entries == null) { entries = new HashMap<String, FTPFSEntry>(); FTPFile[] ftpFiles = null; synchronized(fileSystem){ ftpFiles = fileSystem.listFiles(path()); } for (FTPFile f : ftpFiles) { FTPFSEntry e = f.isDirectory() ? new FTPFSDirectory(fileSystem, f) : new FTPFSFile(fileSystem, f); e.setParent(this); entries.put(f.getName(), e); } } } catch (Exception e) { e.printStackTrace(); throw new IOException("Read error"); } }
|
private void ensureEntries() throws IOException { try { if (entries == null) { entries = new HashMap<String, FTPFSEntry>(); FTPFile[] ftpFiles = null; synchronized(fileSystem){ ftpFiles = fileSystem.listFiles(path()); } for (FTPFile f : ftpFiles) { FTPFSEntry e = f.isDir() ? new FTPFSDirectory(fileSystem, f) : new FTPFSFile(fileSystem, f); e.setParent(this); entries.put(f.getName(), e); } } } catch (Exception e) { e.printStackTrace(); throw new IOException("Read error"); } }
| 11,548
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.