| java.lang.Object org.apache.commons.betwixt.expression.Context org.apache.commons.betwixt.io.read.ReadContext
ReadContext | public class ReadContext extends Context (Code) | | Extends Context to provide read specific functionality.
Three stacks are used to manage the reading:
- Action mapping stack contains the
MappingAction 's
used to execute the mapping of the current element and it's ancesters back to the
document root.
- Result stack contains the objects which are bound
to the current element and to each of it's ancester's back to the root
- Element mapping stack records the names of the element
and the classes to which they are bound
author: Robert Burrell Donkina since: 0.5 |
ReadContext | public ReadContext(Context context, ReadConfiguration readConfiguration)(Code) | | Constructs a ReadContext with the same settings
as an existing Context .
Parameters: context - not null Parameters: readConfiguration - not null |
ReadContext | public ReadContext(BindingConfiguration bindingConfiguration, ReadConfiguration readConfiguration)(Code) | | Constructs a ReadContext with standard log.
Parameters: bindingConfiguration - the dynamic configuration, not null Parameters: readConfiguration - the extra read configuration not null |
ReadContext | public ReadContext(Log log, BindingConfiguration bindingConfiguration, ReadConfiguration readConfiguration)(Code) | | Base constructor
Parameters: log - log to this Log Parameters: bindingConfiguration - the dynamic configuration, not null Parameters: readConfiguration - the extra read configuration not null |
ReadContext | public ReadContext(ReadContext readContext)(Code) | | Constructs a ReadContext
with the same settings as an existing Context .
Parameters: readContext - not null |
clearBeans | public void clearBeans()(Code) | | Clears the beans indexed by id.
|
currentMappingAction | public MappingAction currentMappingAction()(Code) | | Gets the current mapping action
MappingAction |
getActionMappingStrategy | public ActionMappingStrategy getActionMappingStrategy()(Code) | | Gets the strategy used to define default mappings actions
for elements.
ActionMappingStrategy . not null |
getBean | public Object getBean(String id)(Code) | | Gets a bean from storage by an (xml) ID.
Parameters: id - the ID string of the xml element associated with the bean the Object that the ID references, otherwise null |
getBeanCreationChain | public BeanCreationChain getBeanCreationChain()(Code) | | Gets the BeanCreationChange to be used to create beans
when an element is mapped.
the BeanCreationChain not null |
getClassLoader | public ClassLoader getClassLoader()(Code) | | Gets the classloader to be used.
the classloader that should be used to load all classes, possibly null |
getCurrentDescriptor | public ElementDescriptor getCurrentDescriptor() throws Exception(Code) | | Gets the ElementDescriptor that describes the
mapping for the current element.
ElementDescriptor or null if there is nocurrent mapping throws: Exception - |
getCurrentElement | public String getCurrentElement()(Code) | | Gets the element name for the currently mapped element.
the name of the currently mapped element, or null if there has been no element mapped |
getCurrentUpdater | public Updater getCurrentUpdater()(Code) | | 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.
Updater, possibly null |
getLastMappedClass | public Class getLastMappedClass()(Code) | | Gets the Class that was last mapped, if there is one.
the Class last marked as mapped or null if no class has been mapped |
getXMLIntrospector | public XMLIntrospector getXMLIntrospector()(Code) | | Gets the XMLIntrospector to be used to create
the mappings for the xml.
XMLIntrospector , not null |
markClassMap | public void markClassMap(Class mappedClazz) throws IntrospectionException(Code) | | Marks the element name stack with a class mapping.
Relative paths and last mapped class are calculated using these marks.
Parameters: mappedClazz - the Class which has been mapped at the current path, not null |
popBean | public Object popBean()(Code) | | Pops the last mapping Object from the
stack containing beans that have been mapped.
the last bean pushed onto the stack |
popElement | public String popElement()(Code) | | Pops the top element from the element mapping stack.
Also removes any mapped class marks below the top element.
the name of the element popped if there are any more elements on the stack, otherwise null.This is the local name if the parser is namespace aware, otherwise the name |
popMappingAction | public MappingAction popMappingAction()(Code) | | Pops an action mapping from the stack
MappingAction , not null |
popUpdater | public Updater popUpdater()(Code) | | 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 |
populateAttributes | public void populateAttributes(AttributeDescriptor[] attributeDescriptors, Attributes attributes)(Code) | | Populates the object mapped by the AttributeDescriptor s
with the values in the given Attributes .
Parameters: attributeDescriptors - AttributeDescriptor s, not null Parameters: attributes - Attributes , not null |
pushBean | public void pushBean(Object bean)(Code) | | Pushs a newly mapped Object onto the mapped bean stack.
Parameters: bean - |
pushElement | public void pushElement(String elementName) throws Exception(Code) | | Pushes the given element onto the element mapping stack.
Parameters: elementName - the local name if the parser is namespace aware,otherwise the full element name. Not null |
pushMappingAction | public void pushMappingAction(MappingAction mappingAction)(Code) | | Pushs an action mapping onto the stack
Parameters: mappingAction - |
pushUpdater | public void pushUpdater(Updater updater)(Code) | | 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.
Parameters: updater - Updater, possibly null |
putBean | public void putBean(String id, Object bean)(Code) | | Puts a bean into storage indexed by an (xml) ID.
Parameters: id - the ID string of the xml element associated with the bean Parameters: bean - the Object to store, not null |
resolvePolymorphicType | public Class resolvePolymorphicType(ElementMapping mapping)(Code) | | Resolves any polymorphism in the element mapping.
Parameters: mapping - ElementMapping describing the mapped element null if the type cannot be resolved or if the current descriptor is not polymorphic since: 0.8 |
setClassLoader | public void setClassLoader(ClassLoader classLoader)(Code) | | Sets the classloader to be used.
Parameters: classLoader - the ClassLoader to be used, possibly null |
setRootClass | public void setRootClass(Class rootClass)(Code) | | |
setXMLIntrospector | public void setXMLIntrospector(XMLIntrospector xmlIntrospector)(Code) | | Sets the XMLIntrospector to be used to create
the mappings for the xml.
Parameters: xmlIntrospector - XMLIntrospector , not null |
|
|