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(com.hp.hpl.jena.graph.impl.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(com.hp.hpl.jena.graph.impl.LiteralLabel litLabel1,
com.hp.hpl.jena.graph.impl.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(com.hp.hpl.jena.graph.impl.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(com.hp.hpl.jena.graph.impl.LiteralLabel value1,
com.hp.hpl.jena.graph.impl.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 RDFDatatypepublic String unparse(Object value)
unparse in interface RDFDatatypepublic Object parse(String lexicalForm) throws DatatypeFormatException
parse in interface RDFDatatypeDatatypeFormatException - if the lexical form is not legalpublic boolean isValid(String lexicalForm)
isValid in interface RDFDatatypepublic boolean isValidLiteral(com.hp.hpl.jena.graph.impl.LiteralLabel lit)
isValidLiteral in interface RDFDatatypepublic boolean isValidValue(Object valueForm)
isValidValue in interface RDFDatatypepublic boolean isEqual(com.hp.hpl.jena.graph.impl.LiteralLabel litLabel1, com.hp.hpl.jena.graph.impl.LiteralLabel litLabel2)
isEqual in interface RDFDatatypepublic int getHashCode(com.hp.hpl.jena.graph.impl.LiteralLabel lit)
getHashCode in interface RDFDatatypepublic boolean langTagCompatible(com.hp.hpl.jena.graph.impl.LiteralLabel value1, com.hp.hpl.jena.graph.impl.LiteralLabel value2)
public Class<?> getJavaClass()
getJavaClass in interface RDFDatatypepublic Object cannonicalise(Object value)
cannonicalise in interface RDFDatatypepublic Object extendedTypeDefinition()
org.apache.xerces.impl.xs.psvi.XSTypeDefinition.extendedTypeDefinition in interface RDFDatatypepublic RDFDatatype normalizeSubType(Object value, RDFDatatype dt)
normalizeSubType in interface RDFDatatypevalue - the current object valuedt - the currently set data typeLicenced under the Apache License, Version 2.0