*
* @version $Revision$ $Date$
*/
-public class Link extends Uri
+public class Link extends org.vamsas.client.Vobject
implements java.io.Serializable
{
+ //--------------------------/
+ //- Class/Member Variables -/
+ //--------------------------/
+
+ /**
+ * internal content storage
+ */
+ private java.lang.String _content = "";
+
+ /**
+ * The URI
+ */
+ private java.lang.String _href;
+
+
//----------------/
//- Constructors -/
//----------------/
public Link()
{
super();
+ setContent("");
} //-- org.vamsas.objects.core.Link()
if (obj instanceof Link) {
Link temp = (Link)obj;
+ if (this._content != null) {
+ if (temp._content == null) return false;
+ else if (!(this._content.equals(temp._content)))
+ return false;
+ }
+ else if (temp._content != null)
+ return false;
+ if (this._href != null) {
+ if (temp._href == null) return false;
+ else if (!(this._href.equals(temp._href)))
+ return false;
+ }
+ else if (temp._href != null)
+ return false;
return true;
}
return false;
} //-- boolean equals(java.lang.Object)
/**
+ * Returns the value of field 'content'. The field 'content'
+ * has the following description: internal content storage
+ *
+ * @return String
+ * @return the value of field 'content'.
+ */
+ public java.lang.String getContent()
+ {
+ return this._content;
+ } //-- java.lang.String getContent()
+
+ /**
+ * Returns the value of field 'href'. The field 'href' has the
+ * following description: The URI
+ *
+ * @return String
+ * @return the value of field 'href'.
+ */
+ public java.lang.String getHref()
+ {
+ return this._href;
+ } //-- java.lang.String getHref()
+
+ /**
* Method isValid
*
*
} //-- void marshal(org.xml.sax.ContentHandler)
/**
+ * Sets the value of field 'content'. The field 'content' has
+ * the following description: internal content storage
+ *
+ * @param content the value of field 'content'.
+ */
+ public void setContent(java.lang.String content)
+ {
+ this._content = content;
+ } //-- void setContent(java.lang.String)
+
+ /**
+ * Sets the value of field 'href'. The field 'href' has the
+ * following description: The URI
+ *
+ * @param href the value of field 'href'.
+ */
+ public void setHref(java.lang.String href)
+ {
+ this._href = href;
+ } //-- void setHref(java.lang.String)
+
+ /**
* Method unmarshal
*
*
*
* @version $Revision$ $Date$
*/
-public class LinkDescriptor extends UriDescriptor {
+public class LinkDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
//--------------------------/
public LinkDescriptor()
{
super();
- setExtendsWithoutFlatten(new UriDescriptor());
nsURI = "http://www.vamsas.org";
xmlName = "link";
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ //-- _content
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue( java.lang.Object object )
+ throws IllegalStateException
+ {
+ Link target = (Link) object;
+ return target.getContent();
+ }
+ public void setValue( java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try {
+ Link target = (Link) object;
+ target.setContent( (java.lang.String) value);
+ }
+ catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+ public java.lang.Object newInstance( java.lang.Object parent ) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ addFieldDescriptor(desc);
+
+ //-- validation code for: _content
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { //-- local scope
+ StringValidator typeValidator = new StringValidator();
+ typeValidator.setWhiteSpace("preserve");
+ fieldValidator.setValidator(typeValidator);
+ }
+ desc.setValidator(fieldValidator);
+ //-- initialize attribute descriptors
+
+ //-- _href
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_href", "href", org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue( java.lang.Object object )
+ throws IllegalStateException
+ {
+ Link target = (Link) object;
+ return target.getHref();
+ }
+ public void setValue( java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try {
+ Link target = (Link) object;
+ target.setHref( (java.lang.String) value);
+ }
+ catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+ public java.lang.Object newInstance( java.lang.Object parent ) {
+ return new java.lang.String();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ //-- validation code for: _href
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { //-- local scope
+ }
+ desc.setValidator(fieldValidator);
+ //-- initialize element descriptors
+
} //-- org.vamsas.objects.core.LinkDescriptor()
*/
public org.exolab.castor.mapping.ClassDescriptor getExtends()
{
- return super.getExtends();
+ return null;
} //-- org.exolab.castor.mapping.ClassDescriptor getExtends()
/**
*/
public org.exolab.castor.mapping.FieldDescriptor getIdentity()
{
- if (identity == null)
- return super.getIdentity();
return identity;
} //-- org.exolab.castor.mapping.FieldDescriptor getIdentity()
private java.util.Vector _scoreList;
/**
- * Field _urlList
+ * Field _linkList
*/
- private java.util.Vector _urlList;
+ private java.util.Vector _linkList;
/**
* Note:These are mutable so an application
setGroup("");
_annotationElementList = new Vector();
_scoreList = new Vector();
- _urlList = new Vector();
+ _linkList = new Vector();
_propertyList = new Vector();
} //-- org.vamsas.objects.core.RangeAnnotation()
} //-- void addAnnotationElement(int, org.vamsas.objects.core.AnnotationElement)
/**
+ * Method addLink
+ *
+ *
+ *
+ * @param vLink
+ */
+ public void addLink(org.vamsas.objects.core.Link vLink)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ _linkList.addElement(vLink);
+ } //-- void addLink(org.vamsas.objects.core.Link)
+
+ /**
+ * Method addLink
+ *
+ *
+ *
+ * @param index
+ * @param vLink
+ */
+ public void addLink(int index, org.vamsas.objects.core.Link vLink)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ _linkList.insertElementAt(vLink, index);
+ } //-- void addLink(int, org.vamsas.objects.core.Link)
+
+ /**
* Method addProperty
*
*
} //-- void addScore(int, org.vamsas.objects.core.Score)
/**
- * Method addUrl
- *
- *
- *
- * @param vUrl
- */
- public void addUrl(org.vamsas.objects.core.Url vUrl)
- throws java.lang.IndexOutOfBoundsException
- {
- _urlList.addElement(vUrl);
- } //-- void addUrl(org.vamsas.objects.core.Url)
-
- /**
- * Method addUrl
- *
- *
- *
- * @param index
- * @param vUrl
- */
- public void addUrl(int index, org.vamsas.objects.core.Url vUrl)
- throws java.lang.IndexOutOfBoundsException
- {
- _urlList.insertElementAt(vUrl, index);
- } //-- void addUrl(int, org.vamsas.objects.core.Url)
-
- /**
* Method deleteModifiable
*
*/
} //-- java.util.Enumeration enumerateAnnotationElement()
/**
- * Method enumerateProperty
+ * Method enumerateLink
*
*
*
* @return Enumeration
*/
- public java.util.Enumeration enumerateProperty()
+ public java.util.Enumeration enumerateLink()
{
- return _propertyList.elements();
- } //-- java.util.Enumeration enumerateProperty()
+ return _linkList.elements();
+ } //-- java.util.Enumeration enumerateLink()
/**
- * Method enumerateScore
+ * Method enumerateProperty
*
*
*
* @return Enumeration
*/
- public java.util.Enumeration enumerateScore()
+ public java.util.Enumeration enumerateProperty()
{
- return _scoreList.elements();
- } //-- java.util.Enumeration enumerateScore()
+ return _propertyList.elements();
+ } //-- java.util.Enumeration enumerateProperty()
/**
- * Method enumerateUrl
+ * Method enumerateScore
*
*
*
* @return Enumeration
*/
- public java.util.Enumeration enumerateUrl()
+ public java.util.Enumeration enumerateScore()
{
- return _urlList.elements();
- } //-- java.util.Enumeration enumerateUrl()
+ return _scoreList.elements();
+ } //-- java.util.Enumeration enumerateScore()
/**
* Note: hashCode() has not been overriden
}
else if (temp._scoreList != null)
return false;
- if (this._urlList != null) {
- if (temp._urlList == null) return false;
- else if (!(this._urlList.equals(temp._urlList)))
+ if (this._linkList != null) {
+ if (temp._linkList == null) return false;
+ else if (!(this._linkList.equals(temp._linkList)))
return false;
}
- else if (temp._urlList != null)
+ else if (temp._linkList != null)
return false;
if (this._propertyList != null) {
if (temp._propertyList == null) return false;
} //-- java.lang.String getLabel()
/**
+ * Method getLink
+ *
+ *
+ *
+ * @param index
+ * @return Link
+ */
+ public org.vamsas.objects.core.Link getLink(int index)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ //-- check bounds for index
+ if ((index < 0) || (index > _linkList.size())) {
+ throw new IndexOutOfBoundsException("getLink: Index value '"+index+"' not in range [0.."+_linkList.size()+ "]");
+ }
+
+ return (org.vamsas.objects.core.Link) _linkList.elementAt(index);
+ } //-- org.vamsas.objects.core.Link getLink(int)
+
+ /**
+ * Method getLink
+ *
+ *
+ *
+ * @return Link
+ */
+ public org.vamsas.objects.core.Link[] getLink()
+ {
+ int size = _linkList.size();
+ org.vamsas.objects.core.Link[] mArray = new org.vamsas.objects.core.Link[size];
+ for (int index = 0; index < size; index++) {
+ mArray[index] = (org.vamsas.objects.core.Link) _linkList.elementAt(index);
+ }
+ return mArray;
+ } //-- org.vamsas.objects.core.Link[] getLink()
+
+ /**
+ * Method getLinkCount
+ *
+ *
+ *
+ * @return int
+ */
+ public int getLinkCount()
+ {
+ return _linkList.size();
+ } //-- int getLinkCount()
+
+ /**
* Returns the value of field 'modifiable'. The field
* 'modifiable' has the following description: objects with
* modifiable=false will not be
} //-- java.lang.String getType()
/**
- * Method getUrl
- *
- *
- *
- * @param index
- * @return Url
- */
- public org.vamsas.objects.core.Url getUrl(int index)
- throws java.lang.IndexOutOfBoundsException
- {
- //-- check bounds for index
- if ((index < 0) || (index > _urlList.size())) {
- throw new IndexOutOfBoundsException("getUrl: Index value '"+index+"' not in range [0.."+_urlList.size()+ "]");
- }
-
- return (org.vamsas.objects.core.Url) _urlList.elementAt(index);
- } //-- org.vamsas.objects.core.Url getUrl(int)
-
- /**
- * Method getUrl
- *
- *
- *
- * @return Url
- */
- public org.vamsas.objects.core.Url[] getUrl()
- {
- int size = _urlList.size();
- org.vamsas.objects.core.Url[] mArray = new org.vamsas.objects.core.Url[size];
- for (int index = 0; index < size; index++) {
- mArray[index] = (org.vamsas.objects.core.Url) _urlList.elementAt(index);
- }
- return mArray;
- } //-- org.vamsas.objects.core.Url[] getUrl()
-
- /**
- * Method getUrlCount
- *
- *
- *
- * @return int
- */
- public int getUrlCount()
- {
- return _urlList.size();
- } //-- int getUrlCount()
-
- /**
* Method hasModifiable
*
*
} //-- void removeAllAnnotationElement()
/**
+ * Method removeAllLink
+ *
+ */
+ public void removeAllLink()
+ {
+ _linkList.removeAllElements();
+ } //-- void removeAllLink()
+
+ /**
* Method removeAllProperty
*
*/
} //-- void removeAllScore()
/**
- * Method removeAllUrl
- *
- */
- public void removeAllUrl()
- {
- _urlList.removeAllElements();
- } //-- void removeAllUrl()
-
- /**
* Method removeAnnotationElement
*
*
} //-- org.vamsas.objects.core.AnnotationElement removeAnnotationElement(int)
/**
+ * Method removeLink
+ *
+ *
+ *
+ * @param index
+ * @return Link
+ */
+ public org.vamsas.objects.core.Link removeLink(int index)
+ {
+ java.lang.Object obj = _linkList.elementAt(index);
+ _linkList.removeElementAt(index);
+ return (org.vamsas.objects.core.Link) obj;
+ } //-- org.vamsas.objects.core.Link removeLink(int)
+
+ /**
* Method removeProperty
*
*
} //-- org.vamsas.objects.core.Score removeScore(int)
/**
- * Method removeUrl
- *
- *
- *
- * @param index
- * @return Url
- */
- public org.vamsas.objects.core.Url removeUrl(int index)
- {
- java.lang.Object obj = _urlList.elementAt(index);
- _urlList.removeElementAt(index);
- return (org.vamsas.objects.core.Url) obj;
- } //-- org.vamsas.objects.core.Url removeUrl(int)
-
- /**
* Method setAnnotationElement
*
*
} //-- void setLabel(java.lang.String)
/**
+ * Method setLink
+ *
+ *
+ *
+ * @param index
+ * @param vLink
+ */
+ public void setLink(int index, org.vamsas.objects.core.Link vLink)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ //-- check bounds for index
+ if ((index < 0) || (index > _linkList.size())) {
+ throw new IndexOutOfBoundsException("setLink: Index value '"+index+"' not in range [0.."+_linkList.size()+ "]");
+ }
+ _linkList.setElementAt(vLink, index);
+ } //-- void setLink(int, org.vamsas.objects.core.Link)
+
+ /**
+ * Method setLink
+ *
+ *
+ *
+ * @param linkArray
+ */
+ public void setLink(org.vamsas.objects.core.Link[] linkArray)
+ {
+ //-- copy array
+ _linkList.removeAllElements();
+ for (int i = 0; i < linkArray.length; i++) {
+ _linkList.addElement(linkArray[i]);
+ }
+ } //-- void setLink(org.vamsas.objects.core.Link)
+
+ /**
* Sets the value of field 'modifiable'. The field 'modifiable'
* has the following description: objects with modifiable=false
* will not be
} //-- void setType(java.lang.String)
/**
- * Method setUrl
- *
- *
- *
- * @param index
- * @param vUrl
- */
- public void setUrl(int index, org.vamsas.objects.core.Url vUrl)
- throws java.lang.IndexOutOfBoundsException
- {
- //-- check bounds for index
- if ((index < 0) || (index > _urlList.size())) {
- throw new IndexOutOfBoundsException("setUrl: Index value '"+index+"' not in range [0.."+_urlList.size()+ "]");
- }
- _urlList.setElementAt(vUrl, index);
- } //-- void setUrl(int, org.vamsas.objects.core.Url)
-
- /**
- * Method setUrl
- *
- *
- *
- * @param urlArray
- */
- public void setUrl(org.vamsas.objects.core.Url[] urlArray)
- {
- //-- copy array
- _urlList.removeAllElements();
- for (int i = 0; i < urlArray.length; i++) {
- _urlList.addElement(urlArray[i]);
- }
- } //-- void setUrl(org.vamsas.objects.core.Url)
-
- /**
* Method unmarshal
*
*