fi.hut.tml.xsmiles.mlfc.xforms.data
Class DString

java.lang.Object
  extended byfi.hut.tml.xsmiles.mlfc.xforms.data.DString
All Implemented Interfaces:
Data

public class DString
extends java.lang.Object
implements Data


Field Summary
protected  short datatype
           
protected  boolean isValid
           
protected  java.lang.String stringValue
           
 
Constructor Summary
DString(short dtype)
           
 
Method Summary
protected  void clearValue()
          instructs subclass to set value to null, this is used for invalid values
 short getDataType()
           
 java.lang.String getInvalidValue()
          get the invalid value as a string
 boolean isValid()
          is the current value valid according to the datatype
 void setInvalidString(java.lang.String s)
          set the invalid value as a string
 void setValid(boolean v)
          set the validity status
 void setValueFromDisplay(java.lang.String displayValue)
          set the value from a display string
 void setValueFromObject(java.lang.Object obj)
          set the value as a Java Object
 void setValueFromSchema(java.lang.String schemaValue)
          set the value from a Schema string
 java.lang.String toDisplayValue()
          get the display value (e.g.
 java.lang.Object toObject()
          get the java object corresponding to the value
 java.lang.String toSchemaString()
          get a schema compatible string from this data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stringValue

protected java.lang.String stringValue

isValid

protected boolean isValid

datatype

protected short datatype
Constructor Detail

DString

public DString(short dtype)
Method Detail

isValid

public boolean isValid()
is the current value valid according to the datatype

Specified by:
isValid in interface Data

setValueFromObject

public void setValueFromObject(java.lang.Object obj)
set the value as a Java Object

Specified by:
setValueFromObject in interface Data

setValueFromDisplay

public void setValueFromDisplay(java.lang.String displayValue)
set the value from a display string

Specified by:
setValueFromDisplay in interface Data

setValueFromSchema

public void setValueFromSchema(java.lang.String schemaValue)
set the value from a Schema string

Specified by:
setValueFromSchema in interface Data

toDisplayValue

public java.lang.String toDisplayValue()
get the display value (e.g. 3,12 / 3.12 depending on the locale)

Specified by:
toDisplayValue in interface Data

toSchemaString

public java.lang.String toSchemaString()
get a schema compatible string from this data. E.g. From a date you would get a String in xsd:date format

Specified by:
toSchemaString in interface Data

toObject

public java.lang.Object toObject()
get the java object corresponding to the value

Specified by:
toObject in interface Data

getInvalidValue

public java.lang.String getInvalidValue()
get the invalid value as a string

Specified by:
getInvalidValue in interface Data

setValid

public void setValid(boolean v)
set the validity status

Specified by:
setValid in interface Data

setInvalidString

public void setInvalidString(java.lang.String s)
Description copied from interface: Data
set the invalid value as a string

Specified by:
setInvalidString in interface Data

clearValue

protected void clearValue()
instructs subclass to set value to null, this is used for invalid values


getDataType

public short getDataType()
Specified by:
getDataType in interface Data


X-Smiles 1.2