|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Datatype object. Every Datatype object has several functionalities. Particularly,
Method Summary | |
boolean |
allows(java.lang.String literal,
ValidationContext context)
checks if 'literal' matchs this Datatype under the current context. |
void |
check(java.lang.String literal,
ValidationContext context)
diagnoses the reason of error. |
DatatypeStreamingValidator |
createStreamingValidator(ValidationContext context)
creates an instance of the streaming validator for this type. |
java.lang.Object |
createValue(java.lang.String literal,
ValidationContext context)
converts lexcial value and the current context to the corresponding value object. |
boolean |
sameValue(java.lang.Object value1,
java.lang.Object value2)
tests the equality of two value objects which belongs to this type. |
int |
valueHashCode(java.lang.Object value)
computes the hash code for a value object, which is consistent with the sameValue method. |
Method Detail |
public boolean allows(java.lang.String literal, ValidationContext context)
literal
- the lexical representation to be verifiedcontext
- context information that may be
necessary to verify the given literal.public void check(java.lang.String literal, ValidationContext context) throws DatatypeException
DatatypeException
- If the callee supports the diagnosis and the given literal is invalid,
then this exception is thrown, possibly with diagnostic information.public DatatypeStreamingValidator createStreamingValidator(ValidationContext context) throws java.lang.UnsupportedOperationException
This method is optional and implementations are free to throw UnsupportedOperationException to indicate that this method is not implemented.
context
- context information that may be
necessary to verify the given literal.
The callee may keep a reference to this context object
while the returned streaming validator is being used.java.lang.UnsupportedOperationException
- if streaming validation is not supported by the callee.public java.lang.Object createValue(java.lang.String literal, ValidationContext context)
The caller cannot generally assume that the value object is a meaningful Java object. For example, the caller cannot expect this method to return java.lang.Number type for the "integer" type of XML Schema Part2.
The returned value object should be used solely for the sameValue method.
public boolean sameValue(java.lang.Object value1, java.lang.Object value2)
public int valueHashCode(java.lang.Object value)
The application should note that the hashCode method of the value object
is not necessarily consistent with the sameValue method.
Care has to be taken when you are planning to store the value objects
into java.util.Hashtable
or something.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |