Class LiteralLabelFactory

java.lang.Object
org.apache.jena.graph.impl.LiteralLabelFactory

public class LiteralLabelFactory extends Object
This class is not in the public API.
  • Constructor Details

    • LiteralLabelFactory

      public LiteralLabelFactory()
  • Method Details

    • createString

      public static LiteralLabel createString(String lex)
      Create a string literal
    • createLang

      public static LiteralLabel createLang(String lex, String lang)
      Build a literal label from its lexical form and language tag.
      Parameters:
      lex - the lexical form of the literal
      lang - the optional language tag
    • createDirLang

      public static LiteralLabel createDirLang(String lex, String lang, TextDirection textDir)
      Build a literal label from its lexical form,language tag and initial text direction
      Parameters:
      lex - the lexical form of the literal
      lang - the optional language tag
      textDir - the optional initial text direction (lang required)
    • create

      public static LiteralLabel create(String lex, RDFDatatype dtype)
      Create a literal with a dtype.
    • createLiteralLabel

      public static LiteralLabel createLiteralLabel(String lex, String lang, TextDirection textDir, RDFDatatype dtype)
    • createByValue

      public static LiteralLabel createByValue(Object value) throws DatatypeFormatException
      Build a typed literal label from its value form. If the value is a string we assume this is intended to be a lexical form after all.
      Parameters:
      value - the value of the literal
      Throws:
      DatatypeFormatException
    • createByValue

      public static LiteralLabel createByValue(Object value, RDFDatatype dtype) throws DatatypeFormatException
      Build a typed literal label from its value form. If the value is a string we assume this is intended to be a lexical form after all.
      Parameters:
      value - the value of the literal
      dtype - the type of the literal, null for old style "plain" literals (which become xsd:string in RDF 1.1)
      Throws:
      DatatypeFormatException
    • createTypedLiteral

      public static LiteralLabel createTypedLiteral(Object value)
      Build a typed literal label from its value form using whatever datatype is currently registered as the default representation for this java class. No language tag is supplied. A Java string becomes an xsd:string.
      Parameters:
      value - the literal value to encapsulate