public abstract class AbstractValueFactory extends Object implements ValueFactory
ValueFactory implementations. It implements all basic Value
creation methods by using the default implementations (SimpleBNode, SimpleIRI, etc), and
type-optimized subclasses (e.g. BooleanLiteral, NumericLiteral) where possible.| Constructor and Description |
|---|
AbstractValueFactory() |
| Modifier and Type | Method and Description |
|---|---|
BNode |
createBNode()
Creates a new bNode.
|
BNode |
createBNode(String nodeID)
Creates a new blank node with the given node identifier.
|
protected Literal |
createFPLiteral(Number value,
IRI datatype)
Calls
createNumericLiteral(Number, IRI) with the supplied value and datatype as parameters. |
protected Literal |
createIntegerLiteral(Number value,
IRI datatype)
Calls
createNumericLiteral(Number, IRI) with the supplied value and datatype as parameters. |
IRI |
createIRI(String iri)
Creates a new IRI from the supplied string-representation.
|
IRI |
createIRI(String namespace,
String localName)
Creates a new IRI from the supplied namespace and local name.
|
Literal |
createLiteral(BigDecimal bigDecimal)
Creates a new literal representing the specified bigDecimal that is typed using the appropriate XML
Schema date/time datatype.
|
Literal |
createLiteral(BigInteger bigInteger)
Creates a new literal representing the specified bigInteger that is typed using the appropriate XML
Schema date/time datatype.
|
Literal |
createLiteral(boolean b)
Creates a new xsd:boolean-typed literal representing the specified value.
|
Literal |
createLiteral(byte value)
Calls
createIntegerLiteral(Number, IRI) with the supplied value and XMLSchema.BYTE as
parameters. |
Literal |
createLiteral(Date date)
Converts the supplied
Date to a XMLGregorianCalendar, then calls
ValueFactory.createLiteral(XMLGregorianCalendar). |
Literal |
createLiteral(double value)
Calls
createFPLiteral(Number, IRI) with the supplied value and XMLSchema.DOUBLE as
parameters. |
Literal |
createLiteral(float value)
Calls
createFPLiteral(Number, IRI) with the supplied value and XMLSchema.FLOAT as
parameters. |
Literal |
createLiteral(int value)
Calls
createIntegerLiteral(Number, IRI) with the supplied value and XMLSchema.INT as
parameters. |
Literal |
createLiteral(long value)
Calls
createIntegerLiteral(Number, IRI) with the supplied value and XMLSchema.LONG as
parameters. |
Literal |
createLiteral(short value)
Calls
createIntegerLiteral(Number, IRI) with the supplied value and XMLSchema.SHORT as
parameters. |
Literal |
createLiteral(String value)
Creates a new literal with the supplied label.
|
Literal |
createLiteral(String value,
IRI datatype)
Creates a new literal with the supplied label and datatype.
|
Literal |
createLiteral(String value,
String language)
Creates a new literal with the supplied label and language attribute.
|
Literal |
createLiteral(String label,
URI datatype)
Deprecated.
|
Literal |
createLiteral(XMLGregorianCalendar calendar)
Calls
ValueFactory.createLiteral(String, IRI) with the String-value of the supplied calendar
and the appropriate datatype as parameters. |
protected Literal |
createNumericLiteral(Number number,
IRI datatype)
Creates specific optimized subtypes of SimpleLiteral for numeric datatypes.
|
Statement |
createStatement(Resource subject,
IRI predicate,
Value object)
Creates a new statement with the supplied subject, predicate and object.
|
Statement |
createStatement(Resource subject,
IRI predicate,
Value object,
Resource context)
Creates a new statement with the supplied subject, predicate and object and associated context.
|
Statement |
createStatement(Resource subject,
URI predicate,
Value object)
Deprecated.
|
Statement |
createStatement(Resource subject,
URI predicate,
Value object,
Resource context)
Deprecated.
|
URI |
createURI(String uri)
Deprecated.
|
URI |
createURI(String namespace,
String localName)
Deprecated.
|
protected void |
initBNodeParams()
Generates a new bnode prefix and resets nextBNodeID to 1 .
|
@Deprecated public URI createURI(String uri)
ValueFactorycreateURI in interface ValueFactoryuri - A string-representation of a URI.public IRI createIRI(String iri)
ValueFactorycreateIRI in interface ValueFactoryiri - A string-representation of a IRI.public IRI createIRI(String namespace, String localName)
ValueFactorycreateIRI(namespace+localName), but allows the
ValueFactory to reuse supplied namespace and local name strings whenever possible. Note that the values
returned by IRI.getNamespace() and IRI.getLocalName() are not necessarily the same as
the values that are supplied to this method.createIRI in interface ValueFactorynamespace - The IRI's namespace.localName - The IRI's local name.@Deprecated public URI createURI(String namespace, String localName)
ValueFactorycreateURI in interface ValueFactorypublic BNode createBNode(String nodeID)
ValueFactorycreateBNode in interface ValueFactorynodeID - The blank node identifier.@Deprecated public Literal createLiteral(String label, URI datatype)
ValueFactorycreateLiteral in interface ValueFactorylabel - The literal's label.datatype - The literal's datatype, or null if the literal doesn't have a datatype.public Literal createLiteral(String value)
ValueFactorycreateLiteral in interface ValueFactoryvalue - The literal's label.public Literal createLiteral(String value, String language)
ValueFactorycreateLiteral in interface ValueFactoryvalue - The literal's label.language - The literal's language attribute, or null if the literal doesn't have a language.public Literal createLiteral(boolean b)
ValueFactorycreateLiteral in interface ValueFactoryb - The value for the literal.public Literal createLiteral(String value, IRI datatype)
ValueFactorycreateLiteral in interface ValueFactoryvalue - The literal's label.datatype - The literal's datatype, or null if the literal doesn't have a datatype.@Deprecated public Statement createStatement(Resource subject, URI predicate, Value object)
ValueFactorycreateStatement in interface ValueFactorysubject - The statement's subject.predicate - The statement's predicate.object - The statement's object.@Deprecated public Statement createStatement(Resource subject, URI predicate, Value object, Resource context)
ValueFactorycreateStatement in interface ValueFactorysubject - The statement's subject.predicate - The statement's predicate.object - The statement's object.public Statement createStatement(Resource subject, IRI predicate, Value object)
ValueFactorycreateStatement in interface ValueFactorysubject - The statement's subject.predicate - The statement's predicate.object - The statement's object.public Statement createStatement(Resource subject, IRI predicate, Value object, Resource context)
ValueFactorycreateStatement in interface ValueFactorysubject - The statement's subject.predicate - The statement's predicate.object - The statement's object.context - The statement's context.protected void initBNodeParams()
public BNode createBNode()
ValueFactorycreateBNode in interface ValueFactorypublic Literal createLiteral(byte value)
createIntegerLiteral(Number, IRI) with the supplied value and XMLSchema.BYTE as
parameters.createLiteral in interface ValueFactoryvalue - The value for the literal.public Literal createLiteral(short value)
createIntegerLiteral(Number, IRI) with the supplied value and XMLSchema.SHORT as
parameters.createLiteral in interface ValueFactoryvalue - The value for the literal.public Literal createLiteral(int value)
createIntegerLiteral(Number, IRI) with the supplied value and XMLSchema.INT as
parameters.createLiteral in interface ValueFactoryvalue - The value for the literal.public Literal createLiteral(long value)
createIntegerLiteral(Number, IRI) with the supplied value and XMLSchema.LONG as
parameters.createLiteral in interface ValueFactoryvalue - The value for the literal.protected Literal createIntegerLiteral(Number value, IRI datatype)
createNumericLiteral(Number, IRI) with the supplied value and datatype as parameters.public Literal createLiteral(float value)
createFPLiteral(Number, IRI) with the supplied value and XMLSchema.FLOAT as
parameters.createLiteral in interface ValueFactoryvalue - The value for the literal.public Literal createLiteral(double value)
createFPLiteral(Number, IRI) with the supplied value and XMLSchema.DOUBLE as
parameters.createLiteral in interface ValueFactoryvalue - The value for the literal.public Literal createLiteral(BigInteger bigInteger)
ValueFactorycreateLiteral in interface ValueFactorypublic Literal createLiteral(BigDecimal bigDecimal)
ValueFactorycreateLiteral in interface ValueFactoryprotected Literal createFPLiteral(Number value, IRI datatype)
createNumericLiteral(Number, IRI) with the supplied value and datatype as parameters.protected Literal createNumericLiteral(Number number, IRI datatype)
public Literal createLiteral(XMLGregorianCalendar calendar)
ValueFactory.createLiteral(String, IRI) with the String-value of the supplied calendar
and the appropriate datatype as parameters.createLiteral in interface ValueFactorycalendar - The value for the literal.XMLGregorianCalendar.toXMLFormat(),
XMLGregorianCalendar.getXMLSchemaType(),
XMLDatatypeUtil.qnameToURI(javax.xml.namespace.QName)public Literal createLiteral(Date date)
Date to a XMLGregorianCalendar, then calls
ValueFactory.createLiteral(XMLGregorianCalendar).createLiteral in interface ValueFactoryCopyright © 2015-2016 Eclipse Foundation. All Rights Reserved.