|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DatatypeFactory
Creates data types. Maps URIs to creators - which can take either a string or native object. For a given URI there is a signle string parser object and one or more native objects.
| Method Summary | |
|---|---|
void |
addSecondaryValueCreator(Class<?> aClass,
URI datatypeURI,
ValueCreator creator)
If you want to bind more than one Java type to a given URI use this for alternative bindings. |
void |
addValueCreator(URI datatypeURI,
Class<?> aClass,
ValueCreator creator)
Add a value create for a given URI. |
void |
addValueCreator(URI datatypeURI,
ValueCreator creator)
Add a value create for a given URI. |
boolean |
correctValueType(DatatypeValue value,
URI datatypeURI)
Allows the user to verify that the Value created is the correct type for the given URI. |
DatatypeValue |
createValue(Object object)
Create a datatyped literal from a Java class. |
DatatypeValue |
createValue(String lexicalForm)
Create an untyped/plain datatype from the lexical form. |
DatatypeValue |
createValue(URI dataTypeURI,
String lexicalForm)
Create a new datatype value based on a given lexical form and datatype. |
URI |
getObjectDatatypeURI(Object object)
Returns the URI bound to a given Java class. |
boolean |
hasClassRegistered(Class<?> aClass)
Returns true if the class is registered. |
boolean |
hasRegisteredValueCreator(URI datatypeURI)
Returns true if a value creator has been registered for a given URI. |
boolean |
removeValueCreator(Class<?> aClass,
URI datatypeURI)
Remove creator for a given class and URI. |
boolean |
removeValueCreator(URI datatypeURI)
Remove creator for a given URI. |
| Method Detail |
|---|
void addValueCreator(URI datatypeURI,
ValueCreator creator)
throws IllegalArgumentException
datatypeURI - unique datatype uri.creator - creates datatypes based on string.
IllegalArgumentException - if datatype uri already registered with another creator.
void addValueCreator(URI datatypeURI,
Class<?> aClass,
ValueCreator creator)
throws IllegalArgumentException
datatypeURI - unique datatype uri.aClass - the Java class.creator - creates datatypes based on string.
IllegalArgumentException - if datatype uri already registered with another creator.
void addSecondaryValueCreator(Class<?> aClass,
URI datatypeURI,
ValueCreator creator)
aClass - the Java class to bind to a given URI and ValueCreator.datatypeURI - the URI to bind.creator - the creator to use to convert the class to a Value.boolean hasRegisteredValueCreator(URI datatypeURI)
datatypeURI - the URI to check.
boolean removeValueCreator(URI datatypeURI)
datatypeURI - the URI to check.
boolean removeValueCreator(Class<?> aClass,
URI datatypeURI)
aClass - the class that's registered.datatypeURI - the URI to check.
DatatypeValue createValue(String lexicalForm)
lexicalForm - lexical form to use.
DatatypeValue createValue(Object object)
throws IllegalArgumentException
object - Java class to use.
IllegalArgumentException - if to creator is registered for the Java class.
DatatypeValue createValue(URI dataTypeURI,
String lexicalForm)
dataTypeURI - datatype to use.lexicalForm - lexical form to use.
URI getObjectDatatypeURI(Object object)
object - the object to use.
IllegalArgumentException - if there is no creator bound for the Java class.boolean hasClassRegistered(Class<?> aClass)
aClass - the class to check.
boolean correctValueType(DatatypeValue value,
URI datatypeURI)
value - the value to check.datatypeURI - the URI to use to see if the value is the expected type.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||