public class TypeMapper extends Object
Constructor and Description |
---|
TypeMapper() |
Modifier and Type | Method and Description |
---|---|
static TypeMapper |
getInstance()
Return the single global instance of the TypeMapper.
|
RDFDatatype |
getSafeTypeByName(String uri)
Version of getTypeByName which will treat unknown URIs as typed literals but with
just the default implementation
|
RDFDatatype |
getTypeByClass(Class<?> clazz)
Look up a datatype suitable for representing instances of the
given Java class.
|
RDFDatatype |
getTypeByName(String uri)
Lookup a known datatype.
|
RDFDatatype |
getTypeByValue(Object value)
Method getTypeByValue.
|
Iterator<RDFDatatype> |
listTypes()
List all the known datatypes
|
void |
registerDatatype(RDFDatatype type)
Register a new datatype
|
static void |
reset() |
static void |
setInstance(TypeMapper typeMapper) |
public static TypeMapper getInstance()
public static void setInstance(TypeMapper typeMapper)
public static void reset()
public RDFDatatype getSafeTypeByName(String uri)
RDF 1.1: null for uri
returns null and it will mean xsd:string
because plain literals (no lang tag) and xsd:strings are now the same.
uri
- the URI of the desired datatypepublic RDFDatatype getTypeByName(String uri)
uri
- the URI of the desired datatypepublic RDFDatatype getTypeByValue(Object value)
value
- a value instance to be representedvalue
public Iterator<RDFDatatype> listTypes()
public RDFDatatype getTypeByClass(Class<?> clazz)
clazz
- a Java class to be representedpublic void registerDatatype(RDFDatatype type)
Licenced under the Apache License, Version 2.0