de.grogra.xl.query
public interface RuntimeModel
RuntimeModel is used by the XL run-time system
as an interface to the concrete relational data source in use.
It corresponds to a compile-time model which was used at
compile-time: The invocation of
CompiletimeModel.getRuntimeName() returns a name,
which is passed to RuntimeModelFactory.modelForName(java.lang.String, java.lang.ClassLoader) in order to
obtain the corresponding RuntimeModel.
This interface contains methods related to unwrapping
of values, for determining if a value represents a node value,
and for the retrieval of a Graph associated with this model
and the current thread. Roughly speaking, a RuntimeModel
provides a set of operations, a Graph provides the data.
A comprehensive specification of the behaviour of RuntimeModel
is given by the specification of the XL programming language.
| Modifier and Type | Method and Description |
|---|---|
Graph |
currentGraph()
Returns the graph that shall be used in the context of the
current thread.
|
void |
initialize(java.lang.String params)
Initializes this model.
|
boolean |
isNode(java.lang.Object value)
Determines if
value represents a valid node
for this run-time model. |
boolean |
isWrapperFor(java.lang.Object object,
Type<?> type)
Tests if the object is a wrapper for values of the given type.
|
boolean |
unwrapBoolean(java.lang.Object wrapper)
Extracts the boolean value of a wrapper.
|
byte |
unwrapByte(java.lang.Object wrapper)
Extracts the byte value of a wrapper.
|
char |
unwrapChar(java.lang.Object wrapper)
Extracts the char value of a wrapper.
|
double |
unwrapDouble(java.lang.Object wrapper)
Extracts the double value of a wrapper.
|
float |
unwrapFloat(java.lang.Object wrapper)
Extracts the float value of a wrapper.
|
int |
unwrapInt(java.lang.Object wrapper)
Extracts the int value of a wrapper.
|
long |
unwrapLong(java.lang.Object wrapper)
Extracts the long value of a wrapper.
|
java.lang.Object |
unwrapObject(java.lang.Object wrapper)
Extracts the Object value of a wrapper.
|
short |
unwrapShort(java.lang.Object wrapper)
Extracts the short value of a wrapper.
|
Graph currentGraph()
void initialize(java.lang.String params)
RuntimeModelFactory.modelForName(java.lang.String, java.lang.ClassLoader) after a new RuntimeModel
instance has been created. The format of params
depends on implementations of RuntimeModel.params - initialization parameters, possibly nullboolean isNode(java.lang.Object value)
value represents a valid node
for this run-time model.value - the value to be testedtrue iff the value represents a nodeboolean isWrapperFor(java.lang.Object object,
Type<?> type)
object - the potential wrapper to be testedtype - the value typetrue iff object is a wrapper for values of type typeboolean unwrapBoolean(java.lang.Object wrapper)
wrapper - the wrapperbyte unwrapByte(java.lang.Object wrapper)
wrapper - the wrapperchar unwrapChar(java.lang.Object wrapper)
wrapper - the wrapperdouble unwrapDouble(java.lang.Object wrapper)
wrapper - the wrapperfloat unwrapFloat(java.lang.Object wrapper)
wrapper - the wrapperint unwrapInt(java.lang.Object wrapper)
wrapper - the wrapperlong unwrapLong(java.lang.Object wrapper)
wrapper - the wrapperjava.lang.Object unwrapObject(java.lang.Object wrapper)
wrapper - the wrappershort unwrapShort(java.lang.Object wrapper)
wrapper - the wrapper