java.lang.Object | |
↳ | org.apache.commons.betwixt.expression.Context |
Known Direct Subclasses |
Context
describes the context used to evaluate
bean expressions.
This is mostly a bean together with a number of context variables.
Context variables are named objects.
In other words,
a context variable associates an object with a string.
Logging during expression evaluation is done through the logging
instance held by this class.
The object initiating the evaluation should control this logging
and so passing a Log
instance is enforced by the constructors.
Context
is a natural place to include shared evaluation code.
One of the problems that you get with object graphs is that they can be cyclic.
Xml cannot (directly) include cycles.
Therefore betwixt
needs to find and deal properly with cycles.
The algorithm used is to check the parentage of a new child.
If the child is a parent then that operation fails.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Construct context with default log
| |||||||||||
This constructor is deprecated.
0.5 use constructor which takes a BindingConfiguration
| |||||||||||
Convenience constructor sets evaluted bean and log.
| |||||||||||
Construct a cloned context.
| |||||||||||
This constructor is deprecated.
0.5 use constructor which takes a converter
| |||||||||||
Convenience constructor sets evaluted bean, context variables and log.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gets the current bean.
| |||||||||||
The name of the attribute which can be specified in the XML to override the
type of a bean used at a certain point in the schema.
| |||||||||||
Gets the strategy used to manage storage and retrieval of id's.
| |||||||||||
Gets the value of the first option with this name.
| |||||||||||
Gets the current log.
| |||||||||||
Should
ID 's and IDREF attributes
be used to cross-reference matching objects? | |||||||||||
Gets object <-> string converter.
| |||||||||||
Gets the current
Options . | |||||||||||
Gets the
ValueSuppressionStrategy . | |||||||||||
Gets the value of a particular context variable.
| |||||||||||
Gets context variables.
| |||||||||||
Returns a new child context with the given bean but the same log and variables.
| |||||||||||
Pops the current options from the stack. | |||||||||||
Pushes the given | |||||||||||
Set the current bean.
| |||||||||||
Sets the name of the attribute which can be specified in
the XML to override the type of a bean used at a certain
point in the schema.
| |||||||||||
Set the log implementation to which this class logs
| |||||||||||
Sets the
ValueSuppressionStrategy . | |||||||||||
Sets the value of a particular context variable.
| |||||||||||
Sets context variables.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Construct context with default log
This constructor is deprecated.
0.5 use constructor which takes a BindingConfiguration
Convenience constructor sets evaluted bean and log.
bean | evaluate expressions against this bean |
---|---|
log | log to this logger |
Convenience constructor sets evaluted bean and log.
bean | evaluate expressions against this bean |
---|---|
log | log to this logger |
bindingConfiguration | not null |
Construct a cloned context. The constructed context should share bean, variables, log and binding configuration.
context | duplicate the attributes of this bean |
---|
This constructor is deprecated.
0.5 use constructor which takes a converter
Convenience constructor sets evaluted bean, context variables and log.
bean | evaluate expressions against this bean |
---|---|
variables | context variables |
log | log to this logger |
Convenience constructor sets evaluted bean, context variables and log.
bean | evaluate expressions against this bean |
---|---|
variables | context variables |
log | log to this logger |
bindingConfiguration | not null |
Gets the current bean.
The name of the attribute which can be specified in the XML to override the type of a bean used at a certain point in the schema.
The default value is 'className'.
Gets the strategy used to manage storage and retrieval of id's.
Gets the value of the first option with this name. The stack of inherited options is search (starting from the current option) until an option with a non-null value for the named option is found.
name | the name of the option to be found |
---|
Gets the current log.
Should ID
's and IDREF
attributes
be used to cross-reference matching objects?
ID
and IDREF
attributes should be used to cross-reference instancesGets object <-> string converter.
Gets the current Options
.
Options
that currently apply
or null if there are no current options.Gets the ValueSuppressionStrategy
.
This is used to control the expression of attributes with certain values.
ValueSuppressionStrategy
, not null
Gets the value of a particular context variable.
name | the name of the variable whose value is to be returned |
---|
Gets context variables.
Returns a new child context with the given bean but the same log and variables.
newBean | create a child context for this bean |
---|
Pops the current options from the stack. The previously current options (if any exist) will be reinstated by this method.
popOptions()
.
Pushes the given Options
onto the stack.
Note that code calling push should ensure that popOptions()
is called once the options are no longer current.
This ensures that the previous options are reinstated.
options | newly current Options , not null
|
---|
Set the current bean.
bean | the Object against which expressions will be evaluated |
---|
Sets the name of the attribute which can be specified in the XML to override the type of a bean used at a certain point in the schema.
The default value is 'className'.
classNameAttribute | The name of the attribute used to overload the class name of a bean |
---|
Set the log implementation to which this class logs
log | the implemetation that this class should log to |
---|
Sets the ValueSuppressionStrategy
.
This is used to control the expression of attributes with certain values.
valueSuppressionStrategy | ValueSuppressionStrategy , not null
|
---|
Sets the value of a particular context variable.
name | the name of the variable |
---|---|
value | the value of the variable |
Sets context variables.
variables | map containing variable values indexed by varibable name Strings |
---|