|
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 org.biomoby.shared.datatypes.MobyXref
public class MobyXref
An object representing a cross reference. A cross reference is an optional component of any Biomoby object. It can be of a simple or of an advanced version.
A simple cross reference is a base Biomoby object (named 'Object')
that can have only attributes 'namespace' and 'id' (no value, no
article name, no children). Such cross reference return
true in its isSimpleXref
.
An advanced cross reference additionally includes a reference to a Biomoby service that a creator of this cross reference (which is a Biomoby service provider) suggests to execute in order to get more about the cross-referenced data.
The cross references are a moving target - better to check details in the Biomoby API description.
Note that jMoby contains yet another object representing a cross
reference: MobyDataXref
. These two representations of a cross-reference do
not depend on each other (except the list of evidence codes that is
shared) - jMoby simply has more ways to do the same.
Constructor Summary | |
---|---|
MobyXref()
Default constructor. |
Method Summary | |
---|---|
String |
format(int indent)
Return the same contents as MobyObject.toString() method but
indented by level expressed in the parameter 'indent'. |
String |
getDescription()
Get a human-readable description of this cross reference. |
String |
getEvidenceCode()
Get an evidence code. |
MobyService |
getService()
Get an object representing a Biomoby service that can consume data this cross reference is included in. |
String |
getXrefType()
Get a semantic type of this cross reference. |
boolean |
isSimpleXref()
Find what kind of cross reference this instance is. |
void |
setDescription(String desc)
Set a human-readable description of this cross reference. |
void |
setEvidenceCode(String code)
Set an evidence code. |
void |
setService(MobyService service)
Set a Biomoby service that can consume data this cross reference is included in. |
void |
setSimple(boolean yes)
Set the kind of this cross reference. |
void |
setXrefType(String type)
Set a semantic type of this cross reference. |
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 org.biomoby.shared.datatypes.MobyObject |
---|
addXref, getId, getMobyTypeName, getName, getNamespace, getProvision, getValue, getXrefs, isPrimitiveType, setId, setName, setNamespace, setProvision, setValue, setValueXML, setXrefs |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MobyXref()
Method Detail |
---|
public boolean isSimpleXref()
public void setSimple(boolean yes)
yes
- should be true in order to make this cross reference
a simple onepublic String getDescription()
public void setDescription(String desc)
public void setEvidenceCode(String code) throws MobyException
code
- to be set
MobyException
- if the 'code' is empty (it should also
check if it is valid but it does not do it now - TBD)for a list of evidence codes
public String getEvidenceCode()
for details what values are expected
public void setXrefType(String type)
type
- to be set; no validity check is done nowpublic String getXrefType()
public MobyService getService()
public void setService(MobyService service)
public org.jdom.Element toXML()
MobyObject
toXML
in class MobyObject
public String toString()
MobyObject
toString
in class MobyObject
for making the returned string better indented
public String format(int indent)
MobyObject
MobyObject.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));
format
in class MobyObject
indent
- means a level of wanted indentation: number 1
means three spaces, number two six spaces, etc.
|
Version: 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |