org.apache.clerezza.rdf.core.impl
Class SimpleLiteralFactory

java.lang.Object
  extended by org.apache.clerezza.rdf.core.LiteralFactory
      extended by org.apache.clerezza.rdf.core.impl.SimpleLiteralFactory

public class SimpleLiteralFactory
extends LiteralFactory

An implementation of literal factory currently supporting only byte[]/base64Binary and Java.util.Date/date

Author:
reto

Constructor Summary
SimpleLiteralFactory()
           
 
Method Summary
<T> T
createObject(Class<T> type, TypedLiteral literal)
          Converts a literal to an instance of the specified class
 TypedLiteral createTypedLiteral(Object value)
          Create a typed literal for the specified object
 
Methods inherited from class org.apache.clerezza.rdf.core.LiteralFactory
getInstance, setInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleLiteralFactory

public SimpleLiteralFactory()
Method Detail

createTypedLiteral

public TypedLiteral createTypedLiteral(Object value)
                                throws NoConvertorException
Description copied from class: LiteralFactory
Create a typed literal for the specified object

Specified by:
createTypedLiteral in class LiteralFactory
Parameters:
value - the value of the literal to be created
Returns:
a TypedLiteral representing the value
Throws:
NoConvertorException - thrown if value is of an invalid type

createObject

public <T> T createObject(Class<T> type,
                          TypedLiteral literal)
               throws NoConvertorException,
                      InvalidLiteralTypeException
Description copied from class: LiteralFactory
Converts a literal to an instance of the specified class

Specified by:
createObject in class LiteralFactory
Parameters:
type - the Class of the returned object
literal - the literal to be converted
Returns:
a java object representing the value of the literal
Throws:
NoConvertorException - thrown if type is unsupported
InvalidLiteralTypeException - if the literal type doesn't match the requested java type


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.