java.lang.Object | ||
↳ | org.apache.commons.betwixt.expression.Context | |
↳ | org.apache.commons.betwixt.io.read.ReadContext |
Extends Context
to provide read specific functionality.
Three stacks are used to manage the reading:
MappingAction
's
used to execute the mapping of the current element and it's ancesters back to the
document root.Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a
ReadContext with the same settings
as an existing Context . | |||||||||||
Constructs a
ReadContext with standard log. | |||||||||||
Base constructor
| |||||||||||
Constructs a
ReadContext
with the same settings as an existing Context . |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Clears the beans indexed by id.
| |||||||||||
Gets the current mapping action
| |||||||||||
Gets the strategy used to define default mappings actions
for elements.
| |||||||||||
Gets a bean from storage by an (xml) ID.
| |||||||||||
Gets the current bean.
| |||||||||||
Gets the
BeanCreationChange to be used to create beans
when an element is mapped. | |||||||||||
Gets the classloader to be used.
| |||||||||||
Gets the
ElementDescriptor that describes the
mapping for the current element. | |||||||||||
Gets the element name for the currently mapped element.
| |||||||||||
Gets the current
Updater . | |||||||||||
Gets the Class that was last mapped, if there is one.
| |||||||||||
Gets the
XMLIntrospector to be used to create
the mappings for the xml. | |||||||||||
Marks the element name stack with a class mapping.
| |||||||||||
Pops the last mapping
Object from the
stack containing beans that have been mapped. | |||||||||||
Pops the top element from the element mapping stack.
| |||||||||||
Pops an action mapping from the stack
| |||||||||||
Pops the top
Updater from the stack. | |||||||||||
Populates the object mapped by the
AttributeDescriptor s
with the values in the given Attributes . | |||||||||||
Pushs a newly mapped
Object onto the mapped bean stack. | |||||||||||
Pushes the given element onto the element mapping stack.
| |||||||||||
Pushs an action mapping onto the stack
| |||||||||||
Pushes an | |||||||||||
Puts a bean into storage indexed by an (xml) ID.
| |||||||||||
Resolves any polymorphism in the element mapping.
| |||||||||||
Set the current bean.
| |||||||||||
Sets the classloader to be used.
| |||||||||||
Sets the
XMLIntrospector to be used to create
the mappings for the xml. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.commons.betwixt.expression.Context
| |||||||||||
From class
java.lang.Object
|
Constructs a ReadContext
with the same settings
as an existing Context
.
context | not null |
---|---|
readConfiguration | not null |
Constructs a ReadContext
with standard log.
bindingConfiguration | the dynamic configuration, not null |
---|---|
readConfiguration | the extra read configuration not null |
Base constructor
log | log to this Log |
---|---|
bindingConfiguration | the dynamic configuration, not null |
readConfiguration | the extra read configuration not null |
Constructs a ReadContext
with the same settings as an existing Context
.
readContext | not null |
---|
Clears the beans indexed by id.
Gets the strategy used to define default mappings actions for elements.
ActionMappingStrategy
. not null
Gets a bean from storage by an (xml) ID.
id | the ID string of the xml element associated with the bean |
---|
Gets the current bean.
Gets the BeanCreationChange
to be used to create beans
when an element is mapped.
Gets the classloader to be used.
Gets the ElementDescriptor
that describes the
mapping for the current element.
ElementDescriptor
or null if there is no
current mappingException |
---|
Gets the element name for the currently mapped element.
Gets the current Updater
.
This may (or may not) be the updater for the current
descriptor.
If the current descriptor is a bean child,
the the current updater will (most likely)
be the updater for the property.
Actions (that, for example, use proxy objects)
may push updaters onto the stack.
Gets the Class that was last mapped, if there is one.
Gets the XMLIntrospector
to be used to create
the mappings for the xml.
XMLIntrospector
, not null
Marks the element name stack with a class mapping. Relative paths and last mapped class are calculated using these marks.
mappedClazz | the Class which has been mapped at the current path, not null |
---|
IntrospectionException |
---|
Pops the last mapping Object
from the
stack containing beans that have been mapped.
Pops the top element from the element mapping stack. Also removes any mapped class marks below the top element.
Pops an action mapping from the stack
MappingAction
, not null
Pops the top Updater
from the stack.
NoteAny action pushing an Updater
onto
the stack should take responsibility for popping
the updater from the stack at an appropriate time.
Updater
, possibly null
Populates the object mapped by the AttributeDescriptor
s
with the values in the given Attributes
.
attributeDescriptors | AttributeDescriptor s, not null |
---|---|
attributes | Attributes , not null
|
Pushes the given element onto the element mapping stack.
elementName | the local name if the parser is namespace aware, otherwise the full element name. Not null |
---|
Exception |
---|
Pushes an Updater
onto the stack.
NoteAny action pushing an Updater
onto
the stack should take responsibility for popping
the updater from the stack at an appropriate time.
Usage: this may be used by actions which require a temporary object to be updated. Pushing an updater onto the stack allow actions downstream to transparently update the temporary proxy.
updater | Updater, possibly null |
---|
Puts a bean into storage indexed by an (xml) ID.
id | the ID string of the xml element associated with the bean |
---|---|
bean | the Object to store, not null |
Resolves any polymorphism in the element mapping.
mapping | ElementMapping describing the mapped element |
---|
null
if the type cannot be resolved
or if the current descriptor is not polymorphicSet the current bean.
bean | the Object against which expressions will be evaluated |
---|
Sets the classloader to be used.
classLoader | the ClassLoader to be used, possibly null |
---|
Sets the XMLIntrospector
to be used to create
the mappings for the xml.
xmlIntrospector | XMLIntrospector , not null
|
---|