com.edustructures.sifworks
Class SIFSimpleType<T>

java.lang.Object
  extended by com.edustructures.sifworks.SIFSimpleType<T>
Type Parameters:
T - The datatype that the SIFSimpleType wraps, such as Integer, Calendar, String, etc.
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
SIFBoolean, SIFDate, SIFDateTime, SIFDecimal, SIFDuration, SIFInt, SIFString, SIFTime

public abstract class SIFSimpleType<T>
extends java.lang.Object
implements java.io.Serializable

Wraps a Java Simple Type in an immutable instance that can be used to construct SimpleFields that represent properties in SIF data objects.

Version:
2.0
See Also:
Serialized Form

Method Summary
 SimpleField<T> createField(SIFElement parent, ElementDef id)
          Create a SimpleField from the value that this type represents
 boolean equals(java.lang.Object o)
          Evaluates the native wrapped value of this object to see if it equals the value of the compared object
 SIFDataType getDataType()
           
 int getSQLType()
          Returns a value from the java.sql.types class
abstract  SIFTypeConverter<T> getTypeConverter()
          Returns a type converter that can be used to create an instance of the datatype from a string
 T getValue()
           
 int hashCode()
           
 boolean isDoNotEncode()
          Should the XML writer encode the value that this datatype produces? Encoding is usually only necessary for string-based datatypes
 java.lang.String toString()
          Returns the text representation of this value in 1.x format by default.
 java.lang.String toString(SIFFormatter formatter)
          Returns the string representation of this data field, using the specified formatter
 java.lang.String toString(SIFVersion version)
          Returns a string in the format for the designated version
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getValue

public T getValue()
Returns:
The runtime native type that this SIFSimpleType wraps

createField

public SimpleField<T> createField(SIFElement parent,
                                  ElementDef id)
Create a SimpleField from the value that this type represents

Parameters:
parent - The Element that will be the parent of the field
id - The ElementDef representing the field
Returns:
A SimpleField instance initialized with the proper value

toString

public java.lang.String toString(SIFFormatter formatter)
Returns the string representation of this data field, using the specified formatter

Parameters:
formatter -
Returns:
The XML String representation of this value

toString

public java.lang.String toString(SIFVersion version)
Returns a string in the format for the designated version

Parameters:
version - The SIF Version to render this value in
Returns:
a string in the proper format for the specified version of SIF

toString

public java.lang.String toString()
Returns the text representation of this value in 1.x format by default. To change the default formatter used for rendering text values, call ADK.setTextFormatter(SIFFormatter)

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getTypeConverter

public abstract SIFTypeConverter<T> getTypeConverter()
Returns a type converter that can be used to create an instance of the datatype from a string

Returns:
The TypeConverter that is used for this element

getDataType

public SIFDataType getDataType()
Returns:
A value from the SIFDataType enum

getSQLType

public int getSQLType()
Returns a value from the java.sql.types class

Returns:
A value from the java.sql.types class
See Also:
Types

isDoNotEncode

public boolean isDoNotEncode()
Should the XML writer encode the value that this datatype produces? Encoding is usually only necessary for string-based datatypes

Returns:
True if this datatype should not be encoded when writing to XML

equals

public boolean equals(java.lang.Object o)
Evaluates the native wrapped value of this object to see if it equals the value of the compared object

Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2001-2007 Edustructures LLC. All Rights Reserved. SIFWorks® and ADK® are registered trademarks of Edustructures LLC. SIF™ and Schools Interoperability Framework are trademarks of the Schools Interoperability Framework Association.