org.openrdf.model.impl
Class ValueFactoryImpl

java.lang.Object
  extended by org.openrdf.model.impl.LiteralFactoryImpl
      extended by org.openrdf.model.impl.ValueFactoryImpl
All Implemented Interfaces:
BNodeFactory, LiteralFactory, URIFactory, ValueFactory
Direct Known Subclasses:
MemValueFactory

public class ValueFactoryImpl
extends LiteralFactoryImpl
implements ValueFactory

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

Author:
Arjohn Kampman, James Leigh

Constructor Summary
ValueFactoryImpl()
           
ValueFactoryImpl(BNodeFactory bnodes, URIFactory uris, LiteralFactory literals)
           
ValueFactoryImpl(BNodeFactory bnodes, ValueFactory values)
           
ValueFactoryImpl(URIFactory uris, LiteralFactory literals)
           
 
Method Summary
 BNode createBNode()
          Creates a new bNode.
 BNode createBNode(String nodeID)
          Creates a new blank node with the given node identifier.
 Literal createLiteral(boolean value)
          Calls LiteralFactory.createLiteral(String, URI) with the String-value of the supplied value and XMLSchema.BOOLEAN as parameters.
 Literal createLiteral(byte value)
          Calls #createIntegerLiteral(long, URI) with the supplied value and XMLSchema.BYTE as parameters.
 Literal createLiteral(double value)
          Calls LiteralFactoryImpl.createFPLiteral(Number, URI) with the supplied value and XMLSchema.DOUBLE as parameters.
 Literal createLiteral(float value)
          Calls LiteralFactoryImpl.createFPLiteral(Number, URI) with the supplied value and XMLSchema.FLOAT as parameters.
 Literal createLiteral(int value)
          Calls #createIntegerLiteral(long, URI) with the supplied value and XMLSchema.INT as parameters.
 Literal createLiteral(long value)
          Calls #createIntegerLiteral(long, URI) with the supplied value and XMLSchema.LONG as parameters.
 Literal createLiteral(short value)
          Calls #createIntegerLiteral(long, URI) with the supplied value and XMLSchema.SHORT as parameters.
 Literal createLiteral(String label)
          Creates a new literal with the supplied label.
 Literal createLiteral(String label, String language)
          Creates a new literal with the supplied label and language attribute.
 Literal createLiteral(String label, URI datatype)
          Creates a new literal with the supplied label and datatype.
 Literal createLiteral(XMLGregorianCalendar calendar)
          Calls LiteralFactory.createLiteral(String, URI) with the String-value of the supplied calendar and the appropriate datatype as parameters.
 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.
 BNodeFactory getBNodeFactory()
           
static ValueFactoryImpl getInstance()
           
 LiteralFactory getLiteralFactory()
           
 URIFactory getURIFactory()
           
 
Methods inherited from class org.openrdf.model.impl.LiteralFactoryImpl
createFPLiteral, createIntegerLiteral, createLiteral, createLiteral, createLiteral, createNumericLiteral
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openrdf.model.LiteralFactory
createLiteral, createLiteral, createLiteral
 

Constructor Detail

ValueFactoryImpl

public ValueFactoryImpl()

ValueFactoryImpl

public ValueFactoryImpl(URIFactory uris,
                        LiteralFactory literals)

ValueFactoryImpl

public ValueFactoryImpl(BNodeFactory bnodes,
                        ValueFactory values)

ValueFactoryImpl

public ValueFactoryImpl(BNodeFactory bnodes,
                        URIFactory uris,
                        LiteralFactory literals)
Method Detail

getInstance

public static ValueFactoryImpl getInstance()

getBNodeFactory

public BNodeFactory getBNodeFactory()

getURIFactory

public URIFactory getURIFactory()

getLiteralFactory

public LiteralFactory getLiteralFactory()

createBNode

public BNode createBNode()
Description copied from interface: BNodeFactory
Creates a new bNode.

Specified by:
createBNode in interface BNodeFactory
Returns:
An object representing the bNode.

createBNode

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

Specified by:
createBNode in interface BNodeFactory
Parameters:
nodeID - The blank node identifier.
Returns:
An object representing the blank node.

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.

Specified by:
createStatement in interface ValueFactory
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.

Specified by:
createStatement in interface ValueFactory
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.

createURI

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

Specified by:
createURI in interface URIFactory
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: URIFactory
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.

Specified by:
createURI in interface URIFactory
Parameters:
namespace - The URI's namespace.
localName - The URI's local name.

