org.semanticdesktop.aperture.rdf.impl
Class ValueFactoryImpl

java.lang.Object
  extended by org.semanticdesktop.aperture.rdf.impl.ValueFactoryImpl
All Implemented Interfaces:
ValueFactory

public class ValueFactoryImpl
extends Object
implements ValueFactory

An implementation of the ValueFactory interface that relays creation of RDF2Go datatypes to a given RDF2Go Model.


Constructor Summary
ValueFactoryImpl(Model model)
           
 
Method Summary
 BlankNode createBlankNode()
          Creates a new blank node.
 Literal createLiteral(boolean value)
          Creates a new xsd:boolean-typed literal representing the specified value.
 Literal createLiteral(byte value)
          Creates a new xsd:byte-typed literal representing the specified value.
 Literal createLiteral(double value)
          Creates a new xsd:double-typed literal representing the specified value.
 Literal createLiteral(float value)
          Creates a new xsd:float-typed literal representing the specified value.
 Literal createLiteral(int value)
          Creates a new xsd:int-typed literal representing the specified value.
 Literal createLiteral(long value)
          Creates a new xsd:long-typed literal representing the specified value.
 Literal createLiteral(short value)
          Creates a new xsd:short-typed literal representing the specified value.
 Literal createLiteral(String label)
          Creates a new literal with the supplied label.
 Literal createLiteral(String label, URI datatype)
          Creates a new literal with the supplied label and datatype.
 Statement createStatement(Resource subject, URI predicate, Node object)
          Creates a new statement with the supplied subject, predicate and object.
 URI createURI(String uri)
          Creates a new URI from the supplied string-representation.
 URI createURI(String namespaceUri, String localName)
          Creates a new URI from the namespace uri and local name;
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueFactoryImpl

public ValueFactoryImpl(Model model)
Method Detail

createLiteral

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

Specified by:
createLiteral in interface ValueFactory
Parameters:
label - The literal's label.
Throws:
ModelException

createLiteral

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

Specified by:
createLiteral in interface ValueFactory
Parameters:
label - The literal's label.
datatype - The literal's datatype, or null if the literal doesn't have a datatype.
Throws:
ModelException

createLiteral

public Literal createLiteral(boolean value)
                      throws ModelException
Description copied from interface: ValueFactory
Creates a new xsd:boolean-typed literal representing the specified value.

Specified by:
createLiteral in interface ValueFactory
Parameters:
value - The value for the literal
Returns:
An xsd:boolean-typed literal for the specified value.
Throws:
ModelException

createLiteral

public Literal createLiteral(long value)
                      throws ModelException
Description copied from interface: ValueFactory
Creates a new xsd:long-typed literal representing the specified value.

Specified by:
createLiteral in interface ValueFactory
Parameters:
value - The value for the literal
Returns:
An xsd:long-typed literal for the specified value.
Throws:
ModelException

createLiteral

public Literal createLiteral(int value)
                      throws ModelException
Description copied from interface: ValueFactory
Creates a new xsd:int-typed literal representing the specified value.

Specified by:
createLiteral in interface ValueFactory
Parameters:
value - The value for the literal
Returns:
An xsd:int-typed literal for the specified value.
Throws:
ModelException

createLiteral

public Literal createLiteral(short value)
                      throws ModelException
Description copied from interface: ValueFactory
Creates a new xsd:short-typed literal representing the specified value.

Specified by:
createLiteral in interface ValueFactory
Parameters:
value - The value for the literal
Returns:
An xsd:short-typed literal for the specified value.
Throws:
ModelException

createLiteral

public Literal createLiteral(byte value)
                      throws ModelException
Description copied from interface: ValueFactory
Creates a new xsd:byte-typed literal representing the specified value.

Specified by:
createLiteral in interface ValueFactory
Parameters:
value - The value for the literal
Returns:
An xsd:byte-typed literal for the specified value.
Throws:
ModelException

createLiteral

public Literal createLiteral(double value)
                      throws ModelException
Description copied from interface: ValueFactory
Creates a new xsd:double-typed literal representing the specified value.

Specified by:
createLiteral in interface ValueFactory
Parameters:
value - The value for the literal
Returns:
An xsd:double-typed literal for the specified value.
Throws:
ModelException

createLiteral

public Literal createLiteral(float value)
                      throws ModelException
Description copied from interface: ValueFactory
Creates a new xsd:float-typed literal representing the specified value.

Specified by:
createLiteral in interface ValueFactory
Parameters:
value - The value for the literal
Returns:
An xsd:float-typed literal for the specified value.
Throws:
ModelException

createStatement

public Statement createStatement(Resource subject,
                                 URI predicate,
                                 Node 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.

createURI

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

Specified by:
createURI in interface ValueFactory
Parameters:
uri - A string-representation of a URI.
Returns:
An object representing the URI.
Throws:
ModelException

createURI

public URI createURI(String namespaceUri,
                     String localName)
              throws ModelException
Description copied from interface: ValueFactory
Creates a new URI from the namespace uri and local name;

Specified by:
createURI in interface ValueFactory
Parameters:
namespaceUri - A string-representation of a namespace URI.
localName - A string representation of the local name
Returns:
An object representing the URI.
Throws:
ModelException

createBlankNode

public BlankNode createBlankNode()
Description copied from interface: ValueFactory
Creates a new blank node.

Specified by:
createBlankNode in interface ValueFactory
Returns:
An object representing the blank node.


Copyright © 2010 Aperture Development Team. All Rights Reserved.