|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.State
public final class UnmarshallingContext.State
State information for each element.
Field Summary | |
---|---|
java.lang.Object |
backup
Hack for making JAXBElement unmarshalling work. |
java.lang.String |
elementDefaultValue
If this element has an element default value. |
Intercepter |
intercepter
|
Loader |
loader
Loader that owns this element. |
boolean |
nil
|
UnmarshallingContext.State |
prev
UnmarshallingContext.State for the parent element
UnmarshallingContext.State objects form a doubly linked list. |
Receiver |
receiver
Once loader is completed, this receiver
receives the result. |
java.lang.Object |
target
Object being unmarshalled by this loader . |
Method Summary | |
---|---|
UnmarshallingContext |
getContext()
Gets the context. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public Loader loader
public Receiver receiver
loader
is completed, this receiver
receives the result.
public Intercepter intercepter
public java.lang.Object target
loader
.
public java.lang.Object backup
While the unmarshalling is in progress, the target
field stores the object being unmarshalled.
This makes it convenient to keep track of the unmarshalling activity in context of XML infoset, but
since there's only one UnmarshallingContext.State
per element, this mechanism only works when there's one object
per element, which breaks down when we have JAXBElement
, since the presence of JAXBElement
requires that we have two objects unmarshalled (a JAXBElement X and a value object Y bound to an XML type.)
So to make room for storing both, this backup
field is used. When we create X instance
in the above example, we set that to state.prev.target
and displace its old value to
state.prev.backup
(where Y goes to state.target
.) Upon the completion of the unmarshalling
of Y, we revert this.
While this attributes X incorrectly to its parent element, this preserves the parent/child
relationship between unmarshalled objects and UnmarshallingContext.State
parent/child relationship, and
it thereby makes Receiver
mechanism simpler.
Yes, I know this is a hack, and no, I'm not proud of it.
ElementBeanInfoImpl.IntercepterLoader#startElement(State, TagName)
,
ElementBeanInfoImpl.IntercepterLoader#intercept(State, Object)
public java.lang.String elementDefaultValue
Loader
when
Loader#childElement(State, TagName)
is called
or by a child Loader
when
Loader#startElement(State, TagName)
is called.
public final UnmarshallingContext.State prev
UnmarshallingContext.State
for the parent element
UnmarshallingContext.State
objects form a doubly linked list.
public boolean nil
Method Detail |
---|
public UnmarshallingContext getContext()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |