Version: 1.1.1

org.biomoby.shared.data
Class MobyDataBoolean

java.lang.Object
  extended by org.biomoby.shared.MobyData
      extended by org.biomoby.shared.MobyPrimaryData
          extended by org.biomoby.shared.MobyPrimaryDataSimple
              extended by org.biomoby.shared.data.MobyDataObject
                  extended by org.biomoby.shared.data.MobyDataBoolean
All Implemented Interfaces:
Cloneable, Comparable, MobyDataInstance

public class MobyDataBoolean
extends MobyDataObject

A class representing a MOBY Boolean primitive. Internally, the value is stored in a StringBuffer. Because getObject() will return a mutable StringBuffer, you can use its methods to modify the underlying value of this MOBY object.


Field Summary
 
Fields inherited from interface org.biomoby.shared.data.MobyDataInstance
CENTRAL_XML_MODE, SERVICE_XML_MODE
 
Constructor Summary
MobyDataBoolean(boolean b)
           
MobyDataBoolean(Boolean b)
           
MobyDataBoolean(boolean b, Registry r)
           
MobyDataBoolean(Boolean b, Registry r)
           
MobyDataBoolean(Element element)
          Construct the object using a DOM fragment.
MobyDataBoolean(Element element, Registry registry)
           
MobyDataBoolean(String booleanString)
           
MobyDataBoolean(String articleName, boolean b)
           
MobyDataBoolean(String articleName, Boolean b)
          Constructor to build a MOBY base String object from a CharSequence (i.e.
MobyDataBoolean(String articleName, boolean b, Registry registry)
           
MobyDataBoolean(String articleName, Boolean b, Registry registry)
          Every c-tor eventually winds up here
MobyDataBoolean(String booleanString, Registry r)
           
MobyDataBoolean(String articleName, String booleanString)
          Uses Boolean.valueOf(String) to convert to a Boolean object.
MobyDataBoolean(String articleName, String booleanString, Registry registry)
           
 
Method Summary
 boolean booleanValue()
          A convenience method to get a Java primitive representing the underlying Boolean of this object
 MobyDataBoolean clone()
          Simply calls new constructor with object's existing data type, name and value.
 Object getObject()
          Since the Boolean object is immutable, use the setValue(boolean) method instead to change the underlying value for this MOBYObject.
 String getValue()
          A lexical (prefereably human readable) representation of the underlying object value (not including the namespace and ID).
 void setValue(boolean b)
           
 void setValue(Boolean b)
           
 void setValue(String booleanValue)
          Uses Boolean.valueOf(String) to convert to a Boolean object.
 String toString()
          Convenience method to get the basic XML representation
 String toXML()
          Produces a full-blown XML fragment that depending on the value of getXmlMode() is either a template for use in MOBY Central services, or a Simple element for use in calling a service instance.
 
Methods inherited from class org.biomoby.shared.data.MobyDataObject
addCrossReference, addCrossReferences, addCrossReferences, addProvisionInfo, compareTo, createInstanceFromDOM, createInstanceFromDOM, createInstanceFromString, createInstanceFromString, createInstanceFromXML, equals, getCrossReferences, getId, getName, getPrimaryNamespace, getProvisionInfo, getTextContents, getXmlMode, hasCrossReferences, setId, setName, setPrimaryNamespace, setProvisionInfo, setXmlMode
 
Methods inherited from class org.biomoby.shared.MobyPrimaryDataSimple
addNamespace, format, getDataType, getNamespaces, removeNamespace, removeNamespace, setDataType, setNamespaces
 
Methods inherited from class org.biomoby.shared.MobyPrimaryData
isPrimary
 
Methods inherited from class org.biomoby.shared.MobyData
getId, getName, getUserData, setUserData
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.biomoby.shared.data.MobyDataInstance
getName, getUserData, setUserData
 

Constructor Detail

MobyDataBoolean

public MobyDataBoolean(Element element)
                throws IllegalArgumentException
Construct the object using a DOM fragment.

Throws:
IllegalArgumentException - if the element is not a String tag

MobyDataBoolean

public MobyDataBoolean(Element element,
                       Registry registry)
                throws IllegalArgumentException
Throws:
IllegalArgumentException

MobyDataBoolean

public MobyDataBoolean(String articleName,
                       Boolean b)
Constructor to build a MOBY base String object from a CharSequence (i.e. String, StringBuffer, CharBuffer or StringBuilder).


MobyDataBoolean

public MobyDataBoolean(String articleName,
                       Boolean b,
                       Registry registry)
Every c-tor eventually winds up here


MobyDataBoolean

public MobyDataBoolean(String articleName,
                       boolean b)

MobyDataBoolean

public MobyDataBoolean(String articleName,
                       boolean b,
                       Registry registry)

MobyDataBoolean

public MobyDataBoolean(String articleName,
                       String booleanString)
Uses Boolean.valueOf(String) to convert to a Boolean object. i.e. the value is false unless the string is "true" irrespective of capitalization. "Yes" and "1" are not acceptable.


MobyDataBoolean

public MobyDataBoolean(String articleName,
                       String booleanString,
                       Registry registry)

MobyDataBoolean

public MobyDataBoolean(Boolean b)

MobyDataBoolean

public MobyDataBoolean(Boolean b,
                       Registry r)

MobyDataBoolean

public MobyDataBoolean(boolean b)

MobyDataBoolean

public MobyDataBoolean(boolean b,
                       Registry r)

MobyDataBoolean

public MobyDataBoolean(String booleanString)

MobyDataBoolean

public MobyDataBoolean(String booleanString,
                       Registry r)
Method Detail

toString

public String toString()
Description copied from class: MobyDataObject
Convenience method to get the basic XML representation

Overrides:
toString in class MobyDataObject
Returns:
the raw XML representation of the object

clone

public MobyDataBoolean clone()
Description copied from class: MobyDataObject
Simply calls new constructor with object's existing data type, name and value. Subclasses should override this method if more datafields need to be copied for an accurate clone of the Moby Data Instance (i.e. anything but a base object). The subclasses should ensure that they also return a MobyDataObject.

Overrides:
clone in class MobyDataObject
Returns:
an object of class MobyDataObject

getObject

public Object getObject()
Since the Boolean object is immutable, use the setValue(boolean) method instead to change the underlying value for this MOBYObject.

Specified by:
getObject in interface MobyDataInstance
Overrides:
getObject in class MobyDataObject
Returns:
an immutable Boolean

booleanValue

public boolean booleanValue()
A convenience method to get a Java primitive representing the underlying Boolean of this object


setValue

public void setValue(boolean b)

setValue

public void setValue(Boolean b)

setValue

public void setValue(String booleanValue)
Uses Boolean.valueOf(String) to convert to a Boolean object. i.e. the value is false unless the string is "true" irrespective of capitalization. "Yes" and "1" are not acceptable.


getValue

public String getValue()
Description copied from class: MobyDataObject
A lexical (prefereably human readable) representation of the underlying object value (not including the namespace and ID). This value is used in sorting, and potentially for user interface elements such as tool tips and comment fields. For base objects, there is no underlying value (just a namespace and id), so the result is always a constant string "[Object]".

Overrides:
getValue in class MobyDataObject
Returns:
"true" or "false"

toXML

public String toXML()
Description copied from class: MobyDataObject
Produces a full-blown XML fragment that depending on the value of getXmlMode() is either a template for use in MOBY Central services, or a Simple element for use in calling a service instance.

Specified by:
toXML in interface MobyDataInstance
Overrides:
toXML in class MobyDataObject
Returns:
the MOBY XML representation of the data instance

Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010