- All Known Implementing Classes:
Runtime
,RuntimeModel
,RuntimeModel
,RuntimeModel
public interface RuntimeModel
A
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.
- Author:
- Ole Kniemeyer
-
Method Summary
Modifier and TypeMethodDescriptionReturns the graph that shall be used in the context of the current thread.void
initialize
(String params) Initializes this model.boolean
Determines ifvalue
represents a valid node for this run-time model.boolean
isWrapperFor
(Object object, Type<?> type) Tests if the object is a wrapper for values of the given type.boolean
unwrapBoolean
(Object wrapper) Extracts the boolean value of a wrapper.byte
unwrapByte
(Object wrapper) Extracts the byte value of a wrapper.char
unwrapChar
(Object wrapper) Extracts the char value of a wrapper.double
unwrapDouble
(Object wrapper) Extracts the double value of a wrapper.float
unwrapFloat
(Object wrapper) Extracts the float value of a wrapper.int
Extracts the int value of a wrapper.long
unwrapLong
(Object wrapper) Extracts the long value of a wrapper.unwrapObject
(Object wrapper) Extracts the Object value of a wrapper.short
unwrapShort
(Object wrapper) Extracts the short value of a wrapper.
-
Method Details
-
initialize
Initializes this model. This method is invoked byRuntimeModelFactory.modelForName(java.lang.String, java.lang.ClassLoader)
after a newRuntimeModel
instance has been created. The format ofparams
depends on implementations ofRuntimeModel
.- Parameters:
params
- initialization parameters, possiblynull
-
currentGraph
Graph currentGraph()Returns the graph that shall be used in the context of the current thread. This is needed by graph-related XL statements which do not explicitly specify the graph to use.- Returns:
- the current graph for this model
-
isWrapperFor
Tests if the object is a wrapper for values of the given type.- Parameters:
object
- the potential wrapper to be testedtype
- the value type- Returns:
true
iffobject
is a wrapper for values of typetype
-
isNode
Determines ifvalue
represents a valid node for this run-time model.- Parameters:
value
- the value to be tested- Returns:
true
iff the value represents a node
-
unwrapBoolean
Extracts the boolean value of a wrapper.- Parameters:
wrapper
- the wrapper- Returns:
- the wrapped value of the wrapper
-
unwrapByte
Extracts the byte value of a wrapper.- Parameters:
wrapper
- the wrapper- Returns:
- the wrapped value of the wrapper
-
unwrapShort
Extracts the short value of a wrapper.- Parameters:
wrapper
- the wrapper- Returns:
- the wrapped value of the wrapper
-
unwrapChar
Extracts the char value of a wrapper.- Parameters:
wrapper
- the wrapper- Returns:
- the wrapped value of the wrapper
-
unwrapInt
Extracts the int value of a wrapper.- Parameters:
wrapper
- the wrapper- Returns:
- the wrapped value of the wrapper
-
unwrapLong
Extracts the long value of a wrapper.- Parameters:
wrapper
- the wrapper- Returns:
- the wrapped value of the wrapper
-
unwrapFloat
Extracts the float value of a wrapper.- Parameters:
wrapper
- the wrapper- Returns:
- the wrapped value of the wrapper
-
unwrapDouble
Extracts the double value of a wrapper.- Parameters:
wrapper
- the wrapper- Returns:
- the wrapped value of the wrapper
-
unwrapObject
Extracts the Object value of a wrapper.- Parameters:
wrapper
- the wrapper- Returns:
- the wrapped value of the wrapper
-