|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.thoughtworks.xstream.converters.collections.PropertiesConverter
public class PropertiesConverter
Special converter for java.util.Properties that stores properties in a more compact form than java.util.Map.
Because all entries of a Properties instance are Strings, a single element is used for each property with two attributes; one for key and one for value.
Additionally, default properties are also serialized, if they are present.
Constructor Summary | |
---|---|
PropertiesConverter()
|
|
PropertiesConverter(boolean sort)
|
Method Summary | |
---|---|
boolean |
canConvert(java.lang.Class type)
Determines whether the converter can marshall a particular type. |
void |
marshal(java.lang.Object source,
HierarchicalStreamWriter writer,
MarshallingContext context)
Convert an object to textual data. |
java.lang.Object |
unmarshal(HierarchicalStreamReader reader,
UnmarshallingContext context)
Convert textual data back into an object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertiesConverter()
public PropertiesConverter(boolean sort)
Method Detail |
---|
public boolean canConvert(java.lang.Class type)
ConverterMatcher
canConvert
in interface ConverterMatcher
type
- the Class representing the object type to be convertedpublic void marshal(java.lang.Object source, HierarchicalStreamWriter writer, MarshallingContext context)
Converter
marshal
in interface Converter
source
- The object to be marshalled.writer
- A stream to write to.context
- A context that allows nested objects to be processed by XStream.public java.lang.Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context)
Converter
unmarshal
in interface Converter
reader
- The stream to read the text from.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |