|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jrdf.graph.datatype.DatatypeFactoryImpl
public class DatatypeFactoryImpl
| Constructor Summary | |
|---|---|
DatatypeFactoryImpl(Map<URI,ValueCreator> newCreatorMap)
|
|
| 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 newObject)
Create a datatyped literal from a Java class. |
DatatypeValue |
createValue(String newLexicalForm)
Create an untyped/plain datatype from the lexical form. |
DatatypeValue |
createValue(URI dataTypeURI,
String newLexicalForm)
Create a new datatype value based on a given lexical form and datatype. |
static DatatypeFactory |
getInstance()
|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DatatypeFactoryImpl(Map<URI,ValueCreator> newCreatorMap)
| Method Detail |
|---|
public static DatatypeFactory getInstance()
public boolean hasRegisteredValueCreator(URI datatypeURI)
DatatypeFactory
hasRegisteredValueCreator in interface DatatypeFactorydatatypeURI - the URI to check.
public boolean correctValueType(DatatypeValue value,
URI datatypeURI)
DatatypeFactory
correctValueType in interface DatatypeFactoryvalue - the value to check.datatypeURI - the URI to use to see if the value is the expected type.
public boolean hasClassRegistered(Class<?> aClass)
DatatypeFactory
hasClassRegistered in interface DatatypeFactoryaClass - the class to check.
public void addValueCreator(URI datatypeURI,
ValueCreator creator)
throws IllegalArgumentException
DatatypeFactory
addValueCreator in interface DatatypeFactorydatatypeURI - unique datatype uri.creator - creates datatypes based on string.
IllegalArgumentException - if datatype uri already registered with another creator.
public void addValueCreator(URI datatypeURI,
Class<?> aClass,
ValueCreator creator)
DatatypeFactory
addValueCreator in interface DatatypeFactorydatatypeURI - unique datatype uri.aClass - the Java class.creator - creates datatypes based on string.
public void addSecondaryValueCreator(Class<?> aClass,
URI datatypeURI,
ValueCreator creator)
DatatypeFactory
addSecondaryValueCreator in interface DatatypeFactoryaClass - 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.public boolean removeValueCreator(URI datatypeURI)
DatatypeFactory
removeValueCreator in interface DatatypeFactorydatatypeURI - the URI to check.
public boolean removeValueCreator(Class<?> aClass,
URI datatypeURI)
DatatypeFactory
removeValueCreator in interface DatatypeFactoryaClass - the class that's registered.datatypeURI - the URI to check.
public DatatypeValue createValue(String newLexicalForm)
DatatypeFactory
createValue in interface DatatypeFactorynewLexicalForm - lexical form to use.
public DatatypeValue createValue(Object newObject)
DatatypeFactory
createValue in interface DatatypeFactorynewObject - Java class to use.
public DatatypeValue createValue(URI dataTypeURI,
String newLexicalForm)
DatatypeFactory
createValue in interface DatatypeFactorydataTypeURI - datatype to use.newLexicalForm - lexical form to use.
public URI getObjectDatatypeURI(Object object)
DatatypeFactory
getObjectDatatypeURI in interface DatatypeFactoryobject - the object to use.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||