org.openrdf.model.impl
Class ValueFactoryImpl

java.lang.Object
  extended by org.openrdf.model.impl.ValueFactoryBase
      extended by org.openrdf.model.impl.ValueFactoryImpl
All Implemented Interfaces:
ValueFactory

public class ValueFactoryImpl
extends ValueFactoryBase

Default implementation of the ValueFactory interface that uses the RDF model classes from this package.

Author:
Arjohn Kampman

Constructor Summary
ValueFactoryImpl()
           
 
Method Summary
 BNode createBNode(String nodeID)
          Creates a new blank node with the given node identifier.
 Literal createLiteral(String value)
          Creates a new literal with the supplied label.
 Literal createLiteral(String value, String language)
          Creates a new literal with the supplied label and language attribute.
 Literal createLiteral(String value, URI datatype)
          Creates a new literal with the supplied label and datatype.
 Statement createStatement(Resource subject, URI predicate, Value object)
          Creates a new statement with the supplied subject, predicate and object.
 Statement createStatement(Resource subject, URI predicate, Value object, Resource context)
          Creates a new statement with the supplied subject, predicate and object and associated context.
 URI createURI(String uri)
          Creates a new URI from the supplied string-representation.
 URI createURI(String namespace, String localName)
          Creates a new URI from the supplied namespace and local name.
static ValueFactoryImpl getInstance()
           
 
Methods inherited from class org.openrdf.model.impl.ValueFactoryBase
createBNode, createFPLiteral, createIntegerLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createNumericLiteral, initBNodeParams
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueFactoryImpl

public ValueFactoryImpl()
Method Detail

getInstance

public static ValueFactoryImpl getInstance()

createURI

public URI createURI(String uri)
Description copied from interface: ValueFactory
Creates a new URI from the supplied string-representation.

Parameters:
uri - A string-representation of a URI.
Returns:
An object representing the URI.

createURI

public URI createURI(String namespace,
                     String localName)
Description copied from interface: ValueFactory
Creates a new URI from the supplied namespace and local name. Calling this method is funtionally equivalent to calling createURI(namespace+localName), but allows the ValueFactory to reuse supplied namespace and local name strings whenever possible. Note that the values returned by URI.getNamespace() and URI.getLocalName() are not necessarily the same as the values that are supplied to this method.

Parameters:
namespace - The URI's namespace.
localName - The URI's local name.

createBNode

public BNode createBNode(String nodeID)
Description copied from interface: ValueFactory
Creates a new blank node with the given node identifier.

Parameters:
nodeID - The blank node identifier.
Returns:
An object representing the blank node.

createLiteral

public Literal createLiteral(String value)
Description copied from interface: ValueFactory
Creates a new literal with the supplied label.

Parameters:
value - The literal's label.

createLiteral

public Literal createLiteral(String value,
                             String language)
Description copied from interface: ValueFactory
Creates a new literal with the supplied label and language attribute.

Parameters:
value - The literal's label.
language - The literal's language attribute, or null if the literal doesn't have a language.

createLiteral

public Literal createLiteral(String value,
                             URI datatype)
Description copied from interface: ValueFactory
Creates a new literal with the supplied label and datatype.

Parameters:
value - The literal's label.
datatype - The literal's datatype, or null if the literal doesn't have a datatype.

createStatement

public Statement createStatement(Resource subject,
                                 URI predicate,
                                 Value object)
Description copied from interface: ValueFactory
Creates a new statement with the supplied subject, predicate and object.

Parameters:
subject - The statement's subject.
predicate - The statement's predicate.
object - The statement's object.
Returns:
The created statement.

createStatement

public Statement createStatement(Resource subject,
                                 URI predicate,
                                 Value object,
                                 Resource context)
Description copied from interface: ValueFactory
Creates a new statement with the supplied subject, predicate and object and associated context.

Parameters:
subject - The statement's subject.
predicate - The statement's predicate.
object - The statement's object.
context - The statement's context.
Returns:
The created statement.


Copyright © 2001-2007 Aduna. All Rights Reserved.