|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jibx.extras.CommentMapper
Custom marshaller/unmarshaller for comments to strings. When unmarshalling
this looks for a comment preceding the first element start or end tag, and if
a comment is found converts it to a java.lang.String
.
Constructor Summary | |
CommentMapper()
|
Method Summary | |
boolean |
isExtension(int index)
Check if marshaller represents an extension mapping. |
boolean |
isPresent(IUnmarshallingContext ictx)
Check if instance present in XML. |
void |
marshal(java.lang.Object obj,
IMarshallingContext ictx)
Marshal instance of handled class. |
java.lang.Object |
unmarshal(java.lang.Object obj,
IUnmarshallingContext ictx)
Unmarshal instance of handled class. |
protected void |
writeComment(java.lang.Object obj,
IXMLWriter ixw)
Write comment data to output. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CommentMapper()
Method Detail |
public boolean isExtension(int index)
IMarshaller
isExtension
in interface IMarshaller
index
- abstract mapping index to be checked
true
if this mapping is an extension of the abstract
mapping, false
if notprotected void writeComment(java.lang.Object obj, IXMLWriter ixw) throws java.io.IOException
obj
- object to be written as textixw
- XML writer for output document
java.io.IOException
- on error writing to outputpublic void marshal(java.lang.Object obj, IMarshallingContext ictx) throws JiBXException
IMarshaller
marshal
in interface IMarshaller
obj
- object to be marshalled (may be null
if property
is not optional)ictx
- XML text output context
JiBXException
- on error in marshalling processpublic boolean isPresent(IUnmarshallingContext ictx) throws JiBXException
IUnmarshaller
isPresent
in interface IUnmarshaller
ictx
- unmarshalling context
true
if expected parse data found,
false
if not
JiBXException
- on error in unmarshalling processpublic java.lang.Object unmarshal(java.lang.Object obj, IUnmarshallingContext ictx) throws JiBXException
IUnmarshaller
unmarshal
in interface IUnmarshaller
obj
- object to be unmarshalled (may be null
)ictx
- unmarshalling context
null
)
JiBXException
- on error in unmarshalling process
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |