org.xenei.jena.entities.impl.handlers
Class LiteralHandler

java.lang.Object
  extended by org.xenei.jena.entities.impl.handlers.LiteralHandler
All Implemented Interfaces:
ObjectHandler

public class LiteralHandler
extends Object
implements ObjectHandler

An ObjectHandler that encodes objects as Literals and visa versa.


Constructor Summary
LiteralHandler(com.hp.hpl.jena.datatypes.RDFDatatype literalDatatype)
          Create a LiteralHandler that converts literalDatatype objects.
 
Method Summary
 com.hp.hpl.jena.rdf.model.Literal createRDFNode(Object obj)
          Convert the object to a Literal using the literalDatatype.
 boolean equals(Object o)
           
 int hashCode()
           
 Object parseObject(com.hp.hpl.jena.rdf.model.RDFNode node)
          Convert a Literal to an object using the Literaldata type to parse it.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LiteralHandler

public LiteralHandler(com.hp.hpl.jena.datatypes.RDFDatatype literalDatatype)
Create a LiteralHandler that converts literalDatatype objects.

Parameters:
literalDatatype - The RDFDatatype that will be converted to/from.
Method Detail

createRDFNode

public com.hp.hpl.jena.rdf.model.Literal createRDFNode(Object obj)
Convert the object to a Literal using the literalDatatype.

Specified by:
createRDFNode in interface ObjectHandler
Parameters:
obj - the Object to convert.
Returns:
The literal representation of the object
Throws:
An - exception of object can not be parsed to a lexical form.

parseObject

public Object parseObject(com.hp.hpl.jena.rdf.model.RDFNode node)
Convert a Literal to an object using the Literaldata type to parse it.

Specified by:
parseObject in interface ObjectHandler
Parameters:
node - The literal node.
Returns:
The parsed object
Throws:
An - exception if node is not a Liter that can be parsed by literalDatatype.

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2012 XENEI.com. All Rights Reserved.