|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.clerezza.rdf.core.LiteralFactory
public abstract class LiteralFactory
This class provides methods to convert java objects to typed literals and
vice versa. While the default implementation will provide literal objects
storing the data's lexical form in memory, other implementations may
create literal optimized for processing within the store.
Note: this class uses the notion of "Convertor" (in the Exception naming),
but does not currently provide a mechanism to register such
Convertors. An implementation is said to provide
Convertors for the types it supports.
| Constructor Summary | |
|---|---|
LiteralFactory()
|
|
| Method Summary | ||
|---|---|---|
abstract
|
createObject(Class<T> type,
TypedLiteral literal)
Converts a literal to an instance of the specified class |
|
abstract TypedLiteral |
createTypedLiteral(Object value)
Create a typed literal for the specified object |
|
static LiteralFactory |
getInstance()
Get a LiteralFactory. |
|
static void |
setInstance(LiteralFactory instance)
Set the instance returned by getInstance. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LiteralFactory()
| Method Detail |
|---|
public static LiteralFactory getInstance()
LiteralFactory. If this has not been set using
setInstance it returns an instance of
org.apache.clerezza.model.impl.SimpleLiteralFactory.
LiteralFactorypublic static void setInstance(LiteralFactory instance)
getInstance.
instance - the new default LiteralFactory
public abstract TypedLiteral createTypedLiteral(Object value)
throws NoConvertorException
value - the value of the literal to be created
NoConvertorException - thrown if value is of an invalid type
public abstract <T> T createObject(Class<T> type,
TypedLiteral literal)
throws NoConvertorException,
InvalidLiteralTypeException
T - type - the Class of the returned objectliteral - the literal to be converted
NoConvertorException - thrown if type is unsupported
InvalidLiteralTypeException - if the literal type doesn't match the requested java type
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||