public class BaseDatatype extends Object implements RDFDatatype
Modifier and Type | Class and Description |
---|---|
static class |
BaseDatatype.TypedValue
Pair object used to encode both lexical form
and datatype for a typed literal with unknown
datatype.
|
Constructor and Description |
---|
BaseDatatype(String uri)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Object |
cannonicalise(Object value)
Cannonicalise a java Object value to a normal form.
|
Object |
extendedTypeDefinition()
Returns an object giving more details on the datatype.
|
int |
getHashCode(LiteralLabel lit)
Default implementation of getHashCode() delegates to the default from
the literal label.
|
Class<?> |
getJavaClass()
Returns the java class which is used to represent value
instances of this datatype.
|
String |
getURI()
Return the URI which is the label for this datatype
|
boolean |
isEqual(LiteralLabel litLabel1,
LiteralLabel litLabel2)
Compares two instances of values of the given datatype.
|
boolean |
isValid(String lexicalForm)
Test whether the given string is a legal lexical form
of this datatype.
|
boolean |
isValidLiteral(LiteralLabel lit)
Test whether the given LiteralLabel is a valid instance
of this datatype.
|
boolean |
isValidValue(Object valueForm)
Test whether the given object is a legal value form
of this datatype.
|
boolean |
langTagCompatible(LiteralLabel value1,
LiteralLabel value2)
Helper function to compare language tag values
|
RDFDatatype |
normalizeSubType(Object value,
RDFDatatype dt)
Normalization.
|
Object |
parse(String lexicalForm)
Parse a lexical form of this datatype to a value
|
String |
toString()
Display format
|
String |
unparse(Object value)
Convert a value of this datatype out
to lexical form.
|
public BaseDatatype(String uri)
uri
- the URI label to use for this datatypepublic String getURI()
getURI
in interface RDFDatatype
public String unparse(Object value)
unparse
in interface RDFDatatype
public Object parse(String lexicalForm) throws DatatypeFormatException
parse
in interface RDFDatatype
DatatypeFormatException
- if the lexical form is not legalpublic boolean isValid(String lexicalForm)
isValid
in interface RDFDatatype
public boolean isValidLiteral(LiteralLabel lit)
isValidLiteral
in interface RDFDatatype
public boolean isValidValue(Object valueForm)
isValidValue
in interface RDFDatatype
public boolean isEqual(LiteralLabel litLabel1, LiteralLabel litLabel2)
isEqual
in interface RDFDatatype
public int getHashCode(LiteralLabel lit)
getHashCode
in interface RDFDatatype
public boolean langTagCompatible(LiteralLabel value1, LiteralLabel value2)
public Class<?> getJavaClass()
getJavaClass
in interface RDFDatatype
public Object cannonicalise(Object value)
cannonicalise
in interface RDFDatatype
public Object extendedTypeDefinition()
org.apache.xerces.impl.xs.psvi.XSTypeDefinition
.extendedTypeDefinition
in interface RDFDatatype
public RDFDatatype normalizeSubType(Object value, RDFDatatype dt)
normalizeSubType
in interface RDFDatatype
value
- the current object valuedt
- the currently set data typeLicenced under the Apache License, Version 2.0