public final class XMLSchemaDatatypeHandler extends Object implements DatatypeHandler
XSD
datatypes.
Implemented using XMLDatatypes
.
Constructor and Description |
---|
XMLSchemaDatatypeHandler()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isRecognizedDatatype(IRI datatypeUri)
Checks if the given datatype
IRI is recognized by this `DatatypeHandler`. |
String |
key()
A unique key for this datatype handler to identify it in the
|
Literal |
normalizeDatatype(String theValue,
Datatype theDatatype)
Normalize both the datatype and the literal value if appropriate, and generate a literal with the provided value and datatype.
|
boolean |
verifyDatatype(String theValue,
Datatype theDatatype)
Verifies that the datatype is valid, including a check on the
structure of the literal value.
|
public boolean isRecognizedDatatype(@Nonnull IRI datatypeUri)
IRI
is recognized by this `DatatypeHandler`.isRecognizedDatatype
in interface DatatypeHandler
datatypeUri
- The datatype URI to check.DatatypeHandler.verifyDatatype(String, Datatype)
and
DatatypeHandler.normalizeDatatype(String, Datatype)
.public boolean verifyDatatype(@Nonnull String theValue, @Nonnull Datatype theDatatype)
This method must only be called after verifying that
DatatypeHandler.isRecognizedDatatype(IRI)
returns true for the given datatype
URI.
verifyDatatype
in interface DatatypeHandler
theValue
- Literal value matching the given datatype URI.theDatatype
- A datatype that matched with DatatypeHandler.isRecognizedDatatype(IRI)
InvalidLiteral
exception if the datatype is not recognized@Nonnull public Literal normalizeDatatype(@Nonnull String theValue, @Nonnull Datatype theDatatype) throws InvalidLiteral
DatatypeHandler.isRecognizedDatatype(IRI)
returns true for the given datatype
URI, and DatatypeHandler.verifyDatatype(String, Datatype)
also returns true for the
given datatype and literal value.normalizeDatatype
in interface DatatypeHandler
theValue
- Required literal value to use in the normalization process and to
provide the value for the resulting literal.theDatatype
- The datatype which is to be normalized. It is available
in normalized form from the result using
Literal.datatype()
.Literal
containing the normalized literal value and datatype URI.
An implementation may throw InvalidLiteral
exception if the datatype is not recognized
or cannot be normalized for any reason, e.g. its value is not legal for its datatype.InvalidLiteral
public String key()
key
in interface DatatypeHandler
Copyright © 2010-2016 Stardog Union. All Rights Reserved.