java.lang.Object
org.apache.jena.graph.impl.LiteralLabelFactory
This class is not in the public API.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LiteralLabelcreate(String lex, RDFDatatype dtype) Create a literal with a dtype.static LiteralLabelcreateByValue(Object value) Build a typed literal label from its value form.static LiteralLabelcreateByValue(Object value, RDFDatatype dtype) Build a typed literal label from its value form.static LiteralLabelcreateDirLang(String lex, String lang, TextDirection textDir) Build a literal label from its lexical form,language tag and base directionstatic LiteralLabelcreateIncludingValue(String lex, Object value, RDFDatatype dtype) Create a typed literal for which both the lexical form and the value form are already available.static LiteralLabelcreateLang(String lex, String lang) Build a literal label from its lexical form and language tag.static LiteralLabelcreateLiteralLabel(String lex, String lang, TextDirection textDir, RDFDatatype dtype) static LiteralLabelcreateString(String lex) Create a string literalstatic LiteralLabelcreateTypedLiteral(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.
-
Constructor Details
-
LiteralLabelFactory
public LiteralLabelFactory()
-
-
Method Details
-
createString
Create a string literal -
createLang
Build a literal label from its lexical form and language tag.- Parameters:
lex- the lexical form of the literallang- the optional language tag
-
createDirLang
Build a literal label from its lexical form,language tag and base direction- Parameters:
lex- the lexical form of the literallang- the optional language tagtextDir- the optional base direction (lang required)
-
create
Create a literal with a dtype. -
createLiteralLabel
public static LiteralLabel createLiteralLabel(String lex, String lang, TextDirection textDir, RDFDatatype dtype) -
createByValue
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 literaldtype- the type of the literal, null for old style "plain" literals (which become xsd:string in RDF 1.1)- Throws:
DatatypeFormatException
-
createIncludingValue
Create a typed literal for which both the lexical form and the value form are already available. Use with care!- Parameters:
lex- the lexical form of the literal (assumed to be well-formed for the given datatype)value- the value of the literal (assumed to be the value obtained when applying the lexical-to-value mapping of the the given datatype to the given lexical form)dtype- the datatype of the literal
-
createTypedLiteral
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
-