com.viceversatech.rdfbeans.datatype
Class DefaultDatatypeMapper
java.lang.Object
com.viceversatech.rdfbeans.datatype.DefaultDatatypeMapper
- All Implemented Interfaces:
- DatatypeMapper
public class DefaultDatatypeMapper
- extends java.lang.Object
- implements DatatypeMapper
Default DatatypeMapper implementation based on XML-Schema data types for
representation of Java primitive wrapper classes and dates as typed RDF
literals.
- Instances of
String
are represented as plain (untyped) RDF
literals.
- Instances of
Boolean
, Integer
, Float
,
Double
, Byte
, Long
and Short
are represented
as RDF literals with corresponding XML-Schema datatypes.
- Instances of
Date
are represented as RDF literals of xsd:dateTime
type, serialized into ISO8601 date/time format.
- Author:
- alex
Method Summary |
static org.ontoware.rdf2go.model.node.URI |
getDatatypeURI(java.lang.Class c)
|
java.lang.Object |
getJavaObject(org.ontoware.rdf2go.model.node.Literal l)
Returns a Java object reconstructed from the given RDF
literal value. |
org.ontoware.rdf2go.model.node.Literal |
getRDFValue(java.lang.Object value,
org.ontoware.rdf2go.model.Model model)
Returns an RDF literal representation of the given Java object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultDatatypeMapper
public DefaultDatatypeMapper()
getDatatypeURI
public static org.ontoware.rdf2go.model.node.URI getDatatypeURI(java.lang.Class c)
getJavaObject
public java.lang.Object getJavaObject(org.ontoware.rdf2go.model.node.Literal l)
- Description copied from interface:
DatatypeMapper
- Returns a Java object reconstructed from the given RDF
literal value.
- Specified by:
getJavaObject
in interface DatatypeMapper
- Parameters:
l
- RDF plain or typed literal
- Returns:
- Java object or null if the literal datatype is not supported.
getRDFValue
public org.ontoware.rdf2go.model.node.Literal getRDFValue(java.lang.Object value,
org.ontoware.rdf2go.model.Model model)
- Description copied from interface:
DatatypeMapper
- Returns an RDF literal representation of the given Java object.
- Specified by:
getRDFValue
in interface DatatypeMapper
- Parameters:
value
- Java objectmodel
- RDF2Go model
- Returns:
- RDF plain or typed literal, or null if the object class is not supported
Copyright © 2011. All Rights Reserved.