|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.thoughtworks.xstream.converters.collections.AbstractCollectionConverter
org.jupe.editors.classdiagram.model.serializer.ModelElementConverter
public class ModelElementConverter
Converter that will hook up in the XStream structure to ensure proper translation of the core of ModelElements. Other converters should inherit this behaivior and add to it the specifics of each type of element (e.g. ConnectionElements, NodeModelElements). One should refer to the XStream documentation on Collection Converters for a more in-depth description of the serialization protocol, but in short it consists of calls to writeItem() while marshalling and calls of the sequence writer.moveDown();readItem();writer.moveUp() while reading.
Constructor Summary | |
---|---|
ModelElementConverter(com.thoughtworks.xstream.alias.ClassMapper arg0,
java.lang.String arg1,
JupeProject project)
Constructor. |
Method Summary | |
---|---|
boolean |
canConvert(java.lang.Class arg0)
Returns true if argument is a equal to (or subclass of) ModelElement and it`s neither a ConnnectionElemnt nor a NodeModelElement. |
void |
marshal(java.lang.Object source,
com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
com.thoughtworks.xstream.converters.MarshallingContext context)
Converts a ModelElement object to XML form. |
java.lang.Object |
unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
com.thoughtworks.xstream.converters.UnmarshallingContext context)
Converts a ModelElement from XML to object form. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ModelElementConverter(com.thoughtworks.xstream.alias.ClassMapper arg0, java.lang.String arg1, JupeProject project)
arg0
- ClassMapper provided by XStream instanceMethod Detail |
---|
public boolean canConvert(java.lang.Class arg0)
canConvert
in interface com.thoughtworks.xstream.converters.Converter
canConvert
in class com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter
public void marshal(java.lang.Object source, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context)
marshal
in interface com.thoughtworks.xstream.converters.Converter
marshal
in class com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter
public java.lang.Object unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context)
unmarshal
in interface com.thoughtworks.xstream.converters.Converter
unmarshal
in class com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |