com.edustructures.sifworks
Class SIFTypeConverter<T>

java.lang.Object
  extended by com.edustructures.sifworks.SIFTypeConverter<T>
Type Parameters:
T - The datatype that the SIFSimpleType wraps, such as Integer, Calendar, String, etc.

public abstract class SIFTypeConverter<T>
extends java.lang.Object


Constructor Summary
SIFTypeConverter()
           
 
Method Summary
abstract  SIFDataType getDataType()
           
abstract  SIFSimpleType<T> getSIFSimpleType(java.lang.Object nativeType)
          Returns a SIFSimpleType that wraps the specified native value
abstract  int getSQLType()
          Returns a value from the java.sql.types class
abstract  SIFSimpleType<T> parse(SIFFormatter formatter, java.lang.String xmlValue)
          Parses the given XML string value to into a SIFSimpleType instance
 SimpleField parseField(SIFElement parent, ElementDef id, SIFFormatter formatter, java.lang.String xmlValue)
          Parses the XML String value and returns the proper SimpleField subclass to hold the element value
abstract  java.lang.String toString(SIFFormatter formatter, SIFSimpleType<T> value)
          Converts the given SIFSimpleType instance to an XML string value
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SIFTypeConverter

public SIFTypeConverter()
Method Detail

parse

public abstract SIFSimpleType<T> parse(SIFFormatter formatter,
                                       java.lang.String xmlValue)
                                throws ADKParsingException
Parses the given XML string value to into a SIFSimpleType instance

Parameters:
formatter - The formatter to use for the specific version of SIF being parsed
xmlValue - The XML string value
Returns:
A SIFSimpleType instance
Throws:
ADKParsingException

getSIFSimpleType

public abstract SIFSimpleType<T> getSIFSimpleType(java.lang.Object nativeType)
Returns a SIFSimpleType that wraps the specified native value

Parameters:
nativeType - The native Java type for this datatype, such as a String or Calendar. If null is passed in, a SIFSimpleType with a null value is returned.
Returns:
The appropriate SIFSimpleType for this datatype

toString

public abstract java.lang.String toString(SIFFormatter formatter,
                                          SIFSimpleType<T> value)
Converts the given SIFSimpleType instance to an XML string value

Parameters:
formatter - The formatter to use for the specific version of SIF being written to
value - a SIFSimpleType instance
Returns:
a String representing the XML payload used for this version of SIF. All types are nullable in SIF, so the resulting value could be null

getDataType

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

getSQLType

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

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

parseField

public SimpleField parseField(SIFElement parent,
                              ElementDef id,
                              SIFFormatter formatter,
                              java.lang.String xmlValue)
                       throws ADKParsingException
Parses the XML String value and returns the proper SimpleField subclass to hold the element value

Parameters:
parent - The parent SIFElement of the field
id - The metadata definition of the field
formatter - the formatter to use for the specific version of SIF in use
xmlValue - a String representing the XML payload used for this version of SIF
Returns:
a SimpleField initialized with the proper value
Throws:
ADKParsingException


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.