createLiteral

public Literal createLiteral(boolean value)
Description copied from class: LiteralFactoryImpl
Calls LiteralFactory.createLiteral(String, URI) with the String-value of the supplied value and XMLSchema.BOOLEAN as parameters.

Specified by:
createLiteral in interface LiteralFactory
Overrides:
createLiteral in class LiteralFactoryImpl
Parameters:
value - The value for the literal.
Returns:
An xsd:boolean-typed literal for the specified value.

createLiteral

public Literal createLiteral(byte value)
Description copied from class: LiteralFactoryImpl
Calls #createIntegerLiteral(long, URI) with the supplied value and XMLSchema.BYTE as parameters.

Specified by:
createLiteral in interface LiteralFactory
Overrides:
createLiteral in class LiteralFactoryImpl
Parameters:
value - The value for the literal.
Returns:
An xsd:byte-typed literal for the specified value.

createLiteral

public Literal createLiteral(double value)
Description copied from class: LiteralFactoryImpl
Calls LiteralFactoryImpl.createFPLiteral(Number, URI) with the supplied value and XMLSchema.DOUBLE as parameters.

Specified by:
createLiteral in interface LiteralFactory
Overrides:
createLiteral in class LiteralFactoryImpl
Parameters:
value - The value for the literal.
Returns:
An xsd:double-typed literal for the specified value.

createLiteral

public Literal createLiteral(float value)
Description copied from class: LiteralFactoryImpl
Calls LiteralFactoryImpl.createFPLiteral(Number, URI) with the supplied value and XMLSchema.FLOAT as parameters.

Specified by:
createLiteral in interface LiteralFactory
Overrides:
createLiteral in class LiteralFactoryImpl
Parameters:
value - The value for the literal.
Returns:
An xsd:float-typed literal for the specified value.

createLiteral

public Literal createLiteral(int value)
Description copied from class: LiteralFactoryImpl
Calls #createIntegerLiteral(long, URI) with the supplied value and XMLSchema.INT as parameters.

Specified by:
createLiteral in interface LiteralFactory
Overrides:
createLiteral in class LiteralFactoryImpl
Parameters:
value - The value for the literal.
Returns:
An xsd:int-typed literal for the specified value.

createLiteral

public Literal createLiteral(long value)
Description copied from class: LiteralFactoryImpl
Calls #createIntegerLiteral(long, URI) with the supplied value and XMLSchema.LONG as parameters.

Specified by:
createLiteral in interface LiteralFactory
Overrides:
createLiteral in class LiteralFactoryImpl
Parameters:
value - The value for the literal.
Returns:
An xsd:long-typed literal for the specified value.

createLiteral

public Literal createLiteral(short value)
Description copied from class: LiteralFactoryImpl
Calls #createIntegerLiteral(long, URI) with the supplied value and XMLSchema.SHORT as parameters.

Specified by:
createLiteral in interface LiteralFactory
Overrides:
createLiteral in class LiteralFactoryImpl
Parameters:
value - The value for the literal.
Returns:
An xsd:short-typed literal for the specified value.

createLiteral

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

Specified by:
createLiteral in interface LiteralFactory
Overrides:
createLiteral in class LiteralFactoryImpl
Parameters:
label - 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 label,
                             URI datatype)
Description copied from interface: LiteralFactory
Creates a new literal with the supplied label and datatype.

Specified by:
createLiteral in interface LiteralFactory
Overrides:
createLiteral in class LiteralFactoryImpl
Parameters:
label - The literal's label.
datatype - The literal's datatype, or null if the literal doesn't have a datatype.

createLiteral

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

Specified by:
createLiteral in interface LiteralFactory
Overrides:
createLiteral in class LiteralFactoryImpl
Parameters:
label - The literal's label.

createLiteral

public Literal createLiteral(XMLGregorianCalendar calendar)
Description copied from class: LiteralFactoryImpl
Calls LiteralFactory.createLiteral(String, URI) with the String-value of the supplied calendar and the appropriate datatype as parameters.

Specified by:
createLiteral in interface LiteralFactory
Overrides:
createLiteral in class LiteralFactoryImpl
Parameters:
calendar - The value for the literal.
Returns:
An typed literal for the specified calendar.
See Also:
XMLGregorianCalendar.toXMLFormat(), XMLGregorianCalendar.getXMLSchemaType(), XMLDatatypeUtil.qnameToURI(javax.xml.namespace.QName)


Copyright © 2001-2009 Aduna. All Rights Reserved.