org.openrdf.repository.object
Class ObjectFactory

java.lang.Object
  extended by org.openrdf.repository.object.ObjectFactory

public class ObjectFactory
extends Object

Converts between Value and objects without accessing the repository.

Author:
James Leigh

Constructor Summary
ObjectFactory(RoleMapper mapper, PropertyMapper properties, LiteralManager lm, ClassResolver resolver, ClassLoader cl)
           
 
Method Summary
 Literal createLiteral(Object object)
          Converts an object back into a literal.
 RDFObject createObject()
          Creates an anonymous object with no rdf:type.
 Object createObject(Literal literal)
          Converts a literal into an object.
 RDFObject createObject(Resource resource)
          Creates an object with no rdf:type.
<T> T
createObject(Resource resource, Class<T> type)
          Creates an object with an assumed rdf:type.
 RDFObject createObject(Resource resource, Collection<URI> types)
          Creates an object with assumed rdf:types.
 RDFObject createObject(Resource resource, URI... types)
          Creates an object with assumed rdf:types.
 RDFObject createObject(String uri)
          Creates an object with no rdf:type.
protected  String createObjectQuery(Class<?> concept, int bindings)
           
 Value createValue(Object object)
          Converts an object into a literal or resource.
 ClassLoader getClassLoader()
           
protected  URI getType(Class<?> concept)
           
protected  boolean isDatatype(Class<?> type)
           
 boolean isNamedConcept(Class<?> type)
           
protected  void setObjectConnection(ObjectConnection connection)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectFactory

public ObjectFactory(RoleMapper mapper,
                     PropertyMapper properties,
                     LiteralManager lm,
                     ClassResolver resolver,
                     ClassLoader cl)
Method Detail

getClassLoader

public ClassLoader getClassLoader()
Returns:
The ClassLoader used by this ObjectFactory.

createObject

public Object createObject(Literal literal)
Converts a literal into an object.


createLiteral

public Literal createLiteral(Object object)
Converts an object back into a literal.


createValue

public Value createValue(Object object)
Converts an object into a literal or resource.


createObject

public RDFObject createObject()
Creates an anonymous object with no rdf:type.


createObject

public RDFObject createObject(String uri)
Creates an object with no rdf:type.


createObject

public RDFObject createObject(Resource resource)
Creates an object with no rdf:type.


createObject

public <T> T createObject(Resource resource,
                          Class<T> type)
Creates an object with an assumed rdf:type.


createObject

public RDFObject createObject(Resource resource,
                              URI... types)
Creates an object with assumed rdf:types.


createObject

public RDFObject createObject(Resource resource,
                              Collection<URI> types)
Creates an object with assumed rdf:types.


isNamedConcept

public boolean isNamedConcept(Class<?> type)
Returns:
true If the given type can be used as a concept parameter.

setObjectConnection

protected void setObjectConnection(ObjectConnection connection)

isDatatype

protected boolean isDatatype(Class<?> type)

getType

protected URI getType(Class<?> concept)

createObjectQuery

protected String createObjectQuery(Class<?> concept,
                                   int bindings)


Copyright © 2004-2009 James Leigh Services Inc.. All Rights Reserved.