perfsonar-dev - r175 - in trunk/nmwg/java/org/ggf/ns/nmwg: base/v2_0 topology/base/v3_0 topology/l2/v3_0 topology/l3/v3_0 topology/l4/v3_0
Subject: perfsonar development work
List archive
r175 - in trunk/nmwg/java/org/ggf/ns/nmwg: base/v2_0 topology/base/v3_0 topology/l2/v3_0 topology/l3/v3_0 topology/l4/v3_0
Chronological Thread
- From:
- To: ,
- Subject: r175 - in trunk/nmwg/java/org/ggf/ns/nmwg: base/v2_0 topology/base/v3_0 topology/l2/v3_0 topology/l3/v3_0 topology/l4/v3_0
- Date: Mon, 30 Oct 2006 11:30:29 -0500
Author: zurawski
Date: 2006-10-30 11:30:28 -0500 (Mon, 30 Oct 2006)
New Revision: 175
Added:
trunk/nmwg/java/org/ggf/ns/nmwg/topology/base/v3_0/Address.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Capacity.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/IfDescription.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/IfIndex.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/IfName.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Type.java
Removed:
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/AuthRealm.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/AuthRealm.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Capacity.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/IfDescription.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/IfIndex.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/IfName.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Type.java
Modified:
trunk/nmwg/java/org/ggf/ns/nmwg/base/v2_0/Handler.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Address.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Capacity.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Description.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/GlobalName.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/IfHostName.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/IfIndex.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Index.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Interface.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Link.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Name.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Network.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Path.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Role.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Type.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Vlan.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Asn.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/GlobalName.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/IfAddress.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/IfHostName.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Index.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Interface.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/IpAddress.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Link.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Name.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Netmask.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Network.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Path.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Role.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Subnet.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l4/v3_0/Address.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l4/v3_0/EndPoint.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l4/v3_0/EndPointPair.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l4/v3_0/Path.java
trunk/nmwg/java/org/ggf/ns/nmwg/topology/l4/v3_0/Role.java
Log:
Topology element fixes to allow for extensions and casting. Removal of
'AuthRealm' as well (not necessary for Link elements).
-jason
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/base/v2_0/Handler.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/base/v2_0/Handler.java 2006-10-27
19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/base/v2_0/Handler.java 2006-10-30
16:30:28 UTC (rev 175)
@@ -146,7 +146,7 @@
if(newElement != null) {
-//System.out.println("class is " + newElement.getClass());
+//System.out.println("[start] class is " + newElement.getClass());
// push last seen element on stack
@@ -160,8 +160,7 @@
//XXX
//ref by id?
- ht.put(newElement.getId(), newElement);
-
+ ht.put(newElement.getId(), newElement);
}
@@ -180,52 +179,43 @@
//System.out.println("Element: " + top.getClass() + "\n");
-//System.out.println("Parent: " + top.getParent() + "\n");
-
/**
* A Hack for now, we only want to output xml when we pop off
the
* root element.
*/
/*comment out this section*/
-
-
-/*
+/*
if(top.getLocalName().equals("message") ||
top.getLocalName().equals("store")) {
FileOutputStream fos;
OutputFormat of;
XMLSerializer serializer;
- ContentHandler hd;
+ ContentHandler hd;
try {
fos = new FileOutputStream("output.xml");
of = new OutputFormat("XML","UTF-8",true);
of.setIndent(1);
of.setIndenting(true);
-
+
serializer = new XMLSerializer(fos,of);
hd = serializer.asContentHandler();
hd.startDocument();
-
+
// to xml function
nss = new NamespaceSupport();
hd = top.toXML(hd, nss);
hd.endDocument();
-
- fos.close();
-
+ fos.close();
}
catch(Exception e) {
System.err.println("Error: xml writing error
--> " + e.toString());
- }
-
-
+ }
}
*/
-
/* **************************************
*
* testing a dom format...
@@ -234,7 +224,7 @@
/*
if(top.getLocalName().equals("message") ||
top.getLocalName().equals("store")) {
try {
-//System.out.println("DOM TEST:");
+System.out.println("DOM TEST:");
DocumentBuilder builder =
DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = builder.newDocument();
@@ -243,10 +233,9 @@
Result output = new StreamResult(System.out);
doc = top.getDOM(doc);
DOMSource source = new DOMSource(doc);
-//xformer.transform(source,output);
+xformer.transform(source,output);
-
-//System.out.println("END DOM TEST:");
+System.out.println("END DOM TEST:");
}
catch(Exception e) {
System.err.println("XML DOM Error");
Added: trunk/nmwg/java/org/ggf/ns/nmwg/topology/base/v3_0/Address.java
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Address.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Address.java
2006-10-27 19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Address.java
2006-10-30 16:30:28 UTC (rev 175)
@@ -16,27 +16,9 @@
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.NamespaceSupport;
-import org.ggf.ns.nmwg.base.v2_0.Element;
+public class Address extends org.ggf.ns.nmwg.topology.base.v3_0.Address {
-public class Address extends Element {
-
/**
- * address value
- */
- protected String address;
-
- /**
- * attribute for type
- */
- protected String type;
-
- /**
- * Lets us know if we are using an attribute or
- * a text element.
- */
- protected boolean useText;
-
- /**
* Constructor.
*/
public Address() {
@@ -44,202 +26,9 @@
type = "";
localName = "address";
uri = "http://ggf.org/ns/nmwg/topology/l2/3.0/";
- qName = "nmwgtopo3:address";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol2:address";
+ prefix = "nmwgtopol2";
fileName = "org/ggf/ns/nmwg/topology/l2/v3_0/Address.java";
useText = false;
}
-
- /**
- * returns the value of the useText variable
- */
- public boolean getUseText() {
- return useText;
- }
-
- /**
- * Sets the value of the useText variable
- */
- public void setUseText() {
- useText = true;
- }
-
- /**
- * Un-sets the value of the useText variable
- */
- public void unSetUseText() {
- useText = false;
- }
-
-
- /**
- * Returns the Address value.
- */
- public String getAddress() {
- return address;
- }
-
- /**
- * Sets the Address value.
- */
- public void setAddress(String newAddress) {
- address = newAddress;
- }
-
- /**
- * Returns the type value.
- */
- public String getType() {
- return type;
- }
-
- /**
- * Sets the type value.
- */
- public void setType(String newType) {
- type = newType;
- }
-
- /**
- * Called when a text element is encountered, a
- * check is forced to be sure we do not enter
- * whitespace.
- */
- public boolean addText(String text) {
- String clean = text.trim();
- if(!(text.equals(""))) {
- setAddress(text);
- setUseText();
- }
- else {
- System.err.println("Error: " + getFileName() + "
address can't have a witespace value.");
- return false;
- }
- return true;
- }
-
- /**
- * Only care about the type attribute.
- */
- public boolean addAttr(String attr, String value, NamespaceSupport
nss) {
- if(attr.equals("type")) {
- setType(value);
- }
- else if(attr.equals("value")) {
- setAddress(value);
- }
- else if(attr.indexOf("xmlns") >= 0) {
- if(attr.split(":").length == 1) {
- if(nss.getURI("") == null) {
- nss.declarePrefix("", value);
- }
- if((prefix.equals("")) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- else {
- if(nss.getURI(attr.split(":")[1]) == null) {
- nss.declarePrefix(attr.split(":")[1],
value);
- }
- if((prefix.equals(attr.split(":")[1])) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
addAttr(String, String, NamespaceSupport) unrecognized attribute pair: " +
attr + " - " + value);
- return false;
- }
- return true;
- }
-
- /**
- * Converts the contents of this object into an xml tag.
- */
- public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
- try {
- handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
-
- if(getUseText()) {
- if(!(address.equals(""))) {
-
handler.characters(address.toCharArray(),0,address.length());
- }
- }
-
- handler.endElement(getUri(), getLocalName(),
getQName());
-
- if(getCompleted()) {
- nss.popContext();
- unSetCompleted();
- }
- }
- catch(Exception e) {
- System.err.println("Error: " + getFileName() + "
toXML(ContentHandler, NamespaceSupport) XML formulation error.");
- }
- return handler;
- }
-
- /**
- * Converts items into attributes for an xml tag.
- */
- public AttributesImpl getAttributes(NamespaceSupport nss) {
- AttributesImpl atts = new AttributesImpl();
-
- if(nss.getURI(getPrefix()) == null) {
- nss.pushContext();
- if(getPrefix().equals("")) {
- atts.addAttribute(getUri(), "xmlns", "xmlns",
"CDATA", getUri());
- }
- else {
- atts.addAttribute(getUri(), "xmlns:" +
getPrefix(), "xmlns:" + getPrefix(), "CDATA", getUri());
- }
- nss.declarePrefix(getPrefix(), getUri());
- setCompleted();
- }
-
- if(!(getUseText())) {
- if(!(getAddress().equals(""))) {
- atts.addAttribute(getUri(), "value", "value",
"CDATA", getAddress());
- }
- }
- if(!(getType().equals(""))) {
- atts.addAttribute(getUri(), "type", "type", "CDATA",
getType());
- }
- return atts;
- }
-
- /**
- * Given a DOM element (a parent), construct
- * the children elements.
- */
- public void getDOM(org.w3c.dom.Element parent) {
- org.w3c.dom.Document doc = parent.getOwnerDocument();
- org.w3c.dom.Element ipaddr =
doc.createElement(getLocalName());
- ipaddr = doc.createElementNS(getUri(), getQName());
- parent.appendChild(ipaddr);
-
- if(!(getType().equals(""))) {
- ipaddr.setAttribute("type", getType());
- }
-
- if(!(getAddress().equals(""))) {
- if(getUseText()) {
- org.w3c.dom.Text ipaddrtext =
doc.createTextNode(getAddress());
- ipaddr.appendChild(ipaddrtext);
- }
- else {
- ipaddr.setAttribute("value", getAddress());
- }
- }
- }
-
-
- /**
- * Called when the object is placed in
- * an output statement.
- */
- public String toString() {
- return getFileName() + ": ---> " + getAddress() + " type:" +
getType();
- }
-
}
Deleted: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/AuthRealm.java
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Capacity.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Capacity.java
2006-10-27 19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Capacity.java
2006-10-30 16:30:28 UTC (rev 175)
@@ -16,146 +16,17 @@
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.NamespaceSupport;
-import org.ggf.ns.nmwg.base.v2_0.Element;
+public class Capacity extends org.ggf.ns.nmwg.topology.base.v3_0.Capacity {
-public class Capacity extends Element {
-
/**
- * Description of an interface.
- */
- protected String capacity;
-
- /**
* Constructor.
*/
public Capacity() {
capacity = "";
localName = "capacity";
uri = "http://ggf.org/ns/nmwg/topology/l2/3.0/";
- qName = "nmwgtopo3:capacity";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol2:capacity";
+ prefix = "nmwgtopol2";
fileName = "org/ggf/ns/nmwg/topology/l2/v3_0/Capacity.java";
}
-
- /**
- * Returns the capacity value.
- */
- public String getCapacity() {
- return capacity;
- }
-
- /**
- * Sets the capacity value.
- */
- public void setCapacity(String newCapacity) {
- capacity = newCapacity;
- }
-
- /**
- * Not used in this element.
- */
- public boolean addAttr(String attr, String value, NamespaceSupport
nss) {
- if(attr.indexOf("xmlns") >= 0) {
- if(attr.split(":").length == 1) {
- if(nss.getURI("") == null) {
- nss.declarePrefix("", value);
- }
- if((prefix.equals("")) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- else {
- if(nss.getURI(attr.split(":")[1]) == null) {
- nss.declarePrefix(attr.split(":")[1],
value);
- }
- if((prefix.equals(attr.split(":")[1])) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
addAttr(String, String, NamespaceSupport) unrecognized attribute pair: " +
attr + " - " + value);
- return false;
- }
- return true;
- }
-
- /**
- * The text element is the value of this element.
- */
- public boolean addText(String text) {
- String clean = text.trim();
- if(!(text.equals(""))) {
- setCapacity(text);
- return true;
- }
- else {
- System.err.println("Error: " + getFileName() + "
capacity can't have a witespace value.");
- }
- return false;
- }
-
- /**
- * Converts the contents of this object into an xml tag.
- */
- public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
- try {
- handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
-
handler.characters(capacity.toCharArray(),0,capacity.length());
- handler.endElement(getUri(), getLocalName(),
getQName());
-
- if(getCompleted()) {
- nss.popContext();
- unSetCompleted();
- }
- }
- catch(Exception e) {
- System.err.println("Error: " + getFileName() + "
toXML(ContentHandler, NamespaceSupport) XML formulation error.");
- }
- return handler;
- }
-
- /**
- * Converts items into attributes for an xml tag.
- */
- public AttributesImpl getAttributes(NamespaceSupport nss) {
- AttributesImpl atts = new AttributesImpl();
-
- if(nss.getURI(getPrefix()) == null) {
- nss.pushContext();
- if(getPrefix().equals("")) {
- atts.addAttribute(getUri(), "xmlns", "xmlns",
"CDATA", getUri());
- }
- else {
- atts.addAttribute(getUri(), "xmlns:" +
getPrefix(), "xmlns:" + getPrefix(), "CDATA", getUri());
- }
- nss.declarePrefix(getPrefix(), getUri());
- setCompleted();
- }
-
- return atts;
- }
-
- /**
- * Given a DOM element (a parent), construct
- * the children elements.
- */
- public void getDOM(org.w3c.dom.Element parent) {
- org.w3c.dom.Document doc = parent.getOwnerDocument();
- if(!(getCapacity().equals(""))) {
- org.w3c.dom.Element capac =
doc.createElement(getLocalName());
- capac = doc.createElementNS(getUri(), getQName());
- parent.appendChild(capac);
- org.w3c.dom.Text capactext =
doc.createTextNode(getCapacity());
- capac.appendChild(capactext);
- }
- }
-
- /**
- * Called when the object is placed in
- * an output statement.
- */
- public String toString() {
- return getFileName() + ": ---> " + getCapacity();
- }
}
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Description.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Description.java
2006-10-27 19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Description.java
2006-10-30 16:30:28 UTC (rev 175)
@@ -14,144 +14,17 @@
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.NamespaceSupport;
-import org.ggf.ns.nmwg.base.v2_0.Element;
+public class Description extends
org.ggf.ns.nmwg.topology.base.v3_0.Description {
-public class Description extends Element {
-
- protected String description;
-
/**
* Constructor.
*/
public Description() {
- description = "";
-
+ description = "";
localName = "description";
uri = "http://ggf.org/ns/nmwg/topology/l2/3.0/";
- qName = "nmwgtopo3:description";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol2:description";
+ prefix = "nmwgtopol2";
fileName =
"org/ggf/ns/nmwg/topology/l2/v3_0/Description.java";
}
-
- /**
- * Returns the description value.
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Sets the description value.
- */
- public void setDescription(String newDescription) {
- description = newDescription;
- }
-
- /**
- * Not used in this element.
- */
- public boolean addAttr(String attr, String value, NamespaceSupport
nss) {
- if(attr.indexOf("xmlns") >= 0) {
- if(attr.split(":").length == 1) {
- if(nss.getURI("") == null) {
- nss.declarePrefix("", value);
- }
- if((prefix.equals("")) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- else {
- if(nss.getURI(attr.split(":")[1]) == null) {
- nss.declarePrefix(attr.split(":")[1],
value);
- }
- if((prefix.equals(attr.split(":")[1])) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
addAttr(String, String, NamespaceSupport) unrecognized attribute pair: " +
attr + " - " + value);
- return false;
- }
- return true;
- }
-
- /**
- * The text element is the value of this element.
- */
- public boolean addText(String text) {
- String clean = text.trim();
- if(!(text.equals(""))) {
- setDescription(text);
- return true;
- }
- else {
- System.err.println("Error: " + getFileName() + "
description can't have a witespace value.");
- }
- return false;
- }
-
- /**
- * Converts the contents of this object into an xml tag.
- */
- public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
- try {
- handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
-
handler.characters(description.toCharArray(),0,description.length());
- handler.endElement(getUri(), getLocalName(),
getQName());
-
- if(getCompleted()) {
- nss.popContext();
- unSetCompleted();
- }
- }
- catch(Exception e) {
- System.err.println("Error: " + getFileName() + "
toXML(ContentHandler, NamespaceSupport) XML formulation error.");
- }
- return handler;
- }
-
- /**
- * Converts items into attributes for an xml tag.
- */
- public AttributesImpl getAttributes(NamespaceSupport nss) {
- AttributesImpl atts = new AttributesImpl();
-
- if(nss.getURI(getPrefix()) == null) {
- nss.pushContext();
- if(getPrefix().equals("")) {
- atts.addAttribute(getUri(), "xmlns", "xmlns",
"CDATA", getUri());
- }
- else {
- atts.addAttribute(getUri(), "xmlns:" +
getPrefix(), "xmlns:" + getPrefix(), "CDATA", getUri());
- }
- nss.declarePrefix(getPrefix(), getUri());
- setCompleted();
- }
-
- return atts;
- }
-
- /**
- * Given a DOM element (a parent), construct
- * the children elements.
- */
- public void getDOM(org.w3c.dom.Element parent) {
- org.w3c.dom.Document doc = parent.getOwnerDocument();
- if(!(getDescription().equals(""))) {
- org.w3c.dom.Element authrealm =
doc.createElement(getLocalName());
- authrealm = doc.createElementNS(getUri(),
getQName());
- parent.appendChild(authrealm);
- org.w3c.dom.Text authrealmtext =
doc.createTextNode(getDescription());
- authrealm.appendChild(authrealmtext);
- }
- }
-
- /**
- * Called when the object is placed in
- * an output statement.
- */
- public String toString() {
- return getFileName() + ": ---> " + getDescription();
- }
}
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/GlobalName.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/GlobalName.java
2006-10-27 19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/GlobalName.java
2006-10-30 16:30:28 UTC (rev 175)
@@ -16,21 +16,9 @@
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.NamespaceSupport;
-import org.ggf.ns.nmwg.base.v2_0.Element;
+public class GlobalName extends
org.ggf.ns.nmwg.topology.base.v3_0.GlobalName {
-public class GlobalName extends Element {
-
/**
- *
- */
- protected String globalName;
-
- /**
- *
- */
- protected String type;
-
- /**
* Constructor.
*/
public GlobalName() {
@@ -38,155 +26,8 @@
type = "";
localName = "globalName";
uri = "http://ggf.org/ns/nmwg/topology/l2/3.0/";
- qName = "nmwgtopo3:globalName";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol2:globalName";
+ prefix = "nmwgtopol2";
fileName =
"org/ggf/ns/nmwg/topology/l2/v3_0/GlobalName.java";
}
-
- /**
- * Returns the globalName value.
- */
- public String getGlobalName() {
- return globalName;
- }
-
- /**
- * Sets the globalName value.
- */
- public void setGlobalName(String newGlobalName) {
- globalName = newGlobalName;
- }
-
- /**
- * Returns the type value.
- */
- public String getType() {
- return type;
- }
-
- /**
- * Sets the type value.
- */
- public void setType(String newType) {
- type = newType;
- }
-
- /**
- * Not used in this element.
- */
- public boolean addAttr(String attr, String value, NamespaceSupport
nss) {
- if(attr.equals("type")) {
- setType(value);
- }
- else if(attr.indexOf("xmlns") >= 0) {
- if(attr.split(":").length == 1) {
- if(nss.getURI("") == null) {
- nss.declarePrefix("", value);
- }
- if((prefix.equals("")) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- else {
- if(nss.getURI(attr.split(":")[1]) == null) {
- nss.declarePrefix(attr.split(":")[1],
value);
- }
- if((prefix.equals(attr.split(":")[1])) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
addAttr(String, String, NamespaceSupport) unrecognized attribute pair: " +
attr + " - " + value);
- return false;
- }
- return true;
- }
-
- /**
- * The text element is the value of this element.
- */
- public boolean addText(String text) {
- String clean = text.trim();
- if(!(text.equals(""))) {
- setGlobalName(text);
- return true;
- }
- else {
- System.err.println("Error: " + getFileName() + "
authRealm can't have a witespace value.");
- }
- return false;
- }
-
- /**
- * Converts the contents of this object into an xml tag.
- */
- public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
- try {
- handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
-
handler.characters(globalName.toCharArray(),0,globalName.length());
- handler.endElement(getUri(), getLocalName(),
getQName());
-
- if(getCompleted()) {
- nss.popContext();
- unSetCompleted();
- }
- }
- catch(Exception e) {
- System.err.println("Error: " + getFileName() + "
toXML(ContentHandler, NamespaceSupport) XML formulation error.");
- }
- return handler;
- }
-
- /**
- * Converts items into attributes for an xml tag.
- */
- public AttributesImpl getAttributes(NamespaceSupport nss) {
- AttributesImpl atts = new AttributesImpl();
-
- if(nss.getURI(getPrefix()) == null) {
- nss.pushContext();
- if(getPrefix().equals("")) {
- atts.addAttribute(getUri(), "xmlns", "xmlns",
"CDATA", getUri());
- }
- else {
- atts.addAttribute(getUri(), "xmlns:" +
getPrefix(), "xmlns:" + getPrefix(), "CDATA", getUri());
- }
- nss.declarePrefix(getPrefix(), getUri());
- setCompleted();
- }
-
- if(!(getType().equals(""))) {
- atts.addAttribute(getUri(), "type", "type", "CDATA",
getType());
- }
-
- return atts;
- }
-
- /**
- * Given a DOM element (a parent), construct
- * the children elements.
- */
- public void getDOM(org.w3c.dom.Element parent) {
- org.w3c.dom.Document doc = parent.getOwnerDocument();
- if(!(getGlobalName().equals(""))) {
- org.w3c.dom.Element globalName =
doc.createElement(getLocalName());
- globalName = doc.createElementNS(getUri(),
getQName());
- parent.appendChild(globalName);
- org.w3c.dom.Text globalNametext =
doc.createTextNode(getGlobalName());
- globalName.appendChild(globalNametext);
-
- if(!(getType().equals(""))) {
- globalName.setAttribute("type", getType());
- }
- }
- }
-
- /**
- * Called when the object is placed in
- * an output statement.
- */
- public String toString() {
- return getFileName() + ": ---> " + getGlobalName() +
getType();
- }
}
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/IfHostName.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/IfHostName.java
2006-10-27 19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/IfHostName.java
2006-10-30 16:30:28 UTC (rev 175)
@@ -33,8 +33,8 @@
ifHostName = "";
localName = "ifHostName";
uri = "http://ggf.org/ns/nmwg/topology/l2/3.0/";
- qName = "nmwgtopo3:ifHostName";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol2:ifHostName";
+ prefix = "nmwgtopol2";
fileName =
"org/ggf/ns/nmwg/topology/l2/v3_0/IfHostName.java";
}
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/IfIndex.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/IfIndex.java
2006-10-27 19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/IfIndex.java
2006-10-30 16:30:28 UTC (rev 175)
@@ -16,146 +16,17 @@
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.NamespaceSupport;
-import org.ggf.ns.nmwg.base.v2_0.Element;
+public class IfIndex extends org.ggf.ns.nmwg.topology.base.v3_0.IfIndex {
-public class IfIndex extends Element {
-
/**
- * Index of an interface.
- */
- protected String ifIndex;
-
- /**
* Constructor.
*/
public IfIndex() {
ifIndex = "";
localName = "ifIndex";
uri = "http://ggf.org/ns/nmwg/topology/l2/3.0/";
- qName = "nmwgtopo3:ifIndex";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol2:ifIndex";
+ prefix = "nmwgtopol2";
fileName = "org/ggf/ns/nmwg/topology/l2/v3_0/IfIndex.java";
}
-
- /**
- * Returns the ifIndex value.
- */
- public String getIfIndex() {
- return ifIndex;
- }
-
- /**
- * Sets the ifIndex value.
- */
- public void setIfIndex(String newIfIndex) {
- ifIndex = newIfIndex;
- }
-
- /**
- * Not used in this element.
- */
- public boolean addAttr(String attr, String value, NamespaceSupport
nss) {
- if(attr.indexOf("xmlns") >= 0) {
- if(attr.split(":").length == 1) {
- if(nss.getURI("") == null) {
- nss.declarePrefix("", value);
- }
- if((prefix.equals("")) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- else {
- if(nss.getURI(attr.split(":")[1]) == null) {
- nss.declarePrefix(attr.split(":")[1],
value);
- }
- if((prefix.equals(attr.split(":")[1])) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
addAttr(String, String, NamespaceSupport) unrecognized attribute pair: " +
attr + " - " + value);
- return false;
- }
- return true;
- }
-
- /**
- * The text element is the value of this element.
- */
- public boolean addText(String text) {
- String clean = text.trim();
- if(!(text.equals(""))) {
- setIfIndex(text);
- return true;
- }
- else {
- System.err.println("Error: " + getFileName() + "
authRealm can't have a witespace value.");
- }
- return false;
- }
-
- /**
- * Converts the contents of this object into an xml tag.
- */
- public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
- try {
- handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
-
handler.characters(ifIndex.toCharArray(),0,ifIndex.length());
- handler.endElement(getUri(), getLocalName(),
getQName());
-
- if(getCompleted()) {
- nss.popContext();
- unSetCompleted();
- }
- }
- catch(Exception e) {
- System.err.println("Error: " + getFileName() + "
toXML(ContentHandler, NamespaceSupport) XML formulation error.");
- }
- return handler;
- }
-
- /**
- * Converts items into attributes for an xml tag.
- */
- public AttributesImpl getAttributes(NamespaceSupport nss) {
- AttributesImpl atts = new AttributesImpl();
-
- if(nss.getURI(getPrefix()) == null) {
- nss.pushContext();
- if(getPrefix().equals("")) {
- atts.addAttribute(getUri(), "xmlns", "xmlns",
"CDATA", getUri());
- }
- else {
- atts.addAttribute(getUri(), "xmlns:" +
getPrefix(), "xmlns:" + getPrefix(), "CDATA", getUri());
- }
- nss.declarePrefix(getPrefix(), getUri());
- setCompleted();
- }
-
- return atts;
- }
-
- /**
- * Given a DOM element (a parent), construct
- * the children elements.
- */
- public void getDOM(org.w3c.dom.Element parent) {
- org.w3c.dom.Document doc = parent.getOwnerDocument();
- if(!(getIfIndex().equals(""))) {
- org.w3c.dom.Element ifindex =
doc.createElement(getLocalName());
- ifindex = doc.createElementNS(getUri(), getQName());
- parent.appendChild(ifindex);
- org.w3c.dom.Text ifindextext =
doc.createTextNode(getIfIndex());
- ifindex.appendChild(ifindextext);
- }
- }
-
- /**
- * Called when the object is placed in
- * an output statement.
- */
- public String toString() {
- return getFileName() + ": ---> " + getIfIndex();
- }
}
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Index.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Index.java 2006-10-27
19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Index.java 2006-10-30
16:30:28 UTC (rev 175)
@@ -14,12 +14,8 @@
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.NamespaceSupport;
-import org.ggf.ns.nmwg.base.v2_0.Element;
+public class Index extends org.ggf.ns.nmwg.topology.base.v3_0.Index {
-public class Index extends Element {
-
- protected String index;
-
/**
* Constructor.
*/
@@ -27,130 +23,8 @@
index = "";
localName = "index";
uri = "http://ggf.org/ns/nmwg/topology/l2/3.0/";
- qName = "nmwgtopo3:index";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol2:index";
+ prefix = "nmwgtopol2";
fileName = "org/ggf/ns/nmwg/topology/l2/v3_0/Index.java";
}
-
- /**
- * Returns the index value.
- */
- public String getIndex() {
- return index;
- }
-
- /**
- * Sets the index value.
- */
- public void setIndex(String newIndex) {
- index = newIndex;
- }
-
- /**
- * Not used in this element.
- */
- public boolean addAttr(String attr, String value, NamespaceSupport
nss) {
- if(attr.indexOf("xmlns") >= 0) {
- if(attr.split(":").length == 1) {
- if(nss.getURI("") == null) {
- nss.declarePrefix("", value);
- }
- if((prefix.equals("")) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- else {
- if(nss.getURI(attr.split(":")[1]) == null) {
- nss.declarePrefix(attr.split(":")[1],
value);
- }
- if((prefix.equals(attr.split(":")[1])) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
addAttr(String, String, NamespaceSupport) unrecognized attribute pair: " +
attr + " - " + value);
- return false;
- }
- return true;
- }
-
- /**
- * The text element is the value of this element.
- */
- public boolean addText(String text) {
- String clean = text.trim();
- if(!(text.equals(""))) {
- setIndex(text);
- return true;
- }
- else {
- System.err.println("Error: " + getFileName() + "
authRealm can't have a witespace value.");
- }
- return false;
- }
-
- /**
- * Converts the contents of this object into an xml tag.
- */
- public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
- try {
- handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
-
handler.characters(index.toCharArray(),0,index.length());
- handler.endElement(getUri(), getLocalName(),
getQName());
-
- if(getCompleted()) {
- nss.popContext();
- unSetCompleted();
- }
- }
- catch(Exception e) {
- System.err.println("Error: " + getFileName() + "
toXML(ContentHandler, NamespaceSupport) XML formulation error.");
- }
- return handler;
- }
-
- /**
- * Converts items into attributes for an xml tag.
- */
- public AttributesImpl getAttributes(NamespaceSupport nss) {
- AttributesImpl atts = new AttributesImpl();
-
- if(nss.getURI(getPrefix()) == null) {
- nss.pushContext();
- if(getPrefix().equals("")) {
- atts.addAttribute(getUri(), "xmlns", "xmlns",
"CDATA", getUri());
- }
- else {
- atts.addAttribute(getUri(), "xmlns:" +
getPrefix(), "xmlns:" + getPrefix(), "CDATA", getUri());
- }
- nss.declarePrefix(getPrefix(), getUri());
- setCompleted();
- }
-
- return atts;
- }
-
- /**
- * Given a DOM element (a parent), construct
- * the children elements.
- */
- public void getDOM(org.w3c.dom.Element parent) {
- org.w3c.dom.Document doc = parent.getOwnerDocument();
- if(!(getIndex().equals(""))) {
- org.w3c.dom.Element index =
doc.createElement(getLocalName());
- index = doc.createElementNS(getUri(), getQName());
- parent.appendChild(index);
- org.w3c.dom.Text indextext =
doc.createTextNode(getIndex());
- index.appendChild(indextext);
- }
- }
-
- /**
- * Called when the object is placed in
- * an output statement.
- */
- public String toString() {
- return getFileName() + ": ---> " + getIndex();
- }
}
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Interface.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Interface.java
2006-10-27 19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Interface.java
2006-10-30 16:30:28 UTC (rev 175)
@@ -25,7 +25,7 @@
import org.ggf.ns.nmwg.base.v2_0.Element;
import org.ggf.ns.nmwg.topology.base.v3_0.Node;
-public class Interface extends Element {
+public class Interface extends org.ggf.ns.nmwg.topology.base.v3_0.Interface {
/**
*
@@ -40,21 +40,11 @@
/**
*
*/
- protected Type typeElement;
-
- /**
- *
- */
protected Address addressElement;
/**
*
*/
- protected Name nameElement;
-
- /**
- *
- */
protected Description descriptionElement;
/**
@@ -63,55 +53,30 @@
protected IfHostName ifHostNameElement;
/**
- *
- */
- protected IfIndex ifIndexElement;
-
- /**
- *
- */
- protected Capacity capacityElement;
-
- /**
- *
- */
- protected String interfaceIdRef;
-
- /**
* Constructor.
*/
public Interface() {
interfaceIdRef = "";
+ nodeIdRef = "";
role = "";
roleElement = null;
addressElement = null;
- typeElement = null;
ifHostNameElement = null;
- nameElement = null;
descriptionElement = null;
+ typeElement = null;
+ hostNameElement = null;
+ ifNameElement = null;
+ ifDescriptionElement = null;
ifIndexElement = null;
capacityElement = null;
-
+ nameElement = null;
+
localName = "interface";
uri = "http://ggf.org/ns/nmwg/topology/l2/3.0/";
- qName = "nmwgtopo3:interface";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol2:interface";
+ prefix = "nmwgtopol2";
fileName = "org/ggf/ns/nmwg/topology/l2/v3_0/Interface.java";
- }
-
- /**
- * Returns the interfaceIdRef.
- */
- public String getInterfaceIdRef() {
- return interfaceIdRef;
- }
-
- /**
- * Sets the interfaceIdRef.
- */
- public void setInterfaceIdRef(String newInterfaceIdRef) {
- interfaceIdRef = newInterfaceIdRef;
}
/**
@@ -129,20 +94,6 @@
}
/**
- * Returns the Type element.
- */
- public Type getTypeElement() {
- return typeElement;
- }
-
- /**
- * Sets the Type element.
- */
- public void setTypeElement(Type newTypeElement) {
- typeElement = newTypeElement;
- }
-
- /**
* Returns the hostName element.
*/
public IfHostName getIfHostNameElement() {
@@ -157,20 +108,6 @@
}
/**
- * Returns the Name element.
- */
- public Name getNameElement() {
- return nameElement;
- }
-
- /**
- * Sets the Name element.
- */
- public void setNameElement(Name newNameElement) {
- nameElement = newNameElement;
- }
-
- /**
* Returns the Description element.
*/
public Description getDescriptionElement() {
@@ -183,36 +120,8 @@
public void setDescriptionElement(Description newDescriptionElement) {
descriptionElement = newDescriptionElement;
}
-
+
/**
- * Returns the IfIndex element.
- */
- public IfIndex getIfIndexElement() {
- return ifIndexElement;
- }
-
- /**
- * Sets the IfIndex element.
- */
- public void setIfIndexElement(IfIndex newIfIndexElement) {
- ifIndexElement = newIfIndexElement;
- }
-
- /**
- * Returns the classOfService element.
- */
- public Capacity getCapacityElement() {
- return capacityElement;
- }
-
- /**
- * Sets the classOfService element.
- */
- public void setCapacityElement(Capacity newCapacityElement) {
- capacityElement = newCapacityElement;
- }
-
- /**
* Returns the role element.
*/
public Role getRoleElement() {
@@ -239,8 +148,39 @@
public void setAddressElement(Address newAddressElement) {
addressElement = newAddressElement;
}
-
+
/**
+ * Unused in this object
+ */
+ public org.ggf.ns.nmwg.topology.base.v3_0.HostName
getHostNameElement() {
+ return null;
+ }
+
+ public void
setHostNameElement(org.ggf.ns.nmwg.topology.base.v3_0.HostName
newHostNameElement) {
+ }
+
+ public org.ggf.ns.nmwg.topology.base.v3_0.IfName getIfNameElement() {
+ return null;
+ }
+
+ public void
setIfNameElement(org.ggf.ns.nmwg.topology.base.v3_0.IfName newIfNameElement) {
+ }
+
+ public org.ggf.ns.nmwg.topology.base.v3_0.IfDescription
getIfDescriptionElement() {
+ return null;
+ }
+
+ public void
setIfDescriptionElement(org.ggf.ns.nmwg.topology.base.v3_0.IfDescription
newIfDescriptionElement) {
+ }
+
+ public String getNodeIdRef() {
+ return null;
+ }
+
+ public void setNodeIdRef(String newNodeIdRef) {
+ }
+
+ /**
* Add only children related to the interface.
*/
public boolean addChild(Element newChild) {
@@ -314,26 +254,6 @@
}
/**
- * Converts the contents of this object into an xml tag.
- */
- public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
- try {
- handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
- handler = getChildren(handler, nss);
- handler.endElement(getUri(), getLocalName(),
getQName());
-
- if(getCompleted()) {
- nss.popContext();
- unSetCompleted();
- }
- }
- catch(Exception e) {
- System.err.println("Error: " + getFileName() + "
toXML(ContentHandler, NamespaceSupport) XML formulation error.");
- }
- return handler;
- }
-
- /**
* Converts items into attributes for an xml tag.
*/
public AttributesImpl getAttributes(NamespaceSupport nss) {
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Link.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Link.java 2006-10-27
19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Link.java 2006-10-30
16:30:28 UTC (rev 175)
@@ -29,56 +29,13 @@
import org.xml.sax.helpers.NamespaceSupport;
import org.ggf.ns.nmwg.base.v2_0.Element;
+
import org.ggf.ns.nmwg.topology.base.v3_0.Node;
+import org.ggf.ns.nmwg.topology.base.v3_0.Interface;
-public class Link extends Element {
+public class Link extends org.ggf.ns.nmwg.topology.base.v3_0.Link {
/**
- *
- */
- protected Type typeElement;
-
- /**
- *
- */
- protected Index indexElement;
-
- /**
- *
- */
- protected Name nameElement;
-
- /**
- *
- */
- protected GlobalName globalNameElement;
-
- /**
- *
- */
- protected AuthRealm authRealmElement;
-
- /**
- * 'map' of link elements
- */
- protected Map linkMap;
-
- /**
- * 'map' of interface elements
- */
- protected Map interfaceMap;
-
- /**
- * 'map' of node elements
- */
- protected Map nodeMap;
-
- /**
- * attribute for linkIdRef
- */
- protected String linkIdRef;
-
- /**
* Constructor.
*/
public Link() {
@@ -86,7 +43,6 @@
nameElement = null;
globalNameElement = null;
indexElement = null;
- authRealmElement = null;
linkMap = new HashMap();
interfaceMap = new HashMap();
@@ -95,546 +51,8 @@
linkIdRef = "";
uri = "http://ggf.org/ns/nmwg/topology/l2/3.0/";
- qName = "nmwgtopo3:link";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol2:link";
+ prefix = "nmwgtopol2";
fileName = "org/ggf/ns/nmwg/topology/l2/v3_0/Link.java";
}
-
- /**
- * Returns the Type element.
- */
- public Type getTypeElement() {
- return typeElement;
- }
-
- /**
- * Sets the Type element.
- */
- public void setTypeElement(Type newTypeElement) {
- typeElement = newTypeElement;
- }
-
- /**
- * Returns the Name element.
- */
- public Name getNameElement() {
- return nameElement;
- }
-
- /**
- * Sets the Name element.
- */
- public void setNameElement(Name newNameElement) {
- nameElement = newNameElement;
- }
-
-
- /**
- * Returns the AuthRealm element.
- */
- public AuthRealm getAuthRealmElement() {
- return authRealmElement;
- }
-
- /**
- * Sets the AuthRealm element.
- */
- public void setAuthRealmElement(AuthRealm newAuthRealmElement) {
- authRealmElement = newAuthRealmElement;
- }
-
- /**
- * Returns the GlobalName element.
- */
- public GlobalName getGlobalNameElement() {
- return globalNameElement;
- }
-
- /**
- * Sets the Name element.
- */
- public void setGlobalNameElement(GlobalName newGlobalNameElement) {
- globalNameElement = newGlobalNameElement;
- }
-
- /**
- * Returns the index element.
- */
- public Index getIndexElement() {
- return indexElement;
- }
-
- /**
- * Sets the index element.
- */
- public void setIndexElement(Index newIndexElement) {
- indexElement = newIndexElement;
- }
-
- /**
- * Returns a linkIdRef.
- */
- public String getLinkIdRef() {
- return linkIdRef;
- }
-
- /**
- * Sets a messageIdRef.
- */
- public void setLinkIdRef(String newLinkIdRef) {
- linkIdRef = newLinkIdRef;
- }
-
-
-/**
- * Node Section
- */
-
- /**
- * clear all Node elements
- */
- public void clearNode() {
- nodeMap = new HashMap();
- }
-
- /**
- * Adds a node to the map
- */
- public void setNode(Node newNode) {
- if(newNode != null) {
- if(!(newNode.getId().equals(""))) {
- nodeMap.put(newNode.getId(),newNode);
- }
- else {
- System.err.println("Error: " + getFileName()
+ " 'setNode(Node)' cannot have nil value for id.");
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
'setNode(Node)' cannot have nil value for Node.");
- }
- }
-
- /**
- * Return the node map
- */
- public Map getNodeMap() {
- return this.nodeMap;
- }
-
- /**
- * Convert and return the node block in array form
- */
- public Node[] getNodeArray() {
- return (Node [])nodeMap.values().toArray(new
Node[nodeMap.size()]);
- }
-
- /**
- * Get an iterartor to the node map
- */
- public Iterator getNodeIterator() {
- return nodeMap.values().iterator();
- }
-
- /**
- * Get a single node block by id from the node block
- */
- public Node getNode(String id) {
- if(!(id.equals(""))) {
- Node md = (Node) nodeMap.get(id);
- if(md == null) {
- System.err.println("Error: " + getFileName()
+ " 'getNode(String)' has returned null for id: " + id);
- }
- return md;
- }
- else {
- System.err.println("Error: " + getFileName() + "
'getNode(String)' id cannont be nil.");
- return null;
- }
- }
-
-
-
-/**
- * Link Section
- */
-
- /**
- * clear all Link elements
- */
- public void clearLink() {
- linkMap = new HashMap();
- }
-
- /**
- * Adds a link to the map
- */
- public void setLink(Link newLink) {
- if(newLink != null) {
- if(!(newLink.getId().equals(""))) {
- linkMap.put(newLink.getId(),newLink);
- }
- else {
- System.err.println("Error: " + getFileName()
+ " 'setLink(Link)' cannot have nil value for id.");
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
'setLink(Link)' cannot have nil value for Link.");
- }
- }
-
- /**
- * Return the link map
- */
- public Map getLinkMap() {
- return this.linkMap;
- }
-
- /**
- * Convert and return the link block in array form
- */
- public Link[] getLinkArray() {
- return (Link [])linkMap.values().toArray(new
Link[linkMap.size()]);
- }
-
- /**
- * Get an iterartor to the link map
- */
- public Iterator getLinkIterator() {
- return linkMap.values().iterator();
- }
-
- /**
- * Get a single link block by id from the link block
- */
- public Link getLink(String id) {
- if(!(id.equals(""))) {
- Link l = (Link) linkMap.get(id);
- if(l == null) {
- System.err.println("Error: " + getFileName()
+ " 'getLink(String)' has returned null for id: " + id);
- }
- return l;
- }
- else {
- System.err.println("Error: " + getFileName() + "
'getLink(String)' id cannont be nil.");
- return null;
- }
- }
-
-
-/**
- * Interface Section
- */
-
-
-
- /**
- * clear all Interface elements
- */
- public void clearInterface() {
- interfaceMap = new HashMap();
- }
-
- /**
- * Adds a interface to the map
- */
- public void setInterface(Interface newInterface) {
- if(newInterface != null) {
- if(!(newInterface.getId().equals(""))) {
-
interfaceMap.put(newInterface.getId(),newInterface);
- }
- else {
- System.err.println("Error: " + getFileName()
+ " 'setInterface(Interface)' cannot have nil value for id.");
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
'setInterface(Interface)' cannot have nil value for Interface.");
- }
- }
-
- /**
- * Return the interface map
- */
- public Map getInterfaceMap() {
- return this.interfaceMap;
- }
-
- /**
- * Convert and return the interface block in array form
- */
- public Interface[] getInterfaceArray() {
- return (Interface [])interfaceMap.values().toArray(new
Interface[interfaceMap.size()]);
- }
-
- /**
- * Get an iterartor to the interface map
- */
- public Iterator getInterfaceIterator() {
- return interfaceMap.values().iterator();
- }
-
- /**
- * Get a single interface block by id from the interface block
- */
- public Interface getInterface(String id) {
- if(!(id.equals(""))) {
- Interface i = (Interface) interfaceMap.get(id);
- if(i == null) {
- System.err.println("Error: " + getFileName()
+ " 'getInterface(String)' has returned null for id: " + id);
- }
- return i;
- }
- else {
- System.err.println("Error: " + getFileName() + "
'getInterface(String)' id cannont be nil.");
- return null;
- }
- }
-
-
-
- /**
- * Add only children related to the link.
- */
- public boolean addChild(Element newChild) {
- if(newChild.getLocalName().equals("type")) {
- setTypeElement((Type)newChild);
- }
- else if(newChild.getLocalName().equals("name")) {
- setNameElement((Name)newChild);
- }
- else if(newChild.getLocalName().equals("authRealm")) {
- setAuthRealmElement((AuthRealm)newChild);
- }
- else if(newChild.getLocalName().equals("globalName")) {
- setGlobalNameElement((GlobalName)newChild);
- }
- else if(newChild.getLocalName().equals("index")) {
- setIndexElement((Index)newChild);
- }
- else if(newChild.getLocalName().equals("node")) {
- setNode((Node)newChild);
- }
- else if(newChild.getLocalName().equals("link")) {
- setLink((Link)newChild);
- }
- else if(newChild.getLocalName().equals("interface")) {
- setInterface((Interface)newChild);
- }
- else {
- System.err.println("Error: " + getFileName() + "
addChild(Element) unrecognized child: " + newChild);
- return false;
- }
- return true;
- }
-
- /**
- * There shouldnt be an attribute, but there could be a namespace?
- */
- public boolean addAttr(String attr, String value, NamespaceSupport
nss) {
- if(attr.indexOf("xmlns") >= 0) {
- if(attr.split(":").length == 1) {
- if(nss.getURI("") == null) {
- nss.declarePrefix("", value);
- }
- if((prefix.equals("")) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- else {
- if(nss.getURI(attr.split(":")[1]) == null) {
- nss.declarePrefix(attr.split(":")[1],
value);
- }
- if((prefix.equals(attr.split(":")[1])) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- }
- else if(attr.equals("id")) {
- setId(value);
- }
- else if(attr.equals("linkIdRef")) {
- setLinkIdRef(value);
- }
- else {
- System.err.println("Error: " + getFileName() + "
addAttr(String, String, NamespaceSupport) unrecognized attribute pair: " +
attr + " - " + value);
- return false;
- }
- return true;
- }
-
- /**
- * Converts the contents of this object into an xml tag.
- */
- public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
- try {
- handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
- handler = getChildren(handler, nss);
- handler.endElement(getUri(), getLocalName(),
getQName());
-
- if(getCompleted()) {
- nss.popContext();
- unSetCompleted();
- }
- }
- catch(Exception e) {
- System.err.println("Error: " + getFileName() + "
toXML(ContentHandler, NamespaceSupport) XML formulation error.");
- }
- return handler;
- }
-
- /**
- * Converts items into attributes for an xml tag.
- */
- public AttributesImpl getAttributes(NamespaceSupport nss) {
- AttributesImpl atts = new AttributesImpl();
-
- if(nss.getURI(getPrefix()) == null) {
- nss.pushContext();
- if(getPrefix().equals("")) {
- atts.addAttribute(getUri(), "xmlns", "xmlns",
"CDATA", getUri());
- }
- else {
- atts.addAttribute(getUri(), "xmlns:" +
getPrefix(), "xmlns:" + getPrefix(), "CDATA", getUri());
- }
- nss.declarePrefix(getPrefix(), getUri());
- setCompleted();
- }
- if(!(getId().equals(""))) {
- atts.addAttribute(getUri(), "id", "id", "CDATA",
getId());
- }
- if(!(getLinkIdRef().equals(""))) {
- atts.addAttribute(getUri(), "linkIdRef", "linkIdRef",
"CDATA", getLinkIdRef());
- }
-
- return atts;
- }
-
- /**
- * Chases children references down to pring out all related xml tags.
- */
- public ContentHandler getChildren(ContentHandler handler,
NamespaceSupport nss) throws Exception {
-
- Link tl;
- Interface ti;
- Node tn;
- Collection lc = getLinkMap().values();
- Collection ic = getInterfaceMap().values();
- Collection nc = getNodeMap().values();
-
- for(Iterator i = lc.iterator(); i.hasNext(); ){
- tl = (Link)i.next();
- handler = tl.toXML(handler, nss);
- }
- for(Iterator i = ic.iterator(); i.hasNext(); ){
- ti = (Interface)i.next();
- handler = ti.toXML(handler, nss);
- }
- for(Iterator i = nc.iterator(); i.hasNext(); ){
- tn = (Node)i.next();
- handler = tn.toXML(handler, nss);
- }
-
- if(getTypeElement() != null) {
- handler = getTypeElement().toXML(handler, nss);
- }
- if(getNameElement() != null) {
- handler = getNameElement().toXML(handler, nss);
- }
- if(getAuthRealmElement() != null) {
- handler = getAuthRealmElement().toXML(handler, nss);
- }
- if(getGlobalNameElement() != null) {
- handler = getGlobalNameElement().toXML(handler, nss);
- }
- if(getIndexElement() != null) {
- handler = getIndexElement().toXML(handler, nss);
- }
- return handler;
- }
-
- /**
- * Given a DOM element (a parent), construct
- * the children elements.
- */
- public void getDOM(org.w3c.dom.Element parent) {
- Link tl;
- Interface ti;
- Node tn;
- Collection lc = getLinkMap().values();
- Collection ic = getInterfaceMap().values();
- Collection nc = getNodeMap().values();
-
-
- org.w3c.dom.Document doc = parent.getOwnerDocument();
- org.w3c.dom.Element intfc = doc.createElement(getLocalName());
- intfc = doc.createElementNS(getUri(), getQName());
- parent.appendChild(intfc);
-
- if(getTypeElement() != null) {
- getTypeElement().getDOM(intfc);
- }
- if(getNameElement() != null) {
- getNameElement().getDOM(intfc);
- }
- if(getAuthRealmElement() != null) {
- getAuthRealmElement().getDOM(intfc);
- }
- if(getGlobalNameElement() != null) {
- getGlobalNameElement().getDOM(intfc);
- }
- if(getIndexElement() != null) {
- getIndexElement().getDOM(intfc);
- }
-
- if(!(getId().equals(""))) {
- intfc.setAttribute("id", getId());
- }
- if(!(getLinkIdRef().equals(""))) {
- intfc.setAttribute("linkIdRef", getLinkIdRef());
- }
-
- for(Iterator i = lc.iterator(); i.hasNext(); ){
- tl = (Link)i.next();
- tl.getDOM(intfc);
- }
- for(Iterator i = ic.iterator(); i.hasNext(); ){
- ti = (Interface)i.next();
- ti.getDOM(intfc);
- }
- for(Iterator i = nc.iterator(); i.hasNext(); ){
- tn = (Node)i.next();
- tn.getDOM(intfc);
- }
-
- }
-
- /**
- * Called when the object is placed in
- * an output statement.
- */
- public String toString() {
- Link tl;
- Interface ti;
- Node tn;
- Collection lc = getLinkMap().values();
- Collection ic = getInterfaceMap().values();
- Collection nc = getNodeMap().values();
-
- String ns = "", ls = "" , is = "";
-
- for(Iterator i = lc.iterator(); i.hasNext(); ){
- tl = (Link)i.next();
- ls = ls + tl.toString();
- }
- for(Iterator i = ic.iterator(); i.hasNext(); ){
- ti = (Interface)i.next();
- is = is + ti.toString();
- }
- for(Iterator i = nc.iterator(); i.hasNext(); ){
- tn = (Node)i.next();
- ns = ns + tn.toString();
- }
-
- return getFileName() + ": ---> " + getId() + getLinkIdRef() +
getAuthRealmElement() + getTypeElement() + getNameElement() +
getGlobalNameElement() + getIndexElement() + " link:" + ls + " interface:" +
is + " node:" + ns;
- }
-
}
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Name.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Name.java 2006-10-27
19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Name.java 2006-10-30
16:30:28 UTC (rev 175)
@@ -16,21 +16,9 @@
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.NamespaceSupport;
-import org.ggf.ns.nmwg.base.v2_0.Element;
+public class Name extends org.ggf.ns.nmwg.topology.base.v3_0.Name {
-public class Name extends Element {
-
/**
- *
- */
- protected String name;
-
- /**
- *
- */
- protected String type;
-
- /**
* Constructor.
*/
public Name() {
@@ -38,155 +26,8 @@
type = "";
localName = "name";
uri = "http://ggf.org/ns/nmwg/topology/l2/3.0/";
- qName = "nmwgtopo3:name";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol2:name";
+ prefix = "nmwgtopol2";
fileName = "org/ggf/ns/nmwg/topology/l2/v3_0/Name.java";
}
-
- /**
- * Returns the name value.
- */
- public String getName() {
- return name;
- }
-
- /**
- * Sets the name value.
- */
- public void setName(String newName) {
- name = newName;
- }
-
- /**
- * Returns the type value.
- */
- public String getType() {
- return type;
- }
-
- /**
- * Sets the type value.
- */
- public void setType(String newType) {
- type = newType;
- }
-
- /**
- * Not used in this element.
- */
- public boolean addAttr(String attr, String value, NamespaceSupport
nss) {
- if(attr.equals("type")) {
- setType(value);
- }
- else if(attr.indexOf("xmlns") >= 0) {
- if(attr.split(":").length == 1) {
- if(nss.getURI("") == null) {
- nss.declarePrefix("", value);
- }
- if((prefix.equals("")) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- else {
- if(nss.getURI(attr.split(":")[1]) == null) {
- nss.declarePrefix(attr.split(":")[1],
value);
- }
- if((prefix.equals(attr.split(":")[1])) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
addAttr(String, String, NamespaceSupport) unrecognized attribute pair: " +
attr + " - " + value);
- return false;
- }
- return true;
- }
-
- /**
- * The text element is the value of this element.
- */
- public boolean addText(String text) {
- String clean = text.trim();
- if(!(text.equals(""))) {
- setName(text);
- return true;
- }
- else {
- System.err.println("Error: " + getFileName() + "
authRealm can't have a witespace value.");
- }
- return false;
- }
-
- /**
- * Converts the contents of this object into an xml tag.
- */
- public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
- try {
- handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
-
handler.characters(name.toCharArray(),0,name.length());
- handler.endElement(getUri(), getLocalName(),
getQName());
-
- if(getCompleted()) {
- nss.popContext();
- unSetCompleted();
- }
- }
- catch(Exception e) {
- System.err.println("Error: " + getFileName() + "
toXML(ContentHandler, NamespaceSupport) XML formulation error.");
- }
- return handler;
- }
-
- /**
- * Converts items into attributes for an xml tag.
- */
- public AttributesImpl getAttributes(NamespaceSupport nss) {
- AttributesImpl atts = new AttributesImpl();
-
- if(nss.getURI(getPrefix()) == null) {
- nss.pushContext();
- if(getPrefix().equals("")) {
- atts.addAttribute(getUri(), "xmlns", "xmlns",
"CDATA", getUri());
- }
- else {
- atts.addAttribute(getUri(), "xmlns:" +
getPrefix(), "xmlns:" + getPrefix(), "CDATA", getUri());
- }
- nss.declarePrefix(getPrefix(), getUri());
- setCompleted();
- }
-
- if(!(getType().equals(""))) {
- atts.addAttribute(getUri(), "type", "type", "CDATA",
getType());
- }
-
- return atts;
- }
-
- /**
- * Given a DOM element (a parent), construct
- * the children elements.
- */
- public void getDOM(org.w3c.dom.Element parent) {
- org.w3c.dom.Document doc = parent.getOwnerDocument();
- if(!(getName().equals(""))) {
- org.w3c.dom.Element name =
doc.createElement(getLocalName());
- name = doc.createElementNS(getUri(), getQName());
- parent.appendChild(name);
- org.w3c.dom.Text nametext =
doc.createTextNode(getName());
- name.appendChild(nametext);
-
- if(!(getType().equals(""))) {
- name.setAttribute("type", getType());
- }
- }
- }
-
- /**
- * Called when the object is placed in
- * an output statement.
- */
- public String toString() {
- return getFileName() + ": ---> " + getName() + getType();
- }
}
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Network.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Network.java
2006-10-27 19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Network.java
2006-10-30 16:30:28 UTC (rev 175)
@@ -27,47 +27,19 @@
import org.xml.sax.helpers.NamespaceSupport;
import org.ggf.ns.nmwg.base.v2_0.Element;
+
import org.ggf.ns.nmwg.topology.base.v3_0.Node;
+import org.ggf.ns.nmwg.topology.base.v3_0.Interface;
+import org.ggf.ns.nmwg.topology.base.v3_0.Link;
-public class Network extends Element {
+public class Network extends org.ggf.ns.nmwg.topology.base.v3_0.Network {
/**
*
*/
- protected Name nameElement;
-
- /**
- *
- */
protected Vlan vlanElement;
/**
- *
- */
- protected Type typeElement;
-
-
- /**
- * 'map' of link elements
- */
- protected Map linkMap;
-
- /**
- * 'map' of interface elements
- */
- protected Map interfaceMap;
-
- /**
- * 'map' of node elements
- */
- protected Map nodeMap;
-
- /**
- * attribute for linkIdRef
- */
- protected String networkIdRef;
-
- /**
* Constructor.
*/
public Network() {
@@ -83,26 +55,12 @@
networkIdRef = "";
uri = "http://ggf.org/ns/nmwg/topology/l2/3.0/";
- qName = "nmwgtopo3:network";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol2:network";
+ prefix = "nmwgtopol2";
fileName = "org/ggf/ns/nmwg/topology/l2/v3_0/Network.java";
}
-
- /**
- * Returns the Name element.
- */
- public Name getNameElement() {
- return nameElement;
- }
/**
- * Sets the Name element.
- */
- public void setNameElement(Name newNameElement) {
- nameElement = newNameElement;
- }
-
- /**
* Returns the vlan element.
*/
public Vlan getVlanElement() {
@@ -116,241 +74,8 @@
vlanElement = newVlanElement;
}
- /**
- * Returns the type element.
- */
- public Type getTypeElement() {
- return typeElement;
- }
-
- /**
- * Sets the type element.
- */
- public void setTypeElement(Type newTypeElement) {
- typeElement = newTypeElement;
- }
-
- /**
- * Returns a networkIdRef.
- */
- public String getNetworkIdRef() {
- return networkIdRef;
- }
-
- /**
- * Sets a messageIdRef.
- */
- public void setNetworkIdRef(String newNetworkIdRef) {
- networkIdRef = newNetworkIdRef;
- }
-
-
-/**
- * Node Section
- */
/**
- * clear all Node elements
- */
- public void clearNode() {
- nodeMap = new HashMap();
- }
-
- /**
- * Adds a node to the map
- */
- public void setNode(Node newNode) {
- if(newNode != null) {
- if(!(newNode.getId().equals(""))) {
- nodeMap.put(newNode.getId(),newNode);
- }
- else {
- System.err.println("Error: " + getFileName()
+ " 'setNode(Node)' cannot have nil value for id.");
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
'setNode(Node)' cannot have nil value for Node.");
- }
- }
-
- /**
- * Return the node map
- */
- public Map getNodeMap() {
- return this.nodeMap;
- }
-
- /**
- * Convert and return the node block in array form
- */
- public Node[] getNodeArray() {
- return (Node [])nodeMap.values().toArray(new
Node[nodeMap.size()]);
- }
-
- /**
- * Get an iterartor to the node map
- */
- public Iterator getNodeIterator() {
- return nodeMap.values().iterator();
- }
-
- /**
- * Get a single node block by id from the node block
- */
- public Node getNode(String id) {
- if(!(id.equals(""))) {
- Node md = (Node) nodeMap.get(id);
- if(md == null) {
- System.err.println("Error: " + getFileName()
+ " 'getNode(String)' has returned null for id: " + id);
- }
- return md;
- }
- else {
- System.err.println("Error: " + getFileName() + "
'getNode(String)' id cannont be nil.");
- return null;
- }
- }
-
-
-
-/**
- * Link Section
- */
-
- /**
- * clear all Link elements
- */
- public void clearLink() {
- linkMap = new HashMap();
- }
-
- /**
- * Adds a link to the map
- */
- public void setLink(Link newLink) {
- if(newLink != null) {
- if(!(newLink.getId().equals(""))) {
- linkMap.put(newLink.getId(),newLink);
- }
- else {
- System.err.println("Error: " + getFileName()
+ " 'setLink(Link)' cannot have nil value for id.");
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
'setLink(Link)' cannot have nil value for Link.");
- }
- }
-
- /**
- * Return the link map
- */
- public Map getLinkMap() {
- return this.linkMap;
- }
-
- /**
- * Convert and return the link block in array form
- */
- public Link[] getLinkArray() {
- return (Link [])linkMap.values().toArray(new
Link[linkMap.size()]);
- }
-
- /**
- * Get an iterartor to the link map
- */
- public Iterator getLinkIterator() {
- return linkMap.values().iterator();
- }
-
- /**
- * Get a single link block by id from the link block
- */
- public Link getLink(String id) {
- if(!(id.equals(""))) {
- Link l = (Link) linkMap.get(id);
- if(l == null) {
- System.err.println("Error: " + getFileName()
+ " 'getLink(String)' has returned null for id: " + id);
- }
- return l;
- }
- else {
- System.err.println("Error: " + getFileName() + "
'getLink(String)' id cannont be nil.");
- return null;
- }
- }
-
-
-/**
- * Interface Section
- */
-
-
-
- /**
- * clear all Interface elements
- */
- public void clearInterface() {
- interfaceMap = new HashMap();
- }
-
- /**
- * Adds a interface to the map
- */
- public void setInterface(Interface newInterface) {
- if(newInterface != null) {
- if(!(newInterface.getId().equals(""))) {
-
interfaceMap.put(newInterface.getId(),newInterface);
- }
- else {
- System.err.println("Error: " + getFileName()
+ " 'setInterface(Interface)' cannot have nil value for id.");
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
'setInterface(Interface)' cannot have nil value for Interface.");
- }
- }
-
- /**
- * Return the interface map
- */
- public Map getInterfaceMap() {
- return this.interfaceMap;
- }
-
- /**
- * Convert and return the interface block in array form
- */
- public Interface[] getInterfaceArray() {
- return (Interface [])interfaceMap.values().toArray(new
Interface[interfaceMap.size()]);
- }
-
- /**
- * Get an iterartor to the interface map
- */
- public Iterator getInterfaceIterator() {
- return interfaceMap.values().iterator();
- }
-
- /**
- * Get a single interface block by id from the interface block
- */
- public Interface getInterface(String id) {
- if(!(id.equals(""))) {
- Interface i = (Interface) interfaceMap.get(id);
- if(i == null) {
- System.err.println("Error: " + getFileName()
+ " 'getInterface(String)' has returned null for id: " + id);
- }
- return i;
- }
- else {
- System.err.println("Error: " + getFileName() + "
'getInterface(String)' id cannont be nil.");
- return null;
- }
- }
-
-
-
- /**
* Add only children related to the link.
*/
public boolean addChild(Element newChild) {
@@ -380,88 +105,6 @@
}
/**
- * There shouldnt be an attribute, but there could be a namespace?
- */
- public boolean addAttr(String attr, String value, NamespaceSupport
nss) {
- if(attr.indexOf("xmlns") >= 0) {
- if(attr.split(":").length == 1) {
- if(nss.getURI("") == null) {
- nss.declarePrefix("", value);
- }
- if((prefix.equals("")) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- else {
- if(nss.getURI(attr.split(":")[1]) == null) {
- nss.declarePrefix(attr.split(":")[1],
value);
- }
- if((prefix.equals(attr.split(":")[1])) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- }
- else if(attr.equals("id")) {
- setId(value);
- }
- else if(attr.equals("networkIdRef")) {
- setNetworkIdRef(value);
- }
- else {
- System.err.println("Error: " + getFileName() + "
addAttr(String, String, NamespaceSupport) unrecognized attribute pair: " +
attr + " - " + value);
- return false;
- }
- return true;
- }
-
- /**
- * Converts the contents of this object into an xml tag.
- */
- public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
- try {
- handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
- handler = getChildren(handler, nss);
- handler.endElement(getUri(), getLocalName(),
getQName());
-
- if(getCompleted()) {
- nss.popContext();
- unSetCompleted();
- }
- }
- catch(Exception e) {
- System.err.println("Error: " + getFileName() + "
toXML(ContentHandler, NamespaceSupport) XML formulation error.");
- }
- return handler;
- }
-
- /**
- * Converts items into attributes for an xml tag.
- */
- public AttributesImpl getAttributes(NamespaceSupport nss) {
- AttributesImpl atts = new AttributesImpl();
-
- if(nss.getURI(getPrefix()) == null) {
- nss.pushContext();
- if(getPrefix().equals("")) {
- atts.addAttribute(getUri(), "xmlns", "xmlns",
"CDATA", getUri());
- }
- else {
- atts.addAttribute(getUri(), "xmlns:" +
getPrefix(), "xmlns:" + getPrefix(), "CDATA", getUri());
- }
- nss.declarePrefix(getPrefix(), getUri());
- setCompleted();
- }
- if(!(getId().equals(""))) {
- atts.addAttribute(getUri(), "id", "id", "CDATA",
getId());
- }
- if(!(getNetworkIdRef().equals(""))) {
- atts.addAttribute(getUri(), "networkIdRef",
"networkIdRef", "CDATA", getNetworkIdRef());
- }
-
- return atts;
- }
-
- /**
* Chases children references down to pring out all related xml tags.
*/
public ContentHandler getChildren(ContentHandler handler,
NamespaceSupport nss) throws Exception {
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Path.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Path.java 2006-10-27
19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Path.java 2006-10-30
16:30:28 UTC (rev 175)
@@ -21,21 +21,11 @@
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.NamespaceSupport;
-import org.ggf.ns.nmwg.base.v2_0.Element;
+import org.ggf.ns.nmwg.topology.base.v3_0.Link;
-public class Path extends Element {
+public class Path extends org.ggf.ns.nmwg.topology.base.v3_0.Path {
/**
- * 'map' of link elements
- */
- protected Map linkMap;
-
- /**
- * attribute for pathIdRef
- */
- protected String pathIdRef;
-
- /**
* Constructor.
*/
public Path() {
@@ -44,242 +34,8 @@
pathIdRef = "";
uri = "http://ggf.org/ns/nmwg/topology/l2/3.0/";
- qName = "nmwgtopo3:path";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol2:path";
+ prefix = "nmwgtopol2";
fileName = "org/ggf/ns/nmwg/topology/l2/v3_0/Path.java";
}
-
- /**
- * Returns a pathIdRef.
- */
- public String getPathIdRef() {
- return pathIdRef;
- }
-
- /**
- * Sets a pathIdRef.
- */
- public void setPathIdRef(String newPathIdRef) {
- pathIdRef = newPathIdRef;
- }
-
-/**
- * Link Section
- */
-
- /**
- * clear all Link elements
- */
- public void clearLink() {
- linkMap = new HashMap();
- }
-
- /**
- * Adds a link to the map
- */
- public void setLink(Link newLink) {
- if(newLink != null) {
- if(!(newLink.getId().equals(""))) {
- linkMap.put(newLink.getId(),newLink);
- }
- else {
- System.err.println("Error: " + getFileName()
+ " 'setLink(Link)' cannot have nil value for id.");
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
'setLink(Link)' cannot have nil value for Link.");
- }
- }
-
- /**
- * Return the link map
- */
- public Map getLinkMap() {
- return this.linkMap;
- }
-
- /**
- * Convert and return the link block in array form
- */
- public Link[] getLinkArray() {
- return (Link [])linkMap.values().toArray(new
Link[linkMap.size()]);
- }
-
- /**
- * Get an iterartor to the link map
- */
- public Iterator getLinkIterator() {
- return linkMap.values().iterator();
- }
-
- /**
- * Get a single link block by id from the link block
- */
- public Link getLink(String id) {
- if(!(id.equals(""))) {
- Link l = (Link) linkMap.get(id);
- if(l == null) {
- System.err.println("Error: " + getFileName()
+ " 'getLink(String)' has returned null for id: " + id);
- }
- return l;
- }
- else {
- System.err.println("Error: " + getFileName() + "
'getLink(String)' id cannont be nil.");
- return null;
- }
- }
-
- /**
- * Add only children related to the link.
- */
- public boolean addChild(Element newChild) {
- if(newChild.getLocalName().equals("link")) {
- setLink((Link)newChild);
- }
- else {
- System.err.println("Error: " + getFileName() + "
addChild(Element) unrecognized child: " + newChild);
- return false;
- }
- return true;
- }
-
- /**
- * There shouldnt be an attribute, but there could be a namespace?
- */
- public boolean addAttr(String attr, String value, NamespaceSupport
nss) {
- if(attr.indexOf("xmlns") >= 0) {
- if(attr.split(":").length == 1) {
- if(nss.getURI("") == null) {
- nss.declarePrefix("", value);
- }
- if((prefix.equals("")) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- else {
- if(nss.getURI(attr.split(":")[1]) == null) {
- nss.declarePrefix(attr.split(":")[1],
value);
- }
- if((prefix.equals(attr.split(":")[1])) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- }
- else if(attr.equals("id")) {
- setId(value);
- }
- else if(attr.equals("pathIdRef")) {
- setPathIdRef(value);
- }
- else {
- System.err.println("Error: " + getFileName() + "
addAttr(String, String, NamespaceSupport) unrecognized attribute pair: " +
attr + " - " + value);
- return false;
- }
- return true;
- }
-
- /**
- * Converts the contents of this object into an xml tag.
- */
- public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
- try {
- handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
- handler = getChildren(handler, nss);
- handler.endElement(getUri(), getLocalName(),
getQName());
-
- if(getCompleted()) {
- nss.popContext();
- unSetCompleted();
- }
- }
- catch(Exception e) {
- System.err.println("Error: " + getFileName() + "
toXML(ContentHandler, NamespaceSupport) XML formulation error.");
- }
- return handler;
- }
-
- /**
- * Converts items into attributes for an xml tag.
- */
- public AttributesImpl getAttributes(NamespaceSupport nss) {
- AttributesImpl atts = new AttributesImpl();
-
- if(nss.getURI(getPrefix()) == null) {
- nss.pushContext();
- if(getPrefix().equals("")) {
- atts.addAttribute(getUri(), "xmlns", "xmlns",
"CDATA", getUri());
- }
- else {
- atts.addAttribute(getUri(), "xmlns:" +
getPrefix(), "xmlns:" + getPrefix(), "CDATA", getUri());
- }
- nss.declarePrefix(getPrefix(), getUri());
- setCompleted();
- }
- if(!(getId().equals(""))) {
- atts.addAttribute(getUri(), "id", "id", "CDATA",
getId());
- }
- if(!(getPathIdRef().equals(""))) {
- atts.addAttribute(getUri(), "pathIdRef", "pathIdRef",
"CDATA", getPathIdRef());
- }
-
- return atts;
- }
-
- /**
- * Chases children references down to pring out all related xml tags.
- */
- public ContentHandler getChildren(ContentHandler handler,
NamespaceSupport nss) throws Exception {
- Link tl;
- Collection lc = getLinkMap().values();
-
- for(Iterator i = lc.iterator(); i.hasNext(); ){
- tl = (Link)i.next();
- handler = tl.toXML(handler, nss);
- }
- return handler;
- }
-
- /**
- * Given a DOM element (a parent), construct
- * the children elements.
- */
- public void getDOM(org.w3c.dom.Element parent) {
- Link tl;
- Collection lc = getLinkMap().values();
-
- org.w3c.dom.Document doc = parent.getOwnerDocument();
- org.w3c.dom.Element intfc = doc.createElement(getLocalName());
- intfc = doc.createElementNS(getUri(), getQName());
- parent.appendChild(intfc);
-
- if(!(getId().equals(""))) {
- intfc.setAttribute("id", getId());
- }
- if(!(getPathIdRef().equals(""))) {
- intfc.setAttribute("pathIdRef", getPathIdRef());
- }
-
- for(Iterator i = lc.iterator(); i.hasNext(); ){
- tl = (Link)i.next();
- tl.getDOM(intfc);
- }
-
- }
-
- /**
- * Called when the object is placed in
- * an output statement.
- */
- public String toString() {
- Link tl;
- Collection lc = getLinkMap().values();
- String ls = "";
-
- for(Iterator i = lc.iterator(); i.hasNext(); ){
- tl = (Link)i.next();
- ls = ls + tl.toString();
- }
- return getFileName() + ": ---> " + getId() + getPathIdRef() +
" link:" + ls;
- }
-
}
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Role.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Role.java 2006-10-27
19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Role.java 2006-10-30
16:30:28 UTC (rev 175)
@@ -14,12 +14,8 @@
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.NamespaceSupport;
-import org.ggf.ns.nmwg.base.v2_0.Element;
+public class Role extends org.ggf.ns.nmwg.topology.base.v3_0.Role {
-public class Role extends Element {
-
- protected String role;
-
/**
* Constructor.
*/
@@ -28,130 +24,8 @@
localName = "role";
uri = "http://ggf.org/ns/nmwg/topology/l2/3.0/";
- qName = "nmwgtopo3:role";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol2:role";
+ prefix = "nmwgtopol2";
fileName = "org/ggf/ns/nmwg/topology/l2/v3_0/Role.java";
}
-
- /**
- * Returns the role value.
- */
- public String getRole() {
- return role;
- }
-
- /**
- * Sets the role value.
- */
- public void setRole(String newRole) {
- role = newRole;
- }
-
- /**
- * Not used in this element.
- */
- public boolean addAttr(String attr, String value, NamespaceSupport
nss) {
- if(attr.indexOf("xmlns") >= 0) {
- if(attr.split(":").length == 1) {
- if(nss.getURI("") == null) {
- nss.declarePrefix("", value);
- }
- if((prefix.equals("")) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- else {
- if(nss.getURI(attr.split(":")[1]) == null) {
- nss.declarePrefix(attr.split(":")[1],
value);
- }
- if((prefix.equals(attr.split(":")[1])) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
addAttr(String, String, NamespaceSupport) unrecognized attribute pair: " +
attr + " - " + value);
- return false;
- }
- return true;
- }
-
- /**
- * The text element is the value of this element.
- */
- public boolean addText(String text) {
- String clean = text.trim();
- if(!(text.equals(""))) {
- setRole(text);
- return true;
- }
- else {
- System.err.println("Error: " + getFileName() + "
role can't have a witespace value.");
- }
- return false;
- }
-
- /**
- * Converts the contents of this object into an xml tag.
- */
- public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
- try {
- handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
-
handler.characters(role.toCharArray(),0,role.length());
- handler.endElement(getUri(), getLocalName(),
getQName());
-
- if(getCompleted()) {
- nss.popContext();
- unSetCompleted();
- }
- }
- catch(Exception e) {
- System.err.println("Error: " + getFileName() + "
toXML(ContentHandler, NamespaceSupport) XML formulation error.");
- }
- return handler;
- }
-
- /**
- * Converts items into attributes for an xml tag.
- */
- public AttributesImpl getAttributes(NamespaceSupport nss) {
- AttributesImpl atts = new AttributesImpl();
-
- if(nss.getURI(getPrefix()) == null) {
- nss.pushContext();
- if(getPrefix().equals("")) {
- atts.addAttribute(getUri(), "xmlns", "xmlns",
"CDATA", getUri());
- }
- else {
- atts.addAttribute(getUri(), "xmlns:" +
getPrefix(), "xmlns:" + getPrefix(), "CDATA", getUri());
- }
- nss.declarePrefix(getPrefix(), getUri());
- setCompleted();
- }
-
- return atts;
- }
-
- /**
- * Given a DOM element (a parent), construct
- * the children elements.
- */
- public void getDOM(org.w3c.dom.Element parent) {
- org.w3c.dom.Document doc = parent.getOwnerDocument();
- if(!(getRole().equals(""))) {
- org.w3c.dom.Element authrealm =
doc.createElement(getLocalName());
- authrealm = doc.createElementNS(getUri(),
getQName());
- parent.appendChild(authrealm);
- org.w3c.dom.Text authrealmtext =
doc.createTextNode(getRole());
- authrealm.appendChild(authrealmtext);
- }
- }
-
- /**
- * Called when the object is placed in
- * an output statement.
- */
- public String toString() {
- return getFileName() + ": ---> " + getRole();
- }
}
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Type.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Type.java 2006-10-27
19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Type.java 2006-10-30
16:30:28 UTC (rev 175)
@@ -16,147 +16,17 @@
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.NamespaceSupport;
-import org.ggf.ns.nmwg.base.v2_0.Element;
+public class Type extends org.ggf.ns.nmwg.topology.base.v3_0.Type {
-public class Type extends Element {
-
/**
- * Describes a type of interface, possible values
- * could include 10/100, gigE, infiniband, etc.
- */
- protected String type;
-
- /**
* Constructor.
*/
public Type() {
type = "";
localName = "type";
uri = "http://ggf.org/ns/nmwg/topology/l2/3.0/";
- qName = "nmwgtopo3:type";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol2:type";
+ prefix = "nmwgtopol2";
fileName = "org/ggf/ns/nmwg/topology/l2/v3_0/Type.java";
}
-
- /**
- * Returns the type value.
- */
- public String getType() {
- return type;
- }
-
- /**
- * Sets the type value.
- */
- public void setType(String newType) {
- type = newType;
- }
-
- /**
- * Not used in this element.
- */
- public boolean addAttr(String attr, String value, NamespaceSupport
nss) {
- if(attr.indexOf("xmlns") >= 0) {
- if(attr.split(":").length == 1) {
- if(nss.getURI("") == null) {
- nss.declarePrefix("", value);
- }
- if((prefix.equals("")) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- else {
- if(nss.getURI(attr.split(":")[1]) == null) {
- nss.declarePrefix(attr.split(":")[1],
value);
- }
- if((prefix.equals(attr.split(":")[1])) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
addAttr(String, String, NamespaceSupport) unrecognized attribute pair: " +
attr + " - " + value);
- return false;
- }
- return true;
- }
-
- /**
- * The text element is the value of this element.
- */
- public boolean addText(String text) {
- String clean = text.trim();
- if(!(text.equals(""))) {
- setType(text);
- return true;
- }
- else {
- System.err.println("Error: " + getFileName() + "
authRealm can't have a witespace value.");
- }
- return false;
- }
-
- /**
- * Converts the contents of this object into an xml tag.
- */
- public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
- try {
- handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
-
handler.characters(type.toCharArray(),0,type.length());
- handler.endElement(getUri(), getLocalName(),
getQName());
-
- if(getCompleted()) {
- nss.popContext();
- unSetCompleted();
- }
- }
- catch(Exception e) {
- System.err.println("Error: " + getFileName() + "
toXML(ContentHandler, NamespaceSupport) XML formulation error.");
- }
- return handler;
- }
-
- /**
- * Converts items into attributes for an xml tag.
- */
- public AttributesImpl getAttributes(NamespaceSupport nss) {
- AttributesImpl atts = new AttributesImpl();
-
- if(nss.getURI(getPrefix()) == null) {
- nss.pushContext();
- if(getPrefix().equals("")) {
- atts.addAttribute(getUri(), "xmlns", "xmlns",
"CDATA", getUri());
- }
- else {
- atts.addAttribute(getUri(), "xmlns:" +
getPrefix(), "xmlns:" + getPrefix(), "CDATA", getUri());
- }
- nss.declarePrefix(getPrefix(), getUri());
- setCompleted();
- }
-
- return atts;
- }
-
- /**
- * Given a DOM element (a parent), construct
- * the children elements.
- */
- public void getDOM(org.w3c.dom.Element parent) {
- org.w3c.dom.Document doc = parent.getOwnerDocument();
- if(!(getType().equals(""))) {
- org.w3c.dom.Element type =
doc.createElement(getLocalName());
- type = doc.createElementNS(getUri(), getQName());
- parent.appendChild(type);
- org.w3c.dom.Text typetext =
doc.createTextNode(getType());
- type.appendChild(typetext);
- }
- }
-
- /**
- * Called when the object is placed in
- * an output statement.
- */
- public String toString() {
- return getFileName() + ": ---> " + getType();
- }
}
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Vlan.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Vlan.java 2006-10-27
19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l2/v3_0/Vlan.java 2006-10-30
16:30:28 UTC (rev 175)
@@ -28,8 +28,8 @@
localName = "vlan";
uri = "http://ggf.org/ns/nmwg/topology/l2/3.0/";
- qName = "nmwgtopo3:vlan";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol2:vlan";
+ prefix = "nmwgtopol2";
fileName = "org/ggf/ns/nmwg/topology/l2/v3_0/Vlan.java";
}
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Asn.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Asn.java 2006-10-27
19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Asn.java 2006-10-30
16:30:28 UTC (rev 175)
@@ -27,8 +27,8 @@
asn = "";
localName = "asn";
uri = "http://ggf.org/ns/nmwg/topology/l3/3.0/";
- qName = "nmwgtopo3:asn";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol3:asn";
+ prefix = "nmwgtopol3";
fileName = "org/ggf/ns/nmwg/topology/l3/v3_0/Asn.java";
}
Deleted: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/AuthRealm.java
Deleted: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Capacity.java
Added: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Capacity.java
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/GlobalName.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/GlobalName.java
2006-10-27 19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/GlobalName.java
2006-10-30 16:30:28 UTC (rev 175)
@@ -16,21 +16,9 @@
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.NamespaceSupport;
-import org.ggf.ns.nmwg.base.v2_0.Element;
+public class GlobalName extends
org.ggf.ns.nmwg.topology.base.v3_0.GlobalName {
-public class GlobalName extends Element {
-
/**
- *
- */
- protected String globalName;
-
- /**
- *
- */
- protected String type;
-
- /**
* Constructor.
*/
public GlobalName() {
@@ -38,155 +26,8 @@
type = "";
localName = "globalName";
uri = "http://ggf.org/ns/nmwg/topology/l3/3.0/";
- qName = "nmwgtopo3:globalName";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol3:globalName";
+ prefix = "nmwgtopol3";
fileName =
"org/ggf/ns/nmwg/topology/l3/v3_0/GlobalName.java";
}
-
- /**
- * Returns the globalName value.
- */
- public String getGlobalName() {
- return globalName;
- }
-
- /**
- * Sets the globalName value.
- */
- public void setGlobalName(String newGlobalName) {
- globalName = newGlobalName;
- }
-
- /**
- * Returns the type value.
- */
- public String getType() {
- return type;
- }
-
- /**
- * Sets the type value.
- */
- public void setType(String newType) {
- type = newType;
- }
-
- /**
- * Not used in this element.
- */
- public boolean addAttr(String attr, String value, NamespaceSupport
nss) {
- if(attr.equals("type")) {
- setType(value);
- }
- else if(attr.indexOf("xmlns") >= 0) {
- if(attr.split(":").length == 1) {
- if(nss.getURI("") == null) {
- nss.declarePrefix("", value);
- }
- if((prefix.equals("")) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- else {
- if(nss.getURI(attr.split(":")[1]) == null) {
- nss.declarePrefix(attr.split(":")[1],
value);
- }
- if((prefix.equals(attr.split(":")[1])) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
addAttr(String, String, NamespaceSupport) unrecognized attribute pair: " +
attr + " - " + value);
- return false;
- }
- return true;
- }
-
- /**
- * The text element is the value of this element.
- */
- public boolean addText(String text) {
- String clean = text.trim();
- if(!(text.equals(""))) {
- setGlobalName(text);
- return true;
- }
- else {
- System.err.println("Error: " + getFileName() + "
authRealm can't have a witespace value.");
- }
- return false;
- }
-
- /**
- * Converts the contents of this object into an xml tag.
- */
- public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
- try {
- handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
-
handler.characters(globalName.toCharArray(),0,globalName.length());
- handler.endElement(getUri(), getLocalName(),
getQName());
-
- if(getCompleted()) {
- nss.popContext();
- unSetCompleted();
- }
- }
- catch(Exception e) {
- System.err.println("Error: " + getFileName() + "
toXML(ContentHandler, NamespaceSupport) XML formulation error.");
- }
- return handler;
- }
-
- /**
- * Converts items into attributes for an xml tag.
- */
- public AttributesImpl getAttributes(NamespaceSupport nss) {
- AttributesImpl atts = new AttributesImpl();
-
- if(nss.getURI(getPrefix()) == null) {
- nss.pushContext();
- if(getPrefix().equals("")) {
- atts.addAttribute(getUri(), "xmlns", "xmlns",
"CDATA", getUri());
- }
- else {
- atts.addAttribute(getUri(), "xmlns:" +
getPrefix(), "xmlns:" + getPrefix(), "CDATA", getUri());
- }
- nss.declarePrefix(getPrefix(), getUri());
- setCompleted();
- }
-
- if(!(getType().equals(""))) {
- atts.addAttribute(getUri(), "type", "type", "CDATA",
getType());
- }
-
- return atts;
- }
-
- /**
- * Given a DOM element (a parent), construct
- * the children elements.
- */
- public void getDOM(org.w3c.dom.Element parent) {
- org.w3c.dom.Document doc = parent.getOwnerDocument();
- if(!(getGlobalName().equals(""))) {
- org.w3c.dom.Element globalName =
doc.createElement(getLocalName());
- globalName = doc.createElementNS(getUri(),
getQName());
- parent.appendChild(globalName);
- org.w3c.dom.Text globalNametext =
doc.createTextNode(getGlobalName());
- globalName.appendChild(globalNametext);
-
- if(!(getType().equals(""))) {
- globalName.setAttribute("type", getType());
- }
- }
- }
-
- /**
- * Called when the object is placed in
- * an output statement.
- */
- public String toString() {
- return getFileName() + ": ---> " + getGlobalName() +
getType();
- }
}
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/IfAddress.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/IfAddress.java
2006-10-27 19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/IfAddress.java
2006-10-30 16:30:28 UTC (rev 175)
@@ -44,8 +44,8 @@
type = "";
localName = "ifAddress";
uri = "http://ggf.org/ns/nmwg/topology/l3/3.0/";
- qName = "nmwgtopo3:ifAddress";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol3:ifAddress";
+ prefix = "nmwgtopol3";
fileName = "org/ggf/ns/nmwg/topology/l3/v3_0/IfAddress.java";
useText = false;
}
Deleted: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/IfDescription.java
Added: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/IfDescription.java
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/IfHostName.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/IfHostName.java
2006-10-27 19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/IfHostName.java
2006-10-30 16:30:28 UTC (rev 175)
@@ -33,8 +33,8 @@
ifHostName = "";
localName = "ifHostName";
uri = "http://ggf.org/ns/nmwg/topology/l3/3.0/";
- qName = "nmwgtopo3:ifHostName";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol3:ifHostName";
+ prefix = "nmwgtopol3";
fileName =
"org/ggf/ns/nmwg/topology/l3/v3_0/IfHostName.java";
}
Deleted: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/IfIndex.java
Added: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/IfIndex.java
Deleted: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/IfName.java
Added: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/IfName.java
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Index.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Index.java 2006-10-27
19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Index.java 2006-10-30
16:30:28 UTC (rev 175)
@@ -14,12 +14,8 @@
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.NamespaceSupport;
-import org.ggf.ns.nmwg.base.v2_0.Element;
+public class Index extends org.ggf.ns.nmwg.topology.base.v3_0.Index {
-public class Index extends Element {
-
- protected String index;
-
/**
* Constructor.
*/
@@ -27,130 +23,8 @@
index = "";
localName = "index";
uri = "http://ggf.org/ns/nmwg/topology/l3/3.0/";
- qName = "nmwgtopo3:index";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol3:index";
+ prefix = "nmwgtopol3";
fileName = "org/ggf/ns/nmwg/topology/l3/v3_0/Index.java";
}
-
- /**
- * Returns the index value.
- */
- public String getIndex() {
- return index;
- }
-
- /**
- * Sets the index value.
- */
- public void setIndex(String newIndex) {
- index = newIndex;
- }
-
- /**
- * Not used in this element.
- */
- public boolean addAttr(String attr, String value, NamespaceSupport
nss) {
- if(attr.indexOf("xmlns") >= 0) {
- if(attr.split(":").length == 1) {
- if(nss.getURI("") == null) {
- nss.declarePrefix("", value);
- }
- if((prefix.equals("")) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- else {
- if(nss.getURI(attr.split(":")[1]) == null) {
- nss.declarePrefix(attr.split(":")[1],
value);
- }
- if((prefix.equals(attr.split(":")[1])) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
addAttr(String, String, NamespaceSupport) unrecognized attribute pair: " +
attr + " - " + value);
- return false;
- }
- return true;
- }
-
- /**
- * The text element is the value of this element.
- */
- public boolean addText(String text) {
- String clean = text.trim();
- if(!(text.equals(""))) {
- setIndex(text);
- return true;
- }
- else {
- System.err.println("Error: " + getFileName() + "
authRealm can't have a witespace value.");
- }
- return false;
- }
-
- /**
- * Converts the contents of this object into an xml tag.
- */
- public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
- try {
- handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
-
handler.characters(index.toCharArray(),0,index.length());
- handler.endElement(getUri(), getLocalName(),
getQName());
-
- if(getCompleted()) {
- nss.popContext();
- unSetCompleted();
- }
- }
- catch(Exception e) {
- System.err.println("Error: " + getFileName() + "
toXML(ContentHandler, NamespaceSupport) XML formulation error.");
- }
- return handler;
- }
-
- /**
- * Converts items into attributes for an xml tag.
- */
- public AttributesImpl getAttributes(NamespaceSupport nss) {
- AttributesImpl atts = new AttributesImpl();
-
- if(nss.getURI(getPrefix()) == null) {
- nss.pushContext();
- if(getPrefix().equals("")) {
- atts.addAttribute(getUri(), "xmlns", "xmlns",
"CDATA", getUri());
- }
- else {
- atts.addAttribute(getUri(), "xmlns:" +
getPrefix(), "xmlns:" + getPrefix(), "CDATA", getUri());
- }
- nss.declarePrefix(getPrefix(), getUri());
- setCompleted();
- }
-
- return atts;
- }
-
- /**
- * Given a DOM element (a parent), construct
- * the children elements.
- */
- public void getDOM(org.w3c.dom.Element parent) {
- org.w3c.dom.Document doc = parent.getOwnerDocument();
- if(!(getIndex().equals(""))) {
- org.w3c.dom.Element index =
doc.createElement(getLocalName());
- index = doc.createElementNS(getUri(), getQName());
- parent.appendChild(index);
- org.w3c.dom.Text indextext =
doc.createTextNode(getIndex());
- index.appendChild(indextext);
- }
- }
-
- /**
- * Called when the object is placed in
- * an output statement.
- */
- public String toString() {
- return getFileName() + ": ---> " + getIndex();
- }
}
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Interface.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Interface.java
2006-10-27 19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Interface.java
2006-10-30 16:30:28 UTC (rev 175)
@@ -27,7 +27,7 @@
import org.ggf.ns.nmwg.topology.base.v3_0.Node;
-public class Interface extends Element {
+public class Interface extends org.ggf.ns.nmwg.topology.base.v3_0.Interface {
/**
*
@@ -38,57 +38,30 @@
*
*/
protected Netmask netmaskElement;
-
+
/**
*
*/
- protected IfName ifNameElement;
-
- /**
- *
- */
- protected IfDescription ifDescriptionElement;
-
- /**
- *
- */
protected IfAddress ifAddressElement;
/**
*
*/
protected IfHostName ifHostNameElement;
-
- /**
- *
- */
- protected IfIndex ifIndexElement;
-
- /**
- *
- */
- protected Type typeElement;
/**
- *
- */
- protected Capacity capacityElement;
-
- /**
- *
- */
- protected String interfaceIdRef;
-
- /**
* Constructor.
*/
- public Interface() {
+ public Interface() {
interfaceIdRef = "";
-
+ nodeIdRef = "";
+
ifAddressElement = null;
ipAddressElement = null;
netmaskElement = null;
-
+
+ hostNameElement = null;
+ nameElement = null;
typeElement = null;
ifHostNameElement = null;
ifNameElement = null;
@@ -97,40 +70,12 @@
capacityElement = null;
localName = "interface";
uri = "http://ggf.org/ns/nmwg/topology/l3/3.0/";
- qName = "nmwgtopo3:interface";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol3:interface";
+ prefix = "nmwgtopol3";
fileName = "org/ggf/ns/nmwg/topology/l3/v3_0/Interface.java";
}
/**
- * Returns the interfaceIdRef.
- */
- public String getInterfaceIdRef() {
- return interfaceIdRef;
- }
-
- /**
- * Sets the interfaceIdRef.
- */
- public void setInterfaceIdRef(String newInterfaceIdRef) {
- interfaceIdRef = newInterfaceIdRef;
- }
-
- /**
- * Returns the Type element.
- */
- public Type getTypeElement() {
- return typeElement;
- }
-
- /**
- * Sets the Type element.
- */
- public void setTypeElement(Type newTypeElement) {
- typeElement = newTypeElement;
- }
-
- /**
* Returns the hostName element.
*/
public IfHostName getIfHostNameElement() {
@@ -143,64 +88,8 @@
public void setIfHostNameElement(IfHostName newIfHostNameElement) {
ifHostNameElement = newIfHostNameElement;
}
-
+
/**
- * Returns the IfName element.
- */
- public IfName getIfNameElement() {
- return ifNameElement;
- }
-
- /**
- * Sets the IfName element.
- */
- public void setIfNameElement(IfName newIfNameElement) {
- ifNameElement = newIfNameElement;
- }
-
- /**
- * Returns the IfDescription element.
- */
- public IfDescription getIfDescriptionElement() {
- return ifDescriptionElement;
- }
-
- /**
- * Sets the IfDescription element.
- */
- public void setIfDescriptionElement(IfDescription
newIfDescriptionElement) {
- ifDescriptionElement = newIfDescriptionElement;
- }
-
- /**
- * Returns the IfIndex element.
- */
- public IfIndex getIfIndexElement() {
- return ifIndexElement;
- }
-
- /**
- * Sets the IfIndex element.
- */
- public void setIfIndexElement(IfIndex newIfIndexElement) {
- ifIndexElement = newIfIndexElement;
- }
-
- /**
- * Returns the classOfService element.
- */
- public Capacity getCapacityElement() {
- return capacityElement;
- }
-
- /**
- * Sets the classOfService element.
- */
- public void setCapacityElement(Capacity newCapacityElement) {
- capacityElement = newCapacityElement;
- }
-
- /**
* Returns the netmask element.
*/
public Netmask getNetmaskElement() {
@@ -241,7 +130,31 @@
public void setIfAddressElement(IfAddress newIfAddressElement) {
ifAddressElement = newIfAddressElement;
}
+
+ /**
+ * Unused in this object
+ */
+ public org.ggf.ns.nmwg.topology.base.v3_0.HostName
getHostNameElement() {
+ return null;
+ }
+
+ public void
setHostNameElement(org.ggf.ns.nmwg.topology.base.v3_0.HostName
newHostNameElement) {
+ }
+ public String getNodeIdRef() {
+ return null;
+ }
+
+ public void setNodeIdRef(String newNodeIdRef) {
+ }
+
+ public org.ggf.ns.nmwg.topology.base.v3_0.Name getNameElement() {
+ return null;
+ }
+
+ public void setNameElement(org.ggf.ns.nmwg.topology.base.v3_0.Name
newNameElement) {
+ }
+
/**
* Add only children related to the interface.
*/
@@ -316,26 +229,6 @@
}
/**
- * Converts the contents of this object into an xml tag.
- */
- public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
- try {
- handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
- handler = getChildren(handler, nss);
- handler.endElement(getUri(), getLocalName(),
getQName());
-
- if(getCompleted()) {
- nss.popContext();
- unSetCompleted();
- }
- }
- catch(Exception e) {
- System.err.println("Error: " + getFileName() + "
toXML(ContentHandler, NamespaceSupport) XML formulation error.");
- }
- return handler;
- }
-
- /**
* Converts items into attributes for an xml tag.
*/
public AttributesImpl getAttributes(NamespaceSupport nss) {
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/IpAddress.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/IpAddress.java
2006-10-27 19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/IpAddress.java
2006-10-30 16:30:28 UTC (rev 175)
@@ -44,8 +44,8 @@
type = "";
localName = "ipAddress";
uri = "http://ggf.org/ns/nmwg/topology/l3/3.0/";
- qName = "nmwgtopo3:ipAddress";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol3:ipAddress";
+ prefix = "nmwgtopol3";
fileName = "org/ggf/ns/nmwg/topology/l3/v3_0/IpAddress.java";
useText = false;
}
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Link.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Link.java 2006-10-27
19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Link.java 2006-10-30
16:30:28 UTC (rev 175)
@@ -31,55 +31,11 @@
import org.ggf.ns.nmwg.base.v2_0.Element;
import org.ggf.ns.nmwg.topology.base.v3_0.Node;
+import org.ggf.ns.nmwg.topology.base.v3_0.Interface;
-public class Link extends Element {
+public class Link extends org.ggf.ns.nmwg.topology.base.v3_0.Link {
/**
- *
- */
- protected Type typeElement;
-
- /**
- *
- */
- protected Index indexElement;
-
- /**
- *
- */
- protected Name nameElement;
-
- /**
- *
- */
- protected GlobalName globalNameElement;
-
- /**
- *
- */
- protected AuthRealm authRealmElement;
-
- /**
- * 'map' of link elements
- */
- protected Map linkMap;
-
- /**
- * 'map' of interface elements
- */
- protected Map interfaceMap;
-
- /**
- * 'map' of node elements
- */
- protected Map nodeMap;
-
- /**
- * attribute for linkIdRef
- */
- protected String linkIdRef;
-
- /**
* Constructor.
*/
public Link() {
@@ -87,7 +43,6 @@
nameElement = null;
globalNameElement = null;
indexElement = null;
- authRealmElement = null;
linkMap = new HashMap();
interfaceMap = new HashMap();
@@ -96,546 +51,8 @@
linkIdRef = "";
uri = "http://ggf.org/ns/nmwg/topology/l3/3.0/";
- qName = "nmwgtopo3:link";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol3:link";
+ prefix = "nmwgtopol3";
fileName = "org/ggf/ns/nmwg/topology/l3/v3_0/Link.java";
}
-
- /**
- * Returns the Type element.
- */
- public Type getTypeElement() {
- return typeElement;
- }
-
- /**
- * Sets the Type element.
- */
- public void setTypeElement(Type newTypeElement) {
- typeElement = newTypeElement;
- }
-
- /**
- * Returns the Name element.
- */
- public Name getNameElement() {
- return nameElement;
- }
-
- /**
- * Sets the Name element.
- */
- public void setNameElement(Name newNameElement) {
- nameElement = newNameElement;
- }
-
-
- /**
- * Returns the AuthRealm element.
- */
- public AuthRealm getAuthRealmElement() {
- return authRealmElement;
- }
-
- /**
- * Sets the AuthRealm element.
- */
- public void setAuthRealmElement(AuthRealm newAuthRealmElement) {
- authRealmElement = newAuthRealmElement;
- }
-
- /**
- * Returns the GlobalName element.
- */
- public GlobalName getGlobalNameElement() {
- return globalNameElement;
- }
-
- /**
- * Sets the Name element.
- */
- public void setGlobalNameElement(GlobalName newGlobalNameElement) {
- globalNameElement = newGlobalNameElement;
- }
-
- /**
- * Returns the index element.
- */
- public Index getIndexElement() {
- return indexElement;
- }
-
- /**
- * Sets the index element.
- */
- public void setIndexElement(Index newIndexElement) {
- indexElement = newIndexElement;
- }
-
- /**
- * Returns a linkIdRef.
- */
- public String getLinkIdRef() {
- return linkIdRef;
- }
-
- /**
- * Sets a messageIdRef.
- */
- public void setLinkIdRef(String newLinkIdRef) {
- linkIdRef = newLinkIdRef;
- }
-
-
-/**
- * Node Section
- */
-
- /**
- * clear all Node elements
- */
- public void clearNode() {
- nodeMap = new HashMap();
- }
-
- /**
- * Adds a node to the map
- */
- public void setNode(Node newNode) {
- if(newNode != null) {
- if(!(newNode.getId().equals(""))) {
- nodeMap.put(newNode.getId(),newNode);
- }
- else {
- System.err.println("Error: " + getFileName()
+ " 'setNode(Node)' cannot have nil value for id.");
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
'setNode(Node)' cannot have nil value for Node.");
- }
- }
-
- /**
- * Return the node map
- */
- public Map getNodeMap() {
- return this.nodeMap;
- }
-
- /**
- * Convert and return the node block in array form
- */
- public Node[] getNodeArray() {
- return (Node [])nodeMap.values().toArray(new
Node[nodeMap.size()]);
- }
-
- /**
- * Get an iterartor to the node map
- */
- public Iterator getNodeIterator() {
- return nodeMap.values().iterator();
- }
-
- /**
- * Get a single node block by id from the node block
- */
- public Node getNode(String id) {
- if(!(id.equals(""))) {
- Node md = (Node) nodeMap.get(id);
- if(md == null) {
- System.err.println("Error: " + getFileName()
+ " 'getNode(String)' has returned null for id: " + id);
- }
- return md;
- }
- else {
- System.err.println("Error: " + getFileName() + "
'getNode(String)' id cannont be nil.");
- return null;
- }
- }
-
-
-
-/**
- * Link Section
- */
-
- /**
- * clear all Link elements
- */
- public void clearLink() {
- linkMap = new HashMap();
- }
-
- /**
- * Adds a link to the map
- */
- public void setLink(Link newLink) {
- if(newLink != null) {
- if(!(newLink.getId().equals(""))) {
- linkMap.put(newLink.getId(),newLink);
- }
- else {
- System.err.println("Error: " + getFileName()
+ " 'setLink(Link)' cannot have nil value for id.");
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
'setLink(Link)' cannot have nil value for Link.");
- }
- }
-
- /**
- * Return the link map
- */
- public Map getLinkMap() {
- return this.linkMap;
- }
-
- /**
- * Convert and return the link block in array form
- */
- public Link[] getLinkArray() {
- return (Link [])linkMap.values().toArray(new
Link[linkMap.size()]);
- }
-
- /**
- * Get an iterartor to the link map
- */
- public Iterator getLinkIterator() {
- return linkMap.values().iterator();
- }
-
- /**
- * Get a single link block by id from the link block
- */
- public Link getLink(String id) {
- if(!(id.equals(""))) {
- Link l = (Link) linkMap.get(id);
- if(l == null) {
- System.err.println("Error: " + getFileName()
+ " 'getLink(String)' has returned null for id: " + id);
- }
- return l;
- }
- else {
- System.err.println("Error: " + getFileName() + "
'getLink(String)' id cannont be nil.");
- return null;
- }
- }
-
-
-/**
- * Interface Section
- */
-
-
-
- /**
- * clear all Interface elements
- */
- public void clearInterface() {
- interfaceMap = new HashMap();
- }
-
- /**
- * Adds a interface to the map
- */
- public void setInterface(Interface newInterface) {
- if(newInterface != null) {
- if(!(newInterface.getId().equals(""))) {
-
interfaceMap.put(newInterface.getId(),newInterface);
- }
- else {
- System.err.println("Error: " + getFileName()
+ " 'setInterface(Interface)' cannot have nil value for id.");
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
'setInterface(Interface)' cannot have nil value for Interface.");
- }
- }
-
- /**
- * Return the interface map
- */
- public Map getInterfaceMap() {
- return this.interfaceMap;
- }
-
- /**
- * Convert and return the interface block in array form
- */
- public Interface[] getInterfaceArray() {
- return (Interface [])interfaceMap.values().toArray(new
Interface[interfaceMap.size()]);
- }
-
- /**
- * Get an iterartor to the interface map
- */
- public Iterator getInterfaceIterator() {
- return interfaceMap.values().iterator();
- }
-
- /**
- * Get a single interface block by id from the interface block
- */
- public Interface getInterface(String id) {
- if(!(id.equals(""))) {
- Interface i = (Interface) interfaceMap.get(id);
- if(i == null) {
- System.err.println("Error: " + getFileName()
+ " 'getInterface(String)' has returned null for id: " + id);
- }
- return i;
- }
- else {
- System.err.println("Error: " + getFileName() + "
'getInterface(String)' id cannont be nil.");
- return null;
- }
- }
-
-
-
- /**
- * Add only children related to the link.
- */
- public boolean addChild(Element newChild) {
- if(newChild.getLocalName().equals("type")) {
- setTypeElement((Type)newChild);
- }
- else if(newChild.getLocalName().equals("name")) {
- setNameElement((Name)newChild);
- }
- else if(newChild.getLocalName().equals("authRealm")) {
- setAuthRealmElement((AuthRealm)newChild);
- }
- else if(newChild.getLocalName().equals("globalName")) {
- setGlobalNameElement((GlobalName)newChild);
- }
- else if(newChild.getLocalName().equals("index")) {
- setIndexElement((Index)newChild);
- }
- else if(newChild.getLocalName().equals("node")) {
- setNode((Node)newChild);
- }
- else if(newChild.getLocalName().equals("link")) {
- setLink((Link)newChild);
- }
- else if(newChild.getLocalName().equals("interface")) {
- setInterface((Interface)newChild);
- }
- else {
- System.err.println("Error: " + getFileName() + "
addChild(Element) unrecognized child: " + newChild);
- return false;
- }
- return true;
- }
-
- /**
- * There shouldnt be an attribute, but there could be a namespace?
- */
- public boolean addAttr(String attr, String value, NamespaceSupport
nss) {
- if(attr.indexOf("xmlns") >= 0) {
- if(attr.split(":").length == 1) {
- if(nss.getURI("") == null) {
- nss.declarePrefix("", value);
- }
- if((prefix.equals("")) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- else {
- if(nss.getURI(attr.split(":")[1]) == null) {
- nss.declarePrefix(attr.split(":")[1],
value);
- }
- if((prefix.equals(attr.split(":")[1])) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- }
- else if(attr.equals("id")) {
- setId(value);
- }
- else if(attr.equals("linkIdRef")) {
- setLinkIdRef(value);
- }
- else {
- System.err.println("Error: " + getFileName() + "
addAttr(String, String, NamespaceSupport) unrecognized attribute pair: " +
attr + " - " + value);
- return false;
- }
- return true;
- }
-
- /**
- * Converts the contents of this object into an xml tag.
- */
- public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
- try {
- handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
- handler = getChildren(handler, nss);
- handler.endElement(getUri(), getLocalName(),
getQName());
-
- if(getCompleted()) {
- nss.popContext();
- unSetCompleted();
- }
- }
- catch(Exception e) {
- System.err.println("Error: " + getFileName() + "
toXML(ContentHandler, NamespaceSupport) XML formulation error.");
- }
- return handler;
- }
-
- /**
- * Converts items into attributes for an xml tag.
- */
- public AttributesImpl getAttributes(NamespaceSupport nss) {
- AttributesImpl atts = new AttributesImpl();
-
- if(nss.getURI(getPrefix()) == null) {
- nss.pushContext();
- if(getPrefix().equals("")) {
- atts.addAttribute(getUri(), "xmlns", "xmlns",
"CDATA", getUri());
- }
- else {
- atts.addAttribute(getUri(), "xmlns:" +
getPrefix(), "xmlns:" + getPrefix(), "CDATA", getUri());
- }
- nss.declarePrefix(getPrefix(), getUri());
- setCompleted();
- }
- if(!(getId().equals(""))) {
- atts.addAttribute(getUri(), "id", "id", "CDATA",
getId());
- }
- if(!(getLinkIdRef().equals(""))) {
- atts.addAttribute(getUri(), "linkIdRef", "linkIdRef",
"CDATA", getLinkIdRef());
- }
-
- return atts;
- }
-
- /**
- * Chases children references down to pring out all related xml tags.
- */
- public ContentHandler getChildren(ContentHandler handler,
NamespaceSupport nss) throws Exception {
-
- Link tl;
- Interface ti;
- Node tn;
- Collection lc = getLinkMap().values();
- Collection ic = getInterfaceMap().values();
- Collection nc = getNodeMap().values();
-
- for(Iterator i = lc.iterator(); i.hasNext(); ){
- tl = (Link)i.next();
- handler = tl.toXML(handler, nss);
- }
- for(Iterator i = ic.iterator(); i.hasNext(); ){
- ti = (Interface)i.next();
- handler = ti.toXML(handler, nss);
- }
- for(Iterator i = nc.iterator(); i.hasNext(); ){
- tn = (Node)i.next();
- handler = tn.toXML(handler, nss);
- }
-
- if(getTypeElement() != null) {
- handler = getTypeElement().toXML(handler, nss);
- }
- if(getNameElement() != null) {
- handler = getNameElement().toXML(handler, nss);
- }
- if(getAuthRealmElement() != null) {
- handler = getAuthRealmElement().toXML(handler, nss);
- }
- if(getGlobalNameElement() != null) {
- handler = getGlobalNameElement().toXML(handler, nss);
- }
- if(getIndexElement() != null) {
- handler = getIndexElement().toXML(handler, nss);
- }
- return handler;
- }
-
- /**
- * Given a DOM element (a parent), construct
- * the children elements.
- */
- public void getDOM(org.w3c.dom.Element parent) {
- Link tl;
- Interface ti;
- Node tn;
- Collection lc = getLinkMap().values();
- Collection ic = getInterfaceMap().values();
- Collection nc = getNodeMap().values();
-
-
- org.w3c.dom.Document doc = parent.getOwnerDocument();
- org.w3c.dom.Element intfc = doc.createElement(getLocalName());
- intfc = doc.createElementNS(getUri(), getQName());
- parent.appendChild(intfc);
-
- if(getTypeElement() != null) {
- getTypeElement().getDOM(intfc);
- }
- if(getNameElement() != null) {
- getNameElement().getDOM(intfc);
- }
- if(getAuthRealmElement() != null) {
- getAuthRealmElement().getDOM(intfc);
- }
- if(getGlobalNameElement() != null) {
- getGlobalNameElement().getDOM(intfc);
- }
- if(getIndexElement() != null) {
- getIndexElement().getDOM(intfc);
- }
-
- if(!(getId().equals(""))) {
- intfc.setAttribute("id", getId());
- }
- if(!(getLinkIdRef().equals(""))) {
- intfc.setAttribute("linkIdRef", getLinkIdRef());
- }
-
- for(Iterator i = lc.iterator(); i.hasNext(); ){
- tl = (Link)i.next();
- tl.getDOM(intfc);
- }
- for(Iterator i = ic.iterator(); i.hasNext(); ){
- ti = (Interface)i.next();
- ti.getDOM(intfc);
- }
- for(Iterator i = nc.iterator(); i.hasNext(); ){
- tn = (Node)i.next();
- tn.getDOM(intfc);
- }
-
- }
-
- /**
- * Called when the object is placed in
- * an output statement.
- */
- public String toString() {
- Link tl;
- Interface ti;
- Node tn;
- Collection lc = getLinkMap().values();
- Collection ic = getInterfaceMap().values();
- Collection nc = getNodeMap().values();
-
- String ns = "", ls = "" , is = "";
-
- for(Iterator i = lc.iterator(); i.hasNext(); ){
- tl = (Link)i.next();
- ls = ls + tl.toString();
- }
- for(Iterator i = ic.iterator(); i.hasNext(); ){
- ti = (Interface)i.next();
- is = is + ti.toString();
- }
- for(Iterator i = nc.iterator(); i.hasNext(); ){
- tn = (Node)i.next();
- ns = ns + tn.toString();
- }
-
- return getFileName() + ": ---> " + getId() + getLinkIdRef() +
getAuthRealmElement() + getTypeElement() + getNameElement() +
getGlobalNameElement() + getIndexElement() + " link:" + ls + " interface:" +
is + " node:" + ns;
- }
-
}
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Name.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Name.java 2006-10-27
19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Name.java 2006-10-30
16:30:28 UTC (rev 175)
@@ -16,21 +16,9 @@
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.NamespaceSupport;
-import org.ggf.ns.nmwg.base.v2_0.Element;
+public class Name extends org.ggf.ns.nmwg.topology.base.v3_0.Name {
-public class Name extends Element {
-
/**
- *
- */
- protected String name;
-
- /**
- *
- */
- protected String type;
-
- /**
* Constructor.
*/
public Name() {
@@ -38,155 +26,8 @@
type = "";
localName = "name";
uri = "http://ggf.org/ns/nmwg/topology/l3/3.0/";
- qName = "nmwgtopo3:name";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol3:name";
+ prefix = "nmwgtopol3";
fileName = "org/ggf/ns/nmwg/topology/l3/v3_0/Name.java";
}
-
- /**
- * Returns the name value.
- */
- public String getName() {
- return name;
- }
-
- /**
- * Sets the name value.
- */
- public void setName(String newName) {
- name = newName;
- }
-
- /**
- * Returns the type value.
- */
- public String getType() {
- return type;
- }
-
- /**
- * Sets the type value.
- */
- public void setType(String newType) {
- type = newType;
- }
-
- /**
- * Not used in this element.
- */
- public boolean addAttr(String attr, String value, NamespaceSupport
nss) {
- if(attr.equals("type")) {
- setType(value);
- }
- else if(attr.indexOf("xmlns") >= 0) {
- if(attr.split(":").length == 1) {
- if(nss.getURI("") == null) {
- nss.declarePrefix("", value);
- }
- if((prefix.equals("")) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- else {
- if(nss.getURI(attr.split(":")[1]) == null) {
- nss.declarePrefix(attr.split(":")[1],
value);
- }
- if((prefix.equals(attr.split(":")[1])) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
addAttr(String, String, NamespaceSupport) unrecognized attribute pair: " +
attr + " - " + value);
- return false;
- }
- return true;
- }
-
- /**
- * The text element is the value of this element.
- */
- public boolean addText(String text) {
- String clean = text.trim();
- if(!(text.equals(""))) {
- setName(text);
- return true;
- }
- else {
- System.err.println("Error: " + getFileName() + "
authRealm can't have a witespace value.");
- }
- return false;
- }
-
- /**
- * Converts the contents of this object into an xml tag.
- */
- public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
- try {
- handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
-
handler.characters(name.toCharArray(),0,name.length());
- handler.endElement(getUri(), getLocalName(),
getQName());
-
- if(getCompleted()) {
- nss.popContext();
- unSetCompleted();
- }
- }
- catch(Exception e) {
- System.err.println("Error: " + getFileName() + "
toXML(ContentHandler, NamespaceSupport) XML formulation error.");
- }
- return handler;
- }
-
- /**
- * Converts items into attributes for an xml tag.
- */
- public AttributesImpl getAttributes(NamespaceSupport nss) {
- AttributesImpl atts = new AttributesImpl();
-
- if(nss.getURI(getPrefix()) == null) {
- nss.pushContext();
- if(getPrefix().equals("")) {
- atts.addAttribute(getUri(), "xmlns", "xmlns",
"CDATA", getUri());
- }
- else {
- atts.addAttribute(getUri(), "xmlns:" +
getPrefix(), "xmlns:" + getPrefix(), "CDATA", getUri());
- }
- nss.declarePrefix(getPrefix(), getUri());
- setCompleted();
- }
-
- if(!(getType().equals(""))) {
- atts.addAttribute(getUri(), "type", "type", "CDATA",
getType());
- }
-
- return atts;
- }
-
- /**
- * Given a DOM element (a parent), construct
- * the children elements.
- */
- public void getDOM(org.w3c.dom.Element parent) {
- org.w3c.dom.Document doc = parent.getOwnerDocument();
- if(!(getName().equals(""))) {
- org.w3c.dom.Element name =
doc.createElement(getLocalName());
- name = doc.createElementNS(getUri(), getQName());
- parent.appendChild(name);
- org.w3c.dom.Text nametext =
doc.createTextNode(getName());
- name.appendChild(nametext);
-
- if(!(getType().equals(""))) {
- name.setAttribute("type", getType());
- }
- }
- }
-
- /**
- * Called when the object is placed in
- * an output statement.
- */
- public String toString() {
- return getFileName() + ": ---> " + getName() + getType();
- }
}
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Netmask.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Netmask.java
2006-10-27 19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Netmask.java
2006-10-30 16:30:28 UTC (rev 175)
@@ -27,8 +27,8 @@
netmask = "";
localName = "netmask";
uri = "http://ggf.org/ns/nmwg/topology/l3/3.0/";
- qName = "nmwgtopo3:netmask";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol3:netmask";
+ prefix = "nmwgtopol3";
fileName = "org/ggf/ns/nmwg/topology/l3/v3_0/Netmask.java";
}
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Network.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Network.java
2006-10-27 19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Network.java
2006-10-30 16:30:28 UTC (rev 175)
@@ -26,19 +26,12 @@
import org.xml.sax.helpers.NamespaceSupport;
import org.ggf.ns.nmwg.base.v2_0.Element;
+
import org.ggf.ns.nmwg.topology.base.v3_0.Node;
+import org.ggf.ns.nmwg.topology.base.v3_0.Interface;
+import org.ggf.ns.nmwg.topology.base.v3_0.Link;
-public class Network extends Element {
-
- /**
- *
- */
- protected Name nameElement;
-
- /**
- *
- */
- protected Type typeElement;
+public class Network extends org.ggf.ns.nmwg.topology.base.v3_0.Network {
/**
*
@@ -55,28 +48,7 @@
*/
protected Asn asnElement;
-
/**
- * 'map' of link elements
- */
- protected Map linkMap;
-
- /**
- * 'map' of interface elements
- */
- protected Map interfaceMap;
-
- /**
- * 'map' of node elements
- */
- protected Map nodeMap;
-
- /**
- * attribute for linkIdRef
- */
- protected String networkIdRef;
-
- /**
* Constructor.
*/
public Network() {
@@ -94,26 +66,12 @@
networkIdRef = "";
uri = "http://ggf.org/ns/nmwg/topology/l3/3.0/";
- qName = "nmwgtopo3:network";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol3:network";
+ prefix = "nmwgtopol3";
fileName = "org/ggf/ns/nmwg/topology/l3/v3_0/Network.java";
}
-
+
/**
- * Returns the Name element.
- */
- public Name getNameElement() {
- return nameElement;
- }
-
- /**
- * Sets the Name element.
- */
- public void setNameElement(Name newNameElement) {
- nameElement = newNameElement;
- }
-
- /**
* Returns the netmask element.
*/
public Netmask getNetmaskElement() {
@@ -156,240 +114,6 @@
}
/**
- * Returns the type element.
- */
- public Type getTypeElement() {
- return typeElement;
- }
-
- /**
- * Sets the type element.
- */
- public void setTypeElement(Type newTypeElement) {
- typeElement = newTypeElement;
- }
-
- /**
- * Returns a networkIdRef.
- */
- public String getNetworkIdRef() {
- return networkIdRef;
- }
-
- /**
- * Sets a messageIdRef.
- */
- public void setNetworkIdRef(String newNetworkIdRef) {
- networkIdRef = newNetworkIdRef;
- }
-
-
-/**
- * Node Section
- */
-
- /**
- * clear all Node elements
- */
- public void clearNode() {
- nodeMap = new HashMap();
- }
-
- /**
- * Adds a node to the map
- */
- public void setNode(Node newNode) {
- if(newNode != null) {
- if(!(newNode.getId().equals(""))) {
- nodeMap.put(newNode.getId(),newNode);
- }
- else {
- System.err.println("Error: " + getFileName()
+ " 'setNode(Node)' cannot have nil value for id.");
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
'setNode(Node)' cannot have nil value for Node.");
- }
- }
-
- /**
- * Return the node map
- */
- public Map getNodeMap() {
- return this.nodeMap;
- }
-
- /**
- * Convert and return the node block in array form
- */
- public Node[] getNodeArray() {
- return (Node [])nodeMap.values().toArray(new
Node[nodeMap.size()]);
- }
-
- /**
- * Get an iterartor to the node map
- */
- public Iterator getNodeIterator() {
- return nodeMap.values().iterator();
- }
-
- /**
- * Get a single node block by id from the node block
- */
- public Node getNode(String id) {
- if(!(id.equals(""))) {
- Node md = (Node) nodeMap.get(id);
- if(md == null) {
- System.err.println("Error: " + getFileName()
+ " 'getNode(String)' has returned null for id: " + id);
- }
- return md;
- }
- else {
- System.err.println("Error: " + getFileName() + "
'getNode(String)' id cannont be nil.");
- return null;
- }
- }
-
-
-
-/**
- * Link Section
- */
-
- /**
- * clear all Link elements
- */
- public void clearLink() {
- linkMap = new HashMap();
- }
-
- /**
- * Adds a link to the map
- */
- public void setLink(Link newLink) {
- if(newLink != null) {
- if(!(newLink.getId().equals(""))) {
- linkMap.put(newLink.getId(),newLink);
- }
- else {
- System.err.println("Error: " + getFileName()
+ " 'setLink(Link)' cannot have nil value for id.");
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
'setLink(Link)' cannot have nil value for Link.");
- }
- }
-
- /**
- * Return the link map
- */
- public Map getLinkMap() {
- return this.linkMap;
- }
-
- /**
- * Convert and return the link block in array form
- */
- public Link[] getLinkArray() {
- return (Link [])linkMap.values().toArray(new
Link[linkMap.size()]);
- }
-
- /**
- * Get an iterartor to the link map
- */
- public Iterator getLinkIterator() {
- return linkMap.values().iterator();
- }
-
- /**
- * Get a single link block by id from the link block
- */
- public Link getLink(String id) {
- if(!(id.equals(""))) {
- Link l = (Link) linkMap.get(id);
- if(l == null) {
- System.err.println("Error: " + getFileName()
+ " 'getLink(String)' has returned null for id: " + id);
- }
- return l;
- }
- else {
- System.err.println("Error: " + getFileName() + "
'getLink(String)' id cannont be nil.");
- return null;
- }
- }
-
-
-/**
- * Interface Section
- */
-
-
-
- /**
- * clear all Interface elements
- */
- public void clearInterface() {
- interfaceMap = new HashMap();
- }
-
- /**
- * Adds a interface to the map
- */
- public void setInterface(Interface newInterface) {
- if(newInterface != null) {
- if(!(newInterface.getId().equals(""))) {
-
interfaceMap.put(newInterface.getId(),newInterface);
- }
- else {
- System.err.println("Error: " + getFileName()
+ " 'setInterface(Interface)' cannot have nil value for id.");
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
'setInterface(Interface)' cannot have nil value for Interface.");
- }
- }
-
- /**
- * Return the interface map
- */
- public Map getInterfaceMap() {
- return this.interfaceMap;
- }
-
- /**
- * Convert and return the interface block in array form
- */
- public Interface[] getInterfaceArray() {
- return (Interface [])interfaceMap.values().toArray(new
Interface[interfaceMap.size()]);
- }
-
- /**
- * Get an iterartor to the interface map
- */
- public Iterator getInterfaceIterator() {
- return interfaceMap.values().iterator();
- }
-
- /**
- * Get a single interface block by id from the interface block
- */
- public Interface getInterface(String id) {
- if(!(id.equals(""))) {
- Interface i = (Interface) interfaceMap.get(id);
- if(i == null) {
- System.err.println("Error: " + getFileName()
+ " 'getInterface(String)' has returned null for id: " + id);
- }
- return i;
- }
- else {
- System.err.println("Error: " + getFileName() + "
'getInterface(String)' id cannont be nil.");
- return null;
- }
- }
-
-
-
- /**
* Add only children related to the link.
*/
public boolean addChild(Element newChild) {
@@ -425,88 +149,6 @@
}
/**
- * There shouldnt be an attribute, but there could be a namespace?
- */
- public boolean addAttr(String attr, String value, NamespaceSupport
nss) {
- if(attr.indexOf("xmlns") >= 0) {
- if(attr.split(":").length == 1) {
- if(nss.getURI("") == null) {
- nss.declarePrefix("", value);
- }
- if((prefix.equals("")) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- else {
- if(nss.getURI(attr.split(":")[1]) == null) {
- nss.declarePrefix(attr.split(":")[1],
value);
- }
- if((prefix.equals(attr.split(":")[1])) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- }
- else if(attr.equals("id")) {
- setId(value);
- }
- else if(attr.equals("networkIdRef")) {
- setNetworkIdRef(value);
- }
- else {
- System.err.println("Error: " + getFileName() + "
addAttr(String, String, NamespaceSupport) unrecognized attribute pair: " +
attr + " - " + value);
- return false;
- }
- return true;
- }
-
- /**
- * Converts the contents of this object into an xml tag.
- */
- public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
- try {
- handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
- handler = getChildren(handler, nss);
- handler.endElement(getUri(), getLocalName(),
getQName());
-
- if(getCompleted()) {
- nss.popContext();
- unSetCompleted();
- }
- }
- catch(Exception e) {
- System.err.println("Error: " + getFileName() + "
toXML(ContentHandler, NamespaceSupport) XML formulation error.");
- }
- return handler;
- }
-
- /**
- * Converts items into attributes for an xml tag.
- */
- public AttributesImpl getAttributes(NamespaceSupport nss) {
- AttributesImpl atts = new AttributesImpl();
-
- if(nss.getURI(getPrefix()) == null) {
- nss.pushContext();
- if(getPrefix().equals("")) {
- atts.addAttribute(getUri(), "xmlns", "xmlns",
"CDATA", getUri());
- }
- else {
- atts.addAttribute(getUri(), "xmlns:" +
getPrefix(), "xmlns:" + getPrefix(), "CDATA", getUri());
- }
- nss.declarePrefix(getPrefix(), getUri());
- setCompleted();
- }
- if(!(getId().equals(""))) {
- atts.addAttribute(getUri(), "id", "id", "CDATA",
getId());
- }
- if(!(getNetworkIdRef().equals(""))) {
- atts.addAttribute(getUri(), "networkIdRef",
"networkIdRef", "CDATA", getNetworkIdRef());
- }
-
- return atts;
- }
-
- /**
* Chases children references down to pring out all related xml tags.
*/
public ContentHandler getChildren(ContentHandler handler,
NamespaceSupport nss) throws Exception {
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Path.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Path.java 2006-10-27
19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Path.java 2006-10-30
16:30:28 UTC (rev 175)
@@ -21,21 +21,11 @@
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.NamespaceSupport;
-import org.ggf.ns.nmwg.base.v2_0.Element;
+import org.ggf.ns.nmwg.topology.base.v3_0.Link;
-public class Path extends Element {
+public class Path extends org.ggf.ns.nmwg.topology.base.v3_0.Path {
/**
- * 'map' of link elements
- */
- protected Map linkMap;
-
- /**
- * attribute for pathIdRef
- */
- protected String pathIdRef;
-
- /**
* Constructor.
*/
public Path() {
@@ -44,242 +34,8 @@
pathIdRef = "";
uri = "http://ggf.org/ns/nmwg/topology/l3/3.0/";
- qName = "nmwgtopo3:path";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol3:path";
+ prefix = "nmwgtopol3";
fileName = "org/ggf/ns/nmwg/topology/l3/v3_0/Path.java";
}
-
- /**
- * Returns a pathIdRef.
- */
- public String getPathIdRef() {
- return pathIdRef;
- }
-
- /**
- * Sets a pathIdRef.
- */
- public void setPathIdRef(String newPathIdRef) {
- pathIdRef = newPathIdRef;
- }
-
-/**
- * Link Section
- */
-
- /**
- * clear all Link elements
- */
- public void clearLink() {
- linkMap = new HashMap();
- }
-
- /**
- * Adds a link to the map
- */
- public void setLink(Link newLink) {
- if(newLink != null) {
- if(!(newLink.getId().equals(""))) {
- linkMap.put(newLink.getId(),newLink);
- }
- else {
- System.err.println("Error: " + getFileName()
+ " 'setLink(Link)' cannot have nil value for id.");
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
'setLink(Link)' cannot have nil value for Link.");
- }
- }
-
- /**
- * Return the link map
- */
- public Map getLinkMap() {
- return this.linkMap;
- }
-
- /**
- * Convert and return the link block in array form
- */
- public Link[] getLinkArray() {
- return (Link [])linkMap.values().toArray(new
Link[linkMap.size()]);
- }
-
- /**
- * Get an iterartor to the link map
- */
- public Iterator getLinkIterator() {
- return linkMap.values().iterator();
- }
-
- /**
- * Get a single link block by id from the link block
- */
- public Link getLink(String id) {
- if(!(id.equals(""))) {
- Link l = (Link) linkMap.get(id);
- if(l == null) {
- System.err.println("Error: " + getFileName()
+ " 'getLink(String)' has returned null for id: " + id);
- }
- return l;
- }
- else {
- System.err.println("Error: " + getFileName() + "
'getLink(String)' id cannont be nil.");
- return null;
- }
- }
-
- /**
- * Add only children related to the link.
- */
- public boolean addChild(Element newChild) {
- if(newChild.getLocalName().equals("link")) {
- setLink((Link)newChild);
- }
- else {
- System.err.println("Error: " + getFileName() + "
addChild(Element) unrecognized child: " + newChild);
- return false;
- }
- return true;
- }
-
- /**
- * There shouldnt be an attribute, but there could be a namespace?
- */
- public boolean addAttr(String attr, String value, NamespaceSupport
nss) {
- if(attr.indexOf("xmlns") >= 0) {
- if(attr.split(":").length == 1) {
- if(nss.getURI("") == null) {
- nss.declarePrefix("", value);
- }
- if((prefix.equals("")) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- else {
- if(nss.getURI(attr.split(":")[1]) == null) {
- nss.declarePrefix(attr.split(":")[1],
value);
- }
- if((prefix.equals(attr.split(":")[1])) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- }
- else if(attr.equals("id")) {
- setId(value);
- }
- else if(attr.equals("pathIdRef")) {
- setPathIdRef(value);
- }
- else {
- System.err.println("Error: " + getFileName() + "
addAttr(String, String, NamespaceSupport) unrecognized attribute pair: " +
attr + " - " + value);
- return false;
- }
- return true;
- }
-
- /**
- * Converts the contents of this object into an xml tag.
- */
- public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
- try {
- handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
- handler = getChildren(handler, nss);
- handler.endElement(getUri(), getLocalName(),
getQName());
-
- if(getCompleted()) {
- nss.popContext();
- unSetCompleted();
- }
- }
- catch(Exception e) {
- System.err.println("Error: " + getFileName() + "
toXML(ContentHandler, NamespaceSupport) XML formulation error.");
- }
- return handler;
- }
-
- /**
- * Converts items into attributes for an xml tag.
- */
- public AttributesImpl getAttributes(NamespaceSupport nss) {
- AttributesImpl atts = new AttributesImpl();
-
- if(nss.getURI(getPrefix()) == null) {
- nss.pushContext();
- if(getPrefix().equals("")) {
- atts.addAttribute(getUri(), "xmlns", "xmlns",
"CDATA", getUri());
- }
- else {
- atts.addAttribute(getUri(), "xmlns:" +
getPrefix(), "xmlns:" + getPrefix(), "CDATA", getUri());
- }
- nss.declarePrefix(getPrefix(), getUri());
- setCompleted();
- }
- if(!(getId().equals(""))) {
- atts.addAttribute(getUri(), "id", "id", "CDATA",
getId());
- }
- if(!(getPathIdRef().equals(""))) {
- atts.addAttribute(getUri(), "pathIdRef", "pathIdRef",
"CDATA", getPathIdRef());
- }
-
- return atts;
- }
-
- /**
- * Chases children references down to pring out all related xml tags.
- */
- public ContentHandler getChildren(ContentHandler handler,
NamespaceSupport nss) throws Exception {
- Link tl;
- Collection lc = getLinkMap().values();
-
- for(Iterator i = lc.iterator(); i.hasNext(); ){
- tl = (Link)i.next();
- handler = tl.toXML(handler, nss);
- }
- return handler;
- }
-
- /**
- * Given a DOM element (a parent), construct
- * the children elements.
- */
- public void getDOM(org.w3c.dom.Element parent) {
- Link tl;
- Collection lc = getLinkMap().values();
-
- org.w3c.dom.Document doc = parent.getOwnerDocument();
- org.w3c.dom.Element intfc = doc.createElement(getLocalName());
- intfc = doc.createElementNS(getUri(), getQName());
- parent.appendChild(intfc);
-
- if(!(getId().equals(""))) {
- intfc.setAttribute("id", getId());
- }
- if(!(getPathIdRef().equals(""))) {
- intfc.setAttribute("pathIdRef", getPathIdRef());
- }
-
- for(Iterator i = lc.iterator(); i.hasNext(); ){
- tl = (Link)i.next();
- tl.getDOM(intfc);
- }
-
- }
-
- /**
- * Called when the object is placed in
- * an output statement.
- */
- public String toString() {
- Link tl;
- Collection lc = getLinkMap().values();
- String ls = "";
-
- for(Iterator i = lc.iterator(); i.hasNext(); ){
- tl = (Link)i.next();
- ls = ls + tl.toString();
- }
- return getFileName() + ": ---> " + getId() + getPathIdRef() +
" link:" + ls;
- }
-
}
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Role.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Role.java 2006-10-27
19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Role.java 2006-10-30
16:30:28 UTC (rev 175)
@@ -14,12 +14,8 @@
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.NamespaceSupport;
-import org.ggf.ns.nmwg.base.v2_0.Element;
+public class Role extends org.ggf.ns.nmwg.topology.base.v3_0.Role {
-public class Role extends Element {
-
- protected String role;
-
/**
* Constructor.
*/
@@ -28,130 +24,8 @@
localName = "role";
uri = "http://ggf.org/ns/nmwg/topology/l3/3.0/";
- qName = "nmwgtopo3:role";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol3:role";
+ prefix = "nmwgtopol3";
fileName = "org/ggf/ns/nmwg/topology/l3/v3_0/Role.java";
}
-
- /**
- * Returns the role value.
- */
- public String getRole() {
- return role;
- }
-
- /**
- * Sets the role value.
- */
- public void setRole(String newRole) {
- role = newRole;
- }
-
- /**
- * Not used in this element.
- */
- public boolean addAttr(String attr, String value, NamespaceSupport
nss) {
- if(attr.indexOf("xmlns") >= 0) {
- if(attr.split(":").length == 1) {
- if(nss.getURI("") == null) {
- nss.declarePrefix("", value);
- }
- if((prefix.equals("")) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- else {
- if(nss.getURI(attr.split(":")[1]) == null) {
- nss.declarePrefix(attr.split(":")[1],
value);
- }
- if((prefix.equals(attr.split(":")[1])) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
addAttr(String, String, NamespaceSupport) unrecognized attribute pair: " +
attr + " - " + value);
- return false;
- }
- return true;
- }
-
- /**
- * The text element is the value of this element.
- */
- public boolean addText(String text) {
- String clean = text.trim();
- if(!(text.equals(""))) {
- setRole(text);
- return true;
- }
- else {
- System.err.println("Error: " + getFileName() + "
role can't have a witespace value.");
- }
- return false;
- }
-
- /**
- * Converts the contents of this object into an xml tag.
- */
- public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
- try {
- handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
-
handler.characters(role.toCharArray(),0,role.length());
- handler.endElement(getUri(), getLocalName(),
getQName());
-
- if(getCompleted()) {
- nss.popContext();
- unSetCompleted();
- }
- }
- catch(Exception e) {
- System.err.println("Error: " + getFileName() + "
toXML(ContentHandler, NamespaceSupport) XML formulation error.");
- }
- return handler;
- }
-
- /**
- * Converts items into attributes for an xml tag.
- */
- public AttributesImpl getAttributes(NamespaceSupport nss) {
- AttributesImpl atts = new AttributesImpl();
-
- if(nss.getURI(getPrefix()) == null) {
- nss.pushContext();
- if(getPrefix().equals("")) {
- atts.addAttribute(getUri(), "xmlns", "xmlns",
"CDATA", getUri());
- }
- else {
- atts.addAttribute(getUri(), "xmlns:" +
getPrefix(), "xmlns:" + getPrefix(), "CDATA", getUri());
- }
- nss.declarePrefix(getPrefix(), getUri());
- setCompleted();
- }
-
- return atts;
- }
-
- /**
- * Given a DOM element (a parent), construct
- * the children elements.
- */
- public void getDOM(org.w3c.dom.Element parent) {
- org.w3c.dom.Document doc = parent.getOwnerDocument();
- if(!(getRole().equals(""))) {
- org.w3c.dom.Element authrealm =
doc.createElement(getLocalName());
- authrealm = doc.createElementNS(getUri(),
getQName());
- parent.appendChild(authrealm);
- org.w3c.dom.Text authrealmtext =
doc.createTextNode(getRole());
- authrealm.appendChild(authrealmtext);
- }
- }
-
- /**
- * Called when the object is placed in
- * an output statement.
- */
- public String toString() {
- return getFileName() + ": ---> " + getRole();
- }
}
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Subnet.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Subnet.java
2006-10-27 19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Subnet.java
2006-10-30 16:30:28 UTC (rev 175)
@@ -27,8 +27,8 @@
subnet = "";
localName = "subnet";
uri = "http://ggf.org/ns/nmwg/topology/l3/3.0/";
- qName = "nmwgtopo3:subnet";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol3:subnet";
+ prefix = "nmwgtopol3";
fileName = "org/ggf/ns/nmwg/topology/l3/v3_0/Subnet.java";
}
Deleted: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Type.java
Added: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l3/v3_0/Type.java
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l4/v3_0/Address.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l4/v3_0/Address.java
2006-10-27 19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l4/v3_0/Address.java
2006-10-30 16:30:28 UTC (rev 175)
@@ -16,27 +16,9 @@
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.NamespaceSupport;
-import org.ggf.ns.nmwg.base.v2_0.Element;
+public class Address extends org.ggf.ns.nmwg.topology.base.v3_0.Address {
-public class Address extends Element {
-
/**
- * address value
- */
- protected String address;
-
- /**
- * attribute for type
- */
- protected String type;
-
- /**
- * Lets us know if we are using an attribute or
- * a text element.
- */
- protected boolean useText;
-
- /**
* Constructor.
*/
public Address() {
@@ -44,202 +26,9 @@
type = "";
localName = "address";
uri = "http://ggf.org/ns/nmwg/topology/l4/3.0/";
- qName = "nmwgtopo3:address";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol4:address";
+ prefix = "nmwgtopol4";
fileName = "org/ggf/ns/nmwg/topology/l4/v3_0/Address.java";
useText = false;
}
-
- /**
- * returns the value of the useText variable
- */
- public boolean getUseText() {
- return useText;
- }
-
- /**
- * Sets the value of the useText variable
- */
- public void setUseText() {
- useText = true;
- }
-
- /**
- * Un-sets the value of the useText variable
- */
- public void unSetUseText() {
- useText = false;
- }
-
-
- /**
- * Returns the Address value.
- */
- public String getAddress() {
- return address;
- }
-
- /**
- * Sets the Address value.
- */
- public void setAddress(String newAddress) {
- address = newAddress;
- }
-
- /**
- * Returns the type value.
- */
- public String getType() {
- return type;
- }
-
- /**
- * Sets the type value.
- */
- public void setType(String newType) {
- type = newType;
- }
-
- /**
- * Called when a text element is encountered, a
- * check is forced to be sure we do not enter
- * whitespace.
- */
- public boolean addText(String text) {
- String clean = text.trim();
- if(!(text.equals(""))) {
- setAddress(text);
- setUseText();
- }
- else {
- System.err.println("Error: " + getFileName() + "
address can't have a witespace value.");
- return false;
- }
- return true;
- }
-
- /**
- * Only care about the type attribute.
- */
- public boolean addAttr(String attr, String value, NamespaceSupport
nss) {
- if(attr.equals("type")) {
- setType(value);
- }
- else if(attr.equals("value")) {
- setAddress(value);
- }
- else if(attr.indexOf("xmlns") >= 0) {
- if(attr.split(":").length == 1) {
- if(nss.getURI("") == null) {
- nss.declarePrefix("", value);
- }
- if((prefix.equals("")) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- else {
- if(nss.getURI(attr.split(":")[1]) == null) {
- nss.declarePrefix(attr.split(":")[1],
value);
- }
- if((prefix.equals(attr.split(":")[1])) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
addAttr(String, String, NamespaceSupport) unrecognized attribute pair: " +
attr + " - " + value);
- return false;
- }
- return true;
- }
-
- /**
- * Converts the contents of this object into an xml tag.
- */
- public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
- try {
- handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
-
- if(getUseText()) {
- if(!(address.equals(""))) {
-
handler.characters(address.toCharArray(),0,address.length());
- }
- }
-
- handler.endElement(getUri(), getLocalName(),
getQName());
-
- if(getCompleted()) {
- nss.popContext();
- unSetCompleted();
- }
- }
- catch(Exception e) {
- System.err.println("Error: " + getFileName() + "
toXML(ContentHandler, NamespaceSupport) XML formulation error.");
- }
- return handler;
- }
-
- /**
- * Converts items into attributes for an xml tag.
- */
- public AttributesImpl getAttributes(NamespaceSupport nss) {
- AttributesImpl atts = new AttributesImpl();
-
- if(nss.getURI(getPrefix()) == null) {
- nss.pushContext();
- if(getPrefix().equals("")) {
- atts.addAttribute(getUri(), "xmlns", "xmlns",
"CDATA", getUri());
- }
- else {
- atts.addAttribute(getUri(), "xmlns:" +
getPrefix(), "xmlns:" + getPrefix(), "CDATA", getUri());
- }
- nss.declarePrefix(getPrefix(), getUri());
- setCompleted();
- }
-
- if(!(getUseText())) {
- if(!(getAddress().equals(""))) {
- atts.addAttribute(getUri(), "value", "value",
"CDATA", getAddress());
- }
- }
- if(!(getType().equals(""))) {
- atts.addAttribute(getUri(), "type", "type", "CDATA",
getType());
- }
- return atts;
- }
-
- /**
- * Given a DOM element (a parent), construct
- * the children elements.
- */
- public void getDOM(org.w3c.dom.Element parent) {
- org.w3c.dom.Document doc = parent.getOwnerDocument();
- org.w3c.dom.Element ipaddr =
doc.createElement(getLocalName());
- ipaddr = doc.createElementNS(getUri(), getQName());
- parent.appendChild(ipaddr);
-
- if(!(getType().equals(""))) {
- ipaddr.setAttribute("type", getType());
- }
-
- if(!(getAddress().equals(""))) {
- if(getUseText()) {
- org.w3c.dom.Text ipaddrtext =
doc.createTextNode(getAddress());
- ipaddr.appendChild(ipaddrtext);
- }
- else {
- ipaddr.setAttribute("value", getAddress());
- }
- }
- }
-
-
- /**
- * Called when the object is placed in
- * an output statement.
- */
- public String toString() {
- return getFileName() + ": ---> " + getAddress() + " type:" +
getType();
- }
-
}
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l4/v3_0/EndPoint.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l4/v3_0/EndPoint.java
2006-10-27 19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l4/v3_0/EndPoint.java
2006-10-30 16:30:28 UTC (rev 175)
@@ -68,8 +68,8 @@
addressElement = null;
localName = "endPoint";
uri = "http://ggf.org/ns/nmwg/topology/l4/3.0/";
- qName = "nmwgtopo3:endPoint";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol4:endPoint";
+ prefix = "nmwgtopol4";
fileName = "org/ggf/ns/nmwg/topology/l4/v3_0/EndPoint.java";
}
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l4/v3_0/EndPointPair.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l4/v3_0/EndPointPair.java
2006-10-27 19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l4/v3_0/EndPointPair.java
2006-10-30 16:30:28 UTC (rev 175)
@@ -37,8 +37,8 @@
dstElement = null;
localName = "endPointPair";
uri = "http://ggf.org/ns/nmwg/topology/l4/3.0/";
- qName = "nmwgtopo3:endPointPair";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol4:endPointPair";
+ prefix = "nmwgtopol4";
fileName =
"org/ggf/ns/nmwg/topology/l4/v3_0/EndPointPair.java";
}
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l4/v3_0/Path.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l4/v3_0/Path.java 2006-10-27
19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l4/v3_0/Path.java 2006-10-30
16:30:28 UTC (rev 175)
@@ -22,8 +22,9 @@
import org.xml.sax.helpers.NamespaceSupport;
import org.ggf.ns.nmwg.base.v2_0.Element;
+import org.ggf.ns.nmwg.topology.base.v3_0.Link;
-public class Path extends Element {
+public class Path extends org.ggf.ns.nmwg.topology.base.v3_0.Path {
/**
* 'map' of endPoint elements
@@ -31,21 +32,16 @@
protected Map endPointMap;
/**
- * attribute for pathIdRef
- */
- protected String pathIdRef;
-
- /**
* Constructor.
*/
public Path() {
endPointMap = new HashMap();
-
+ linkMap = null;
pathIdRef = "";
uri = "http://ggf.org/ns/nmwg/topology/l4/3.0/";
- qName = "nmwgtopo3:path";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol4:path";
+ prefix = "nmwgtopol4";
fileName = "org/ggf/ns/nmwg/topology/l4/v3_0/Path.java";
}
@@ -62,7 +58,39 @@
public void setPathIdRef(String newPathIdRef) {
pathIdRef = newPathIdRef;
}
+
+/**
+ * Unused in this object
+ */
+
+ public void clearLink() {
+ System.err.println("Error: " + getFileName() + "
'clearLink()' cannot be used in this context.");
+ }
+
+ public void setLink(Link newLink) {
+ System.err.println("Error: " + getFileName() + "
'setLink(Link)' cannot be used in this context.");
+ }
+ public Map getLinkMap() {
+ System.err.println("Error: " + getFileName() + "
'getLinkMap()' cannot be used in this context.");
+ return null;
+ }
+
+ public Link[] getLinkArray() {
+ System.err.println("Error: " + getFileName() + "
'getLinkArray()' cannot be used in this context.");
+ return null;
+ }
+
+ public Iterator getLinkIterator() {
+ System.err.println("Error: " + getFileName() + "
'getLinkIterator()' cannot be used in this context.");
+ return null;
+ }
+
+ public Link getLink(String id) {
+ System.err.println("Error: " + getFileName() + "
'getLink(String)' cannot be used in this context.");
+ return null;
+ }
+
/**
* EndPoint Section
*/
@@ -144,88 +172,6 @@
}
/**
- * There shouldnt be an attribute, but there could be a namespace?
- */
- public boolean addAttr(String attr, String value, NamespaceSupport
nss) {
- if(attr.indexOf("xmlns") >= 0) {
- if(attr.split(":").length == 1) {
- if(nss.getURI("") == null) {
- nss.declarePrefix("", value);
- }
- if((prefix.equals("")) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- else {
- if(nss.getURI(attr.split(":")[1]) == null) {
- nss.declarePrefix(attr.split(":")[1],
value);
- }
- if((prefix.equals(attr.split(":")[1])) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- }
- else if(attr.equals("id")) {
- setId(value);
- }
- else if(attr.equals("pathIdRef")) {
- setPathIdRef(value);
- }
- else {
- System.err.println("Error: " + getFileName() + "
addAttr(String, String, NamespaceSupport) unrecognized attribute pair: " +
attr + " - " + value);
- return false;
- }
- return true;
- }
-
- /**
- * Converts the contents of this object into an xml tag.
- */
- public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
- try {
- handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
- handler = getChildren(handler, nss);
- handler.endElement(getUri(), getLocalName(),
getQName());
-
- if(getCompleted()) {
- nss.popContext();
- unSetCompleted();
- }
- }
- catch(Exception e) {
- System.err.println("Error: " + getFileName() + "
toXML(ContentHandler, NamespaceSupport) XML formulation error.");
- }
- return handler;
- }
-
- /**
- * Converts items into attributes for an xml tag.
- */
- public AttributesImpl getAttributes(NamespaceSupport nss) {
- AttributesImpl atts = new AttributesImpl();
-
- if(nss.getURI(getPrefix()) == null) {
- nss.pushContext();
- if(getPrefix().equals("")) {
- atts.addAttribute(getUri(), "xmlns", "xmlns",
"CDATA", getUri());
- }
- else {
- atts.addAttribute(getUri(), "xmlns:" +
getPrefix(), "xmlns:" + getPrefix(), "CDATA", getUri());
- }
- nss.declarePrefix(getPrefix(), getUri());
- setCompleted();
- }
- if(!(getId().equals(""))) {
- atts.addAttribute(getUri(), "id", "id", "CDATA",
getId());
- }
- if(!(getPathIdRef().equals(""))) {
- atts.addAttribute(getUri(), "pathIdRef", "pathIdRef",
"CDATA", getPathIdRef());
- }
-
- return atts;
- }
-
- /**
* Chases children references down to pring out all related xml tags.
*/
public ContentHandler getChildren(ContentHandler handler,
NamespaceSupport nss) throws Exception {
Modified: trunk/nmwg/java/org/ggf/ns/nmwg/topology/l4/v3_0/Role.java
===================================================================
--- trunk/nmwg/java/org/ggf/ns/nmwg/topology/l4/v3_0/Role.java 2006-10-27
19:02:26 UTC (rev 174)
+++ trunk/nmwg/java/org/ggf/ns/nmwg/topology/l4/v3_0/Role.java 2006-10-30
16:30:28 UTC (rev 175)
@@ -14,12 +14,8 @@
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.NamespaceSupport;
-import org.ggf.ns.nmwg.base.v2_0.Element;
+public class Role extends org.ggf.ns.nmwg.topology.base.v3_0.Role {
-public class Role extends Element {
-
- protected String role;
-
/**
* Constructor.
*/
@@ -28,130 +24,8 @@
localName = "role";
uri = "http://ggf.org/ns/nmwg/topology/l4/3.0/";
- qName = "nmwgtopo3:role";
- prefix = "nmwgtopo3";
+ qName = "nmwgtopol4:role";
+ prefix = "nmwgtopol4";
fileName = "org/ggf/ns/nmwg/topology/l4/v3_0/Role.java";
}
-
- /**
- * Returns the role value.
- */
- public String getRole() {
- return role;
- }
-
- /**
- * Sets the role value.
- */
- public void setRole(String newRole) {
- role = newRole;
- }
-
- /**
- * Not used in this element.
- */
- public boolean addAttr(String attr, String value, NamespaceSupport
nss) {
- if(attr.indexOf("xmlns") >= 0) {
- if(attr.split(":").length == 1) {
- if(nss.getURI("") == null) {
- nss.declarePrefix("", value);
- }
- if((prefix.equals("")) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- else {
- if(nss.getURI(attr.split(":")[1]) == null) {
- nss.declarePrefix(attr.split(":")[1],
value);
- }
- if((prefix.equals(attr.split(":")[1])) &&
!(value.equals(uri))) {
- uri = value;
- }
- }
- }
- else {
- System.err.println("Error: " + getFileName() + "
addAttr(String, String, NamespaceSupport) unrecognized attribute pair: " +
attr + " - " + value);
- return false;
- }
- return true;
- }
-
- /**
- * The text element is the value of this element.
- */
- public boolean addText(String text) {
- String clean = text.trim();
- if(!(text.equals(""))) {
- setRole(text);
- return true;
- }
- else {
- System.err.println("Error: " + getFileName() + "
role can't have a witespace value.");
- }
- return false;
- }
-
- /**
- * Converts the contents of this object into an xml tag.
- */
- public ContentHandler toXML(ContentHandler handler, NamespaceSupport
nss) throws Exception {
- try {
- handler.startElement(getUri(), getLocalName(),
getQName(), getAttributes(nss));
-
handler.characters(role.toCharArray(),0,role.length());
- handler.endElement(getUri(), getLocalName(),
getQName());
-
- if(getCompleted()) {
- nss.popContext();
- unSetCompleted();
- }
- }
- catch(Exception e) {
- System.err.println("Error: " + getFileName() + "
toXML(ContentHandler, NamespaceSupport) XML formulation error.");
- }
- return handler;
- }
-
- /**
- * Converts items into attributes for an xml tag.
- */
- public AttributesImpl getAttributes(NamespaceSupport nss) {
- AttributesImpl atts = new AttributesImpl();
-
- if(nss.getURI(getPrefix()) == null) {
- nss.pushContext();
- if(getPrefix().equals("")) {
- atts.addAttribute(getUri(), "xmlns", "xmlns",
"CDATA", getUri());
- }
- else {
- atts.addAttribute(getUri(), "xmlns:" +
getPrefix(), "xmlns:" + getPrefix(), "CDATA", getUri());
- }
- nss.declarePrefix(getPrefix(), getUri());
- setCompleted();
- }
-
- return atts;
- }
-
- /**
- * Given a DOM element (a parent), construct
- * the children elements.
- */
- public void getDOM(org.w3c.dom.Element parent) {
- org.w3c.dom.Document doc = parent.getOwnerDocument();
- if(!(getRole().equals(""))) {
- org.w3c.dom.Element authrealm =
doc.createElement(getLocalName());
- authrealm = doc.createElementNS(getUri(),
getQName());
- parent.appendChild(authrealm);
- org.w3c.dom.Text authrealmtext =
doc.createTextNode(getRole());
- authrealm.appendChild(authrealmtext);
- }
- }
-
- /**
- * Called when the object is placed in
- * an output statement.
- */
- public String toString() {
- return getFileName() + ": ---> " + getRole();
- }
}
- r175 - in trunk/nmwg/java/org/ggf/ns/nmwg: base/v2_0 topology/base/v3_0 topology/l2/v3_0 topology/l3/v3_0 topology/l4/v3_0, svnlog, 10/30/2006
Archive powered by MHonArc 2.6.16.