org.eclipse.rdf4j.model.impl

## Class AbstractValueFactory

- java.lang.Object
- - org.eclipse.rdf4j.model.base.AbstractValueFactory
  - - org.eclipse.rdf4j.model.impl.AbstractValueFactory

- All Implemented Interfaces:
    ValueFactory
  Direct Known Subclasses:
    MemValueFactory, SimpleValueFactory, ValueFactoryBase, ValueStore

  Deprecated.
  since 3.5.0. Use either `SimpleValueFactory` directly, or switch to using `AbstractValueFactory`.

      @Deprecated
      public abstract class AbstractValueFactory
      extends AbstractValueFactory

  Abstract base class for `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.
  Author:
    Arjohn Kampman, Jeen Broekstra

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractValueFactory()` Deprecated.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `BNode` | `createBNode()` Deprecated. Creates a new bNode.
    `BNode` | `createBNode(String nodeID)` Deprecated. Creates a new blank node with the given node identifier.
    `protected Literal` | `createFPLiteral(Number value, IRI datatype)` Deprecated. Calls `createNumericLiteral(Number, IRI)` with the supplied value and datatype as parameters.
    `protected Literal` | `createFPLiteral(Number value, XSD.Datatype datatype)` Deprecated.
    `protected Literal` | `createIntegerLiteral(Number value, IRI datatype)` Deprecated. Calls `createNumericLiteral(Number, IRI)` with the supplied value and datatype as parameters.
    `protected Literal` | `createIntegerLiteral(Number value, XSD.Datatype datatype)` Deprecated.
    `IRI` | `createIRI(String iri)` Deprecated. Creates a new IRI from the supplied string-representation.
    `IRI` | `createIRI(String namespace, String localName)` Deprecated. Creates a new IRI from the supplied namespace and local name.
    `Literal` | `createLiteral(BigDecimal bigDecimal)` Deprecated. Creates a new literal representing the specified bigDecimal that is typed as an `xsd:Decimal`.
    `Literal` | `createLiteral(BigInteger bigInteger)` Deprecated. Creates a new literal representing the specified bigInteger that is typed as an `xsd:Integer`.
    `Literal` | `createLiteral(boolean b)` Deprecated. Creates a new `xsd:boolean`-typed literal representing the specified value.
    `Literal` | `createLiteral(byte value)` Deprecated. Calls `createIntegerLiteral(Number, IRI)` with the supplied value and `XSD.BYTE` as parameters.
    `Literal` | `createLiteral(Date date)` Deprecated. Converts the supplied `Date` to a `XMLGregorianCalendar`, then calls `ValueFactory.createLiteral(XMLGregorianCalendar)`.
    `Literal` | `createLiteral(double value)` Deprecated. Calls `createFPLiteral(Number, IRI)` with the supplied value and `XSD.DOUBLE` as parameters.
    `Literal` | `createLiteral(float value)` Deprecated. Calls `createFPLiteral(Number, IRI)` with the supplied value and `XSD.FLOAT` as parameters.
    `Literal` | `createLiteral(int value)` Deprecated. Calls `createIntegerLiteral(Number, IRI)` with the supplied value and `XSD.INT` as parameters.
    `Literal` | `createLiteral(long value)` Deprecated. Calls `createIntegerLiteral(Number, IRI)` with the supplied value and `XSD.LONG` as parameters.
    `Literal` | `createLiteral(short value)` Deprecated. Calls `createIntegerLiteral(Number, IRI)` with the supplied value and `XSD.SHORT` as parameters.
    `Literal` | `createLiteral(String value)` Deprecated. Creates a new literal with the supplied label.
    `Literal` | `createLiteral(String value, IRI datatype)` Deprecated. Creates a new literal with the supplied label and datatype.
    `Literal` | `createLiteral(String value, String language)` Deprecated. Creates a new literal with the supplied label and language attribute.
    `Literal` | `createLiteral(XMLGregorianCalendar calendar)` Deprecated. 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)` Deprecated. Creates specific optimized subtypes of SimpleLiteral for numeric datatypes.
    `protected Literal` | `createNumericLiteral(Number number, XSD.Datatype datatype)` Deprecated.
    `Statement` | `createStatement(Resource subject, IRI predicate, Value object)` Deprecated. Creates a new statement with the supplied subject, predicate and object.
    `Statement` | `createStatement(Resource subject, IRI predicate, Value object, Resource context)` Deprecated. Creates a new statement with the supplied subject, predicate and object and associated context.
    `Triple` | `createTriple(Resource subject, IRI predicate, Value object)` Deprecated. Creates a new RDF* triple with the supplied subject, predicate and object.
    `protected void` | `initBNodeParams()` Deprecated. Generates a new bnode prefix and resets `nextBNodeID` to `1` .

    - ### Methods inherited from class org.eclipse.rdf4j.model.base.AbstractValueFactory

      `createLiteral, createLiteral`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.eclipse.rdf4j.model.ValueFactory

      `createLiteral, createStatement, createStatement, createURI, createURI`

- - ### Constructor Detail

    - #### AbstractValueFactory

          protected AbstractValueFactory()

      Deprecated.

  - ### Method Detail

    - #### createIRI

          public IRI createIRI(String iri)

      Deprecated.
      Description copied from interface: `ValueFactory`
      Creates a new IRI from the supplied string-representation.
      Specified by:
        `createIRI` in interface `ValueFactory`
      Overrides:
        `createIRI` in class `AbstractValueFactory`
      Parameters:
        `iri` - A string-representation of a IRI.
      Returns:
        An object representing the IRI.

    - #### createIRI

          public IRI createIRI(String namespace,
                               String localName)

      Deprecated.
      Description copied from interface: `ValueFactory`
      Creates a new IRI from the supplied namespace and local name. Calling this method is funtionally equivalent to calling `createIRI(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.
      Specified by:
        `createIRI` in interface `ValueFactory`
      Overrides:
        `createIRI` in class `AbstractValueFactory`
      Parameters:
        `namespace` - The IRI's namespace.
        `localName` - The IRI's local name.

    - #### createBNode

          public BNode createBNode(String nodeID)

      Deprecated.
      Description copied from interface: `ValueFactory`
      Creates a new blank node with the given node identifier.
      Specified by:
        `createBNode` in interface `ValueFactory`
      Overrides:
        `createBNode` in class `AbstractValueFactory`
      Parameters:
        `nodeID` - The blank node identifier.
      Returns:
        An object representing the blank node.

    - #### createLiteral

          public Literal createLiteral(String value)

      Deprecated.
      Description copied from interface: `ValueFactory`
      Creates a new literal with the supplied label. The return value of `Literal.getDatatype()` for the returned object must be `xsd:string`.
      Specified by:
        `createLiteral` in interface `ValueFactory`
      Overrides:
        `createLiteral` in class `AbstractValueFactory`
      Parameters:
        `value` - The literal's label, must not be `null`.

    - #### createLiteral

          public Literal createLiteral(String value,
                                       String language)

      Deprecated.
      Description copied from interface: `ValueFactory`
      Creates a new literal with the supplied label and language attribute. The return value of `Literal.getDatatype()` for the returned object must be `rdf:langString`.
      Specified by:
        `createLiteral` in interface `ValueFactory`
      Overrides:
        `createLiteral` in class `AbstractValueFactory`
      Parameters:
        `value` - The literal's label, must not be `null`.
        `language` - The literal's language attribute, must not be `null`.

    - #### createLiteral

          public Literal createLiteral(boolean b)

      Deprecated.
      Description copied from interface: `ValueFactory`
      Creates a new `xsd:boolean`-typed literal representing the specified value.
      Specified by:
        `createLiteral` in interface `ValueFactory`
      Overrides:
        `createLiteral` in class `AbstractValueFactory`
      Parameters:
        `b` - The value for the literal.
      Returns:
        An `xsd:boolean`-typed literal for the specified value.

    - #### createLiteral

          public Literal createLiteral(String value,
                                       IRI datatype)

      Deprecated.
      Description copied from interface: `ValueFactory`
      Creates a new literal with the supplied label and datatype.
      Specified by:
        `createLiteral` in interface `ValueFactory`
      Overrides:
        `createLiteral` in class `AbstractValueFactory`
      Parameters:
        `value` - The literal's label, must not be `null`.
        `datatype` - The literal's datatype. If it is null, the datatype `xsd:string` will be assigned to this literal.

    - #### createStatement

          public Statement createStatement(Resource subject,
                                           IRI predicate,
                                           Value object)

      Deprecated.
      Description copied from interface: `ValueFactory`
      Creates a new statement with the supplied subject, predicate and object.
      Specified by:
        `createStatement` in interface `ValueFactory`
      Overrides:
        `createStatement` in class `AbstractValueFactory`
      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,
                                           IRI predicate,
                                           Value object,
                                           Resource context)

      Deprecated.
      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`
      Overrides:
        `createStatement` in class `AbstractValueFactory`
      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.

    - #### createTriple

          public Triple createTriple(Resource subject,
                                     IRI predicate,
                                     Value object)

      Deprecated.
      Description copied from interface: `ValueFactory`
      Creates a new RDF* triple with the supplied subject, predicate and object.
      Specified by:
        `createTriple` in interface `ValueFactory`
      Overrides:
        `createTriple` in class `AbstractValueFactory`
      Parameters:
        `subject` - The statement's subject.
        `predicate` - The statement's predicate.
        `object` - The statement's object.
      Returns:
        The created triple.

    - #### initBNodeParams

          protected void initBNodeParams()

      Deprecated.
      Generates a new bnode prefix and resets `nextBNodeID` to `1` .

    - #### createBNode

          public BNode createBNode()

      Deprecated.
      Description copied from interface: `ValueFactory`
      Creates a new bNode.
      Specified by:
        `createBNode` in interface `ValueFactory`
      Overrides:
        `createBNode` in class `AbstractValueFactory`
      Returns:
        An object representing the bNode.

    - #### createLiteral

          public Literal createLiteral(byte value)

      Deprecated.
      Calls `createIntegerLiteral(Number, IRI)` with the supplied value and `XSD.BYTE` as parameters.
      Specified by:
        `createLiteral` in interface `ValueFactory`
      Overrides:
        `createLiteral` in class `AbstractValueFactory`
      Parameters:
        `value` - The value for the literal.
      Returns:
        An `xsd:byte`-typed literal for the specified value.

    - #### createLiteral

          public Literal createLiteral(short value)

      Deprecated.
      Calls `createIntegerLiteral(Number, IRI)` with the supplied value and `XSD.SHORT` as parameters.
      Specified by:
        `createLiteral` in interface `ValueFactory`
      Overrides:
        `createLiteral` in class `AbstractValueFactory`
      Parameters:
        `value` - The value for the literal.
      Returns:
        An `xsd:short`-typed literal for the specified value.

    - #### createLiteral

          public Literal createLiteral(int value)

      Deprecated.
      Calls `createIntegerLiteral(Number, IRI)` with the supplied value and `XSD.INT` as parameters.
      Specified by:
        `createLiteral` in interface `ValueFactory`
      Overrides:
        `createLiteral` in class `AbstractValueFactory`
      Parameters:
        `value` - The value for the literal.
      Returns:
        An `xsd:int`-typed literal for the specified value.

    - #### createLiteral

          public Literal createLiteral(long value)

      Deprecated.
      Calls `createIntegerLiteral(Number, IRI)` with the supplied value and `XSD.LONG` as parameters.
      Specified by:
        `createLiteral` in interface `ValueFactory`
      Overrides:
        `createLiteral` in class `AbstractValueFactory`
      Parameters:
        `value` - The value for the literal.
      Returns:
        An `xsd:long`-typed literal for the specified value.

    - #### createIntegerLiteral

          protected Literal createIntegerLiteral(Number value,
                                                 IRI datatype)

      Deprecated.
      Calls `createNumericLiteral(Number, IRI)` with the supplied value and datatype as parameters.

    - #### createIntegerLiteral

          protected Literal createIntegerLiteral(Number value,
                                                 XSD.Datatype datatype)

      Deprecated.

    - #### createLiteral

          public Literal createLiteral(float value)

      Deprecated.
      Calls `createFPLiteral(Number, IRI)` with the supplied value and `XSD.FLOAT` as parameters.
      Specified by:
        `createLiteral` in interface `ValueFactory`
      Overrides:
        `createLiteral` in class `AbstractValueFactory`
      Parameters:
        `value` - The value for the literal.
      Returns:
        An `xsd:float`-typed literal for the specified value.

    - #### createLiteral

          public Literal createLiteral(double value)

      Deprecated.
      Calls `createFPLiteral(Number, IRI)` with the supplied value and `XSD.DOUBLE` as parameters.
      Specified by:
        `createLiteral` in interface `ValueFactory`
      Overrides:
        `createLiteral` in class `AbstractValueFactory`
      Parameters:
        `value` - The value for the literal.
      Returns:
        An `xsd:double`-typed literal for the specified value.

    - #### createLiteral

          public Literal createLiteral(BigInteger bigInteger)

      Deprecated.
      Description copied from interface: `ValueFactory`
      Creates a new literal representing the specified bigInteger that is typed as an `xsd:Integer`.
      Specified by:
        `createLiteral` in interface `ValueFactory`
      Overrides:
        `createLiteral` in class `AbstractValueFactory`

    - #### createLiteral

          public Literal createLiteral(BigDecimal bigDecimal)

      Deprecated.
      Description copied from interface: `ValueFactory`
      Creates a new literal representing the specified bigDecimal that is typed as an `xsd:Decimal`.
      Specified by:
        `createLiteral` in interface `ValueFactory`
      Overrides:
        `createLiteral` in class `AbstractValueFactory`

    - #### createFPLiteral

          protected Literal createFPLiteral(Number value,
                                            IRI datatype)

      Deprecated.
      Calls `createNumericLiteral(Number, IRI)` with the supplied value and datatype as parameters.

    - #### createFPLiteral

          protected Literal createFPLiteral(Number value,
                                            XSD.Datatype datatype)

      Deprecated.

    - #### createNumericLiteral

          protected Literal createNumericLiteral(Number number,
                                                 IRI datatype)

      Deprecated.
      Creates specific optimized subtypes of SimpleLiteral for numeric datatypes.

    - #### createNumericLiteral

          protected Literal createNumericLiteral(Number number,
                                                 XSD.Datatype datatype)

      Deprecated.

    - #### createLiteral

          public Literal createLiteral(XMLGregorianCalendar calendar)

      Deprecated.
      Calls `ValueFactory.createLiteral(String, IRI)` with the String-value of the supplied calendar and the appropriate datatype as parameters.
      Specified by:
        `createLiteral` in interface `ValueFactory`
      Overrides:
        `createLiteral` in class `AbstractValueFactory`
      Parameters:
        `calendar` - The value for the literal.
      Returns:
        A typed literal for the specified calendar.
      See Also:
        `XMLGregorianCalendar.toXMLFormat()`, `XMLGregorianCalendar.getXMLSchemaType()`, `XMLDatatypeUtil.qnameToURI(javax.xml.namespace.QName)`

    - #### createLiteral

          public Literal createLiteral(Date date)

      Deprecated.
      Converts the supplied `Date` to a `XMLGregorianCalendar`, then calls `ValueFactory.createLiteral(XMLGregorianCalendar)`.
      Specified by:
        `createLiteral` in interface `ValueFactory`
      Overrides:
        `createLiteral` in class `AbstractValueFactory`

Copyright © 2015-2021 Eclipse Foundation. All Rights Reserved.