|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.edustructures.sifworks.SIFFormatter
public abstract class SIFFormatter
A class that converts native datatypes supported by SIF to their textual representation.
| Constructor Summary | |
|---|---|
SIFFormatter()
|
|
| Method Summary | |
|---|---|
SIFElement |
addChild(SIFElement contentParent,
SIFElement content,
SIFVersion version)
Adds a SIFElement parsed from a specific version of SIF to the parent. |
java.nio.charset.Charset |
getCharset()
|
java.util.List<Element> |
getContent(SIFElement element,
SIFVersion version)
Gets the content from the SIFElement for the specified version of SIF. |
java.lang.String |
getContentType()
|
static javax.xml.datatype.DatatypeFactory |
getDataTypeFactory()
|
java.util.List<SimpleField> |
getFields(SIFElement element,
SIFVersion version)
Gets the fields from the SIFElement for the specified version of SIF. |
static java.util.UUID |
RefIDToUUID(java.lang.String sifRefId)
Converts a SIF RefId to a Java UUID |
void |
setField(SIFElement contentParent,
ElementDef fieldDef,
SIFSimpleType data,
SIFVersion version)
Adds a SimpleField parsed from a specific version of SIF to the parent. |
abstract boolean |
supportsNamespaces()
Returns true if the formatter supports XML Namespaces. |
abstract java.lang.Boolean |
toBoolean(java.lang.String inValue)
Converts an a SIF XML boolean value to a Java |
abstract java.util.Calendar |
toDate(java.lang.String dateValue)
Converts an a SIF XML date value to a Java |
abstract java.lang.String |
toDateString(java.util.Calendar date)
Converts a Java |
abstract java.util.Calendar |
toDateTime(java.lang.String xmlValue)
Parses a datetime value from the provided string. |
abstract java.lang.String |
toDateTimeString(java.util.Calendar date)
Converts a Java |
abstract java.math.BigDecimal |
toDecimal(java.lang.String intValue)
Converts an a SIF XML decimal value to a Java |
abstract javax.xml.datatype.Duration |
toDuration(java.lang.String xmlValue)
Converts an a SIF XML duration value to a Java |
abstract java.lang.Integer |
toInteger(java.lang.String intValue)
Converts an a SIF XML int value to a Java |
abstract java.lang.String |
toString(java.math.BigDecimal decimalValue)
Converts a Java |
abstract java.lang.String |
toString(java.lang.Boolean boolValue)
Converts a Java |
abstract java.lang.String |
toString(javax.xml.datatype.Duration d)
Converts a Java |
abstract java.lang.String |
toString(java.lang.Integer intValue)
Converts a Java |
abstract java.util.Calendar |
toTime(java.lang.String xmlValue)
Parses a time value from the provided string. |
abstract java.lang.String |
toTimeString(java.util.Calendar time)
Converts a Java |
static java.lang.String |
UUIDToRefID(java.util.UUID guid)
Converts a UUID to a string using the SIF format |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SIFFormatter()
| Method Detail |
|---|
public abstract java.lang.String toDateString(java.util.Calendar date)
date -
public abstract java.lang.String toDateTimeString(java.util.Calendar date)
date -
public abstract java.lang.String toTimeString(java.util.Calendar time)
time -
public abstract java.lang.String toString(java.lang.Integer intValue)
intValue -
public abstract java.lang.String toString(java.math.BigDecimal decimalValue)
decimalValue -
public abstract java.lang.String toString(java.lang.Boolean boolValue)
boolValue -
public abstract java.util.Calendar toDate(java.lang.String dateValue)
dateValue -
java.lang.IllegalArgumentException - If the value cannot be parsedpublic abstract java.util.Calendar toDateTime(java.lang.String xmlValue)
xmlValue -
java.lang.IllegalArgumentException - If the date cannot be parsedpublic abstract java.util.Calendar toTime(java.lang.String xmlValue)
xmlValue -
java.lang.IllegalArgumentException - If the value cannot be parsedpublic abstract java.lang.Integer toInteger(java.lang.String intValue)
intValue -
java.lang.IllegalArgumentException - If the value cannot be parsedpublic abstract java.math.BigDecimal toDecimal(java.lang.String intValue)
intValue -
java.lang.IllegalArgumentException - If the value cannot be parsedpublic abstract javax.xml.datatype.Duration toDuration(java.lang.String xmlValue)
xmlValue - A Duration formatted as a String or NULL
java.lang.IllegalArgumentException - If the value cannot be parsedpublic abstract java.lang.String toString(javax.xml.datatype.Duration d)
d -
java.lang.IllegalArgumentException - If the duration cannot be parsed
java.lang.UnsupportedOperationException - in SIF 1.1, since Durations are not usedpublic abstract java.lang.Boolean toBoolean(java.lang.String inValue)
inValue - A boolean formatted as a String or NULL
java.lang.IllegalArgumentException - If the value cannot be parsedpublic java.lang.String getContentType()
public java.nio.charset.Charset getCharset()
public abstract boolean supportsNamespaces()
public SIFElement addChild(SIFElement contentParent,
SIFElement content,
SIFVersion version)
contentParent - The element to add content tocontent - The element to addversion - The version of SIF that the SIFElement is being constructed
from
public void setField(SIFElement contentParent,
ElementDef fieldDef,
SIFSimpleType data,
SIFVersion version)
contentParent - The element to add content tofieldDef - The metadata definition of the field to setdata - The value to set to the fieldversion - The version of SIF that the SIFElement is being constructed
from
public java.util.List<Element> getContent(SIFElement element,
SIFVersion version)
element - The element to retrieve content fromversion -
public java.util.List<SimpleField> getFields(SIFElement element,
SIFVersion version)
element - version -
public static java.lang.String UUIDToRefID(java.util.UUID guid)
guid - the UUID to convert
public static java.util.UUID RefIDToUUID(java.lang.String sifRefId)
sifRefId - the string formatted as a SIF refId
java.lang.IllegalArgumentException - if sifRefid does not conform to the string representation of
a SIF RefIdpublic static javax.xml.datatype.DatatypeFactory getDataTypeFactory()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||