|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DatabindableDatatype
Datatype interface that supports Java databinding. This interface can be used to do java/xml databinding.
Field Summary |
---|
Fields inherited from interface org.relaxng.datatype.Datatype |
---|
ID_TYPE_ID, ID_TYPE_IDREF, ID_TYPE_IDREFS, ID_TYPE_NULL |
Method Summary | |
---|---|
Object |
createJavaObject(String literal,
ValidationContext context)
converts lexcial value to a corresponding Java-friendly object by using the given context information. |
Class |
getJavaObjectType()
gets the type of the objects that are created by the createJavaObject method. |
String |
serializeJavaObject(Object value,
SerializationContext context)
converts a value object back to the lexical representation. |
Methods inherited from interface org.relaxng.datatype.Datatype |
---|
checkValid, createStreamingValidator, createValue, getIdType, isContextDependent, isValid, sameValue, valueHashCode |
Method Detail |
---|
Object createJavaObject(String literal, ValidationContext context)
For the actual types returned by each type, see here.
Note that due to the difference between those Java friendly types
and actual XML Schema specification, the returned object sometimes
loses accuracy. For example, the "time" type allows "0.0000000000001 sec"
which cannot be represented in java.util.Calendar
class.
String serializeJavaObject(Object value, SerializationContext context) throws IllegalArgumentException
This method is a kind of the "reverse" function of the createJavaObject method.
context
- The context object is used to obtain information necessary to
serialize the value object. For example, QName type uses the context
to encode the URI into a prefix.
IllegalArgumentException
- If the type of the specified value object is not recognized,
this exception is thrown. For example, if you pass
a String object to the serializeJavaObject method of
the "positiveInteger" type, this exception is thrown.
Class getJavaObjectType()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |