public abstract class AbstractReentrantDeserializationHandler extends AbstractDeserializationHandler
DeserializationHandler.supportsNestedElements()
and are designed to be re-entrant (do not store any state).
It stores the object and the reference ID as thread locals to support multi-threaded access.Modifier and Type | Field and Description |
---|---|
protected java.lang.ThreadLocal<java.lang.Object> |
objectTL |
protected java.lang.ThreadLocal<java.lang.Integer> |
refTL |
object, refId
Constructor and Description |
---|
AbstractReentrantDeserializationHandler() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getObject()
Returns the most recent object that this handler created.
|
int |
getRefId()
Returns the reference id that was in the start of this element, or -1 if there was none
|
protected void |
setObject(java.lang.Object value) |
void |
setRefId(int id)
Sets the ref-id that was found at the start of this element, if any.
|
clone, endObject, endSubElement, startSubElement
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
endElement, getBodyDecoder, getElementName, onBody, startElement, supportsNestedElements
protected java.lang.ThreadLocal<java.lang.Object> objectTL
protected java.lang.ThreadLocal<java.lang.Integer> refTL
public AbstractReentrantDeserializationHandler()
public java.lang.Object getObject()
DeserializationHandler
getObject
in interface DeserializationHandler
getObject
in class AbstractDeserializationHandler
protected void setObject(java.lang.Object value)
setObject
in class AbstractDeserializationHandler
public int getRefId()
DeserializationHandler
getRefId
in interface DeserializationHandler
getRefId
in class AbstractDeserializationHandler
public void setRefId(int id)
DeserializationHandler
setRefId
in interface DeserializationHandler
setRefId
in class AbstractDeserializationHandler