public interface ValueFactory
| Modifier and Type | Method and Description |
|---|---|
Reference |
createReference(Object value)
Creates a reference instance for the parsed value.
|
Representation |
createRepresentation(String id)
Creates an empty representation instance of with the type
SignTypeEnum#Sign
for the parsed ID. |
Text |
createText(Object value)
Creates a Text instance without an language
|
Text |
createText(String text,
String language)
Creates a Text instance for a language
|
Text createText(Object value) throws UnsupportedTypeException, IllegalArgumentException
value - The value if the text. Implementations might support special
support for specific classes. As an default the Object.toString()
method is used to get the lexical form of the text from the parsed value
and null should be used as language.UnsupportedTypeException - if the type of the parsed object is not
can not be used to create Text instancesIllegalArgumentException - If null is parsed or if the
parsed instance type is supported, but
the parsed instance can not be used to create a text instanceText createText(String text, String language) throws IllegalArgumentException
text - the textlanguage - the language or null.IllegalArgumentException - if null is parsed as text or
if the parsed parameter can not be used to create a Text instanceReference createReference(Object value) throws UnsupportedTypeException, IllegalArgumentException
Object.toString() method is used to get the unicode representation
of the reference.Implementation MUST support at least the following types:
String: The parsed string need not be be checked for a valid
IRI, URI or URL in any form. However in case of an empty String a
IllegalArgumentException MUST BE thrown)
URI: Any valid URI MUST BE accepted
URL: any valid URL MUST BE accepted
value - the unicode representation of the referenceUnsupportedTypeException - if the type of the parsed object can
not be converted to a Reference.IllegalArgumentException - if the parsed value is null
or if the parsed value can not be used to
create a valid Reference (e.g. when parsing an empty String)Representation createRepresentation(String id) throws IllegalArgumentException
SignTypeEnum#Sign
for the parsed ID. The id MUST not be null nor emptyid - The id of the representationIllegalArgumentException - if null or an empty string
is parsed as IDCopyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.