|
Version: 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.biomoby.shared.datatypes.MobyObject
public class MobyObject
An object representing a Biomoby Object, the main Biomoby data type, where all other data types are inherited from.
Every Biomoby object consists of three components:
For example, a namespace might be a GenBank (NCBI) "gi", and an identifier in that namespace might be "163483", meaning that such instance refers to the resource defined as a GenBank record with the gi=163483.
The Biomoby objects can also appear as members (attributes) of other Biomoby objects. In such case, they should be recognized by their name (also called an article name).
When a Biomoby service is invoked it may get more Biomoby objects. In such case, they can be also identified by their name (also called an article name).
Constructor Summary | |
---|---|
MobyObject()
Default constructor. |
|
MobyObject(String namespace,
String id)
Another constructor. |
Method Summary | |
---|---|
void |
addXref(MobyXref xref)
Add a cross reference to those already attached. |
String |
format(int indent)
Return the same contents as toString() method but
indented by level expressed in the parameter 'indent'. |
String |
getId()
Get an identifier of this object. |
String |
getMobyTypeName()
Return a Biomoby data type name represented by this object. |
String |
getName()
Get a name of this object. |
String |
getNamespace()
Get a namespace of the resource being represented by this object. |
MobyProvisionInfo |
getProvision()
Get provision data attached to this object. |
String |
getValue()
Get the value of this object. |
MobyXref[] |
getXrefs()
Get cross references attached to this object. |
boolean |
isPrimitiveType()
Return true if this object represents a Biomoby primitive type. |
void |
setId(String id)
Set an identifier (within the namespace )
that specifies the precise resource represented by the object. |
void |
setName(String name)
Set a name (called also an article name) that identifies this objects within other Biomoby objects. |
void |
setNamespace(String namespace)
Set a namespace of the resource being represented by this object. |
void |
setProvision(MobyProvisionInfo provision)
Attach a service provision information to this object. |
void |
setValue(String value)
Set a value of this object. |
void |
setValueXML(String value)
Set a value of this object. |
void |
setXrefs(MobyXref[] xrefs)
Attach cross references to this object. |
String |
toString()
Format all non-empty public members in a human-readable way. |
org.jdom.Element |
toXML()
Create an XML element representing this object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MobyObject()
public MobyObject(String namespace, String id)
namespace
- of the resource being represented by this objectid
- within the 'namespace' that specifies the * precise
resource represented by the objectMethod Detail |
---|
public String getMobyTypeName()
public String toString()
toString
in class Object
for making the returned string better indented
public String format(int indent)
toString()
method but
indented by level expressed in the parameter 'indent'. It is
useful when a hierarchy of objects call toString
methods on their children. For example, assuming that a
MobyObject has a list of cross references (represented
by a Vector xrefs, the method toString of
such MobyObject can include code like this:
StringBuffer buf = new StringBuffer(); for (Enumeration en = xrefs.elements(); en.hasMoreElements(); ) buf.append (((MobyXref)en.nextElement()).format (1));
indent
- means a level of wanted indentation: number 1
means three spaces, number two six spaces, etc.
public org.jdom.Element toXML()
public boolean isPrimitiveType()
public void setNamespace(String namespace)
public String getNamespace()
public void setId(String id)
namespace
)
that specifies the precise resource represented by the object.
public String getId()
public void setName(String name)
public String getName()
public void setValue(String value) throws MobyException
MobyString
or MobyInteger
. The value is internaly
always kept as a string - but subclasses can overwrite this
method to add checking for the correct format of this value.
value
- to be stored; a null value is changed to an empty
value ("")
MobyException
- if the 'value' does not have a correct
format (used by subclasses)how to set value as CDATA
public void setValueXML(String value) throws MobyException
setValue(java.lang.String)
except the set value will appear in the resulting
XML surronded by the CDATA notation.
value
- to be stored; a null value is changed to an empty
value ("")
MobyException
- if the 'value' does not have a correct
format (used by subclasses)how to set value normally
public String getValue()
public void setProvision(MobyProvisionInfo provision)
public MobyProvisionInfo getProvision()
public void setXrefs(MobyXref[] xrefs)
xrefs
- is a list of cross referencespublic void addXref(MobyXref xref)
xref
- is a cross reference to be addedsetXrefs(org.biomoby.shared.datatypes.MobyXref[])
public MobyXref[] getXrefs()
|
Version: 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |