|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdsto.dfc.databeans.io.XmlLinkCodec
public class XmlLinkCodec
XML codec for the standard IDataObjectLink implementations: DataObjectLink and DataBeanLink. todo merge support for weak links in here.
Constructor Summary | |
---|---|
XmlLinkCodec()
|
Method Summary | |
---|---|
boolean |
canEncode(XmlEncodeContext context,
Object value)
Test if this codec can encode a given object. |
Object |
decode(XmlDecodeContext context,
org.jdom.Element element)
Decode an XML representation into a value. |
org.jdom.Element |
encode(XmlEncodeContext context,
Object value)
Generate an XML representation of an object. |
void |
idForObjectCallback(XmlEncodeContext context,
org.jdom.Element element,
String id,
Object extraData)
Called by encode context when an ID becomes available for a given object. |
void |
objectForIdCallback(XmlDecodeContext context,
org.jdom.Element element,
Object object,
Object extraData)
Called by decode context when an value becomes available for a given ID . |
boolean |
shouldPreserveIdentity(XmlEncodeContext context,
Object value)
Return true if the identity of the given value should be preserved. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlLinkCodec()
Method Detail |
---|
public boolean shouldPreserveIdentity(XmlEncodeContext context, Object value)
XmlEncoder
shouldPreserveIdentity
in interface XmlEncoder
public boolean canEncode(XmlEncodeContext context, Object value)
XmlEncoder
canEncode
in interface XmlEncoder
context
- The current encode context.value
- The value. May be null.
public org.jdom.Element encode(XmlEncodeContext context, Object value)
XmlEncoder
encode
in interface XmlEncoder
context
- The encoding context.value
- The value to be encoded.
public Object decode(XmlDecodeContext context, org.jdom.Element element) throws IllegalArgumentException, ClassNotFoundException
XmlDecoder
decode
in interface XmlDecoder
context
- The decode context.element
- The element to decode.
IllegalArgumentException
- if an error is found in the structure
of the document.
ClassNotFoundException
- if a referenced class cannot be found.public void idForObjectCallback(XmlEncodeContext context, org.jdom.Element element, String id, Object extraData)
XmlEncodeContext.IdCallback
XmlEncodeContext.callbackWithIdForObject(IdCallback, Element, Object, Object)
.
idForObjectCallback
in interface XmlEncodeContext.IdCallback
context
- The current encoding context.element
- The element passed to callbackWithIdForObject ().id
- The ID for the requested value.extraData
- The extraData passed to callbackWithIdForObject ().public void objectForIdCallback(XmlDecodeContext context, org.jdom.Element element, Object object, Object extraData)
XmlDecodeContext.IdCallback
XmlDecodeContext.callbackWithObjectForId(IdCallback, Element, String, Object)
.
objectForIdCallback
in interface XmlDecodeContext.IdCallback
context
- The current decode context.element
- The element param passed to callbackWithObjectForId ().object
- The object that is registered with the requested ID.extraData
- The extra data param passed to callbackWithObjectForId ().
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |