| org.jibx.runtime.IUnmarshallingContext
All known Subclasses: org.jibx.runtime.impl.UnmarshallingContext,
IUnmarshallingContext | public interface IUnmarshallingContext (Code) | | User interface for deserializer from XML. This provides methods used to set
up and control the marshalling process, as well as access to the
unmarshalling object stack while unmarshalling.
author: Dennis M. Sosnoski |
getDocumentName | public String getDocumentName()(Code) | | Return the supplied document name.
supplied document name (null if none) |
getStackDepth | public int getStackDepth()(Code) | | Get current unmarshalling object stack depth. This allows tracking
nested calls to unmarshal one object while in the process of
unmarshalling another object. The bottom item on the stack is always the
root object being unmarshalled.
number of objects in unmarshalling stack |
getStackObject | public Object getStackObject(int depth)(Code) | | Get object from unmarshalling stack. This stack allows tracking nested
calls to unmarshal one object while in the process of unmarshalling
another object. The bottom item on the stack is always the root object
being unmarshalled.
Parameters: depth - object depth in stack to be retrieved (must be in the rangeof zero to the current depth minus one). object from unmarshalling stack |
getStackTop | public Object getStackTop()(Code) | | Get top object on unmarshalling stack. This is safe to call even when no
objects are on the stack.
object from unmarshalling stack, or null if none |
getUnmarshaller | public IUnmarshaller getUnmarshaller(int index) throws JiBXException(Code) | | Find the unmarshaller for a particular class index in the current
context.
Parameters: index - class index for unmarshalling definition unmarshalling handler for class throws: JiBXException - if unable to create unmarshaller |
isAt | public boolean isAt(String ns, String name) throws JiBXException(Code) | | Check if next tag is start of element. If not currently positioned at a
start or end tag this first advances the parse to the next start or end
tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: name - element name expected true if at start of element with supplied name,false if not throws: JiBXException - on any error (possibly wrapping other exception) |
isEnd | public boolean isEnd() throws JiBXException(Code) | | Check if next tag is an end tag. If not currently positioned at a
start or end tag this first advances the parse to the next start or
end tag.
true if at end of element, false ifat start throws: JiBXException - on any error (possibly wrapping other exception) |
isStart | public boolean isStart() throws JiBXException(Code) | | Check if next tag is a start tag. If not currently positioned at a
start or end tag this first advances the parse to the next start or
end tag.
true if at start of element, false ifat end throws: JiBXException - on any error (possibly wrapping other exception) |
pushObject | public void pushObject(Object obj)(Code) | | Push created object to unmarshalling stack. This must be called before
beginning the unmarshalling of the object. It is only called for objects
with structure, not for those converted directly to and from text.
Parameters: obj - object being unmarshalled |
reset | void reset()(Code) | | Reset unmarshalling information. This releases all references to
unmarshalled objects and prepares the context for potential reuse.
It is automatically called when input is set.
|
setDocument | void setDocument(InputStream ins, String enc) throws JiBXException(Code) | | Set document to be parsed from stream.
Parameters: ins - stream supplying document data Parameters: enc - document input encoding, or null if to bedetermined by parser throws: JiBXException - if error creating parser |
setDocument | void setDocument(Reader rdr) throws JiBXException(Code) | | Set document to be parsed from reader.
Parameters: rdr - reader supplying document data throws: JiBXException - if error creating parser |
setDocument | void setDocument(InputStream ins, String name, String enc) throws JiBXException(Code) | | Set named document to be parsed from stream.
Parameters: ins - stream supplying document data Parameters: name - document name Parameters: enc - document input encoding, or null if to bedetermined by parser throws: JiBXException - if error creating parser |
setDocument | void setDocument(Reader rdr, String name) throws JiBXException(Code) | | Set named document to be parsed from reader.
Parameters: rdr - reader supplying document data Parameters: name - document name throws: JiBXException - if error creating parser |
setUserContext | public void setUserContext(Object obj)(Code) | | Set a user context object. This context object is not used directly by
JiBX, but can be accessed by all types of user extension methods. The
context object is automatically cleared by the
IUnmarshallingContext.reset() method,
so to make use of this you need to first call the appropriate version of
the setDocument() method, then this method, and finally the
IUnmarshallingContext.unmarshalElement method.
Parameters: obj - user context object, or null if clearing existingcontext object See Also: IUnmarshallingContext.getUserContext() |
unmarshalElement | Object unmarshalElement() throws JiBXException(Code) | | Unmarshal the current element. If not currently positioned at a start
or end tag this first advances the parse to the next start or end tag.
There must be an unmarshalling defined for the current element, and this
unmarshalling is used to build an object from that element.
unmarshalled object from element throws: JiBXException - on any error (possibly wrapping other exception) |
|
|