|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.simpleframework.xml.strategy.TreeStrategy
public class TreeStrategy
The TreeStrategy object is used to provide a simple
strategy for handling object graphs in a tree structure. This does
not resolve cycles in the object graph. This will make use of the
specified class attribute to resolve the class to use for a given
element during the deserialization process. For the serialization
process the "class" attribute will be added to the element specified.
If there is a need to use an attribute name other than "class" then
the name of the attribute to use can be specified.
CycleStrategy| Constructor Summary | |
|---|---|
TreeStrategy()
Constructor for the TreeStrategy object. |
|
TreeStrategy(java.lang.String label,
java.lang.String length)
Constructor for the TreeStrategy object. |
|
| Method Summary | |
|---|---|
Value |
read(Type type,
NodeMap node,
java.util.Map map)
This is used to resolve and load a class for the given element. |
boolean |
write(Type type,
java.lang.Object value,
NodeMap node,
java.util.Map map)
This is used to attach a attribute to the provided element that is used to identify the class. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TreeStrategy()
TreeStrategy object. This
is used to create a strategy that can resolve and load class
objects for deserialization using a "class" attribute. Also
for serialization this will add the appropriate "class" value.
public TreeStrategy(java.lang.String label,
java.lang.String length)
TreeStrategy object. This
is used to create a strategy that can resolve and load class
objects for deserialization using the specified attribute.
The attribute value can be any legal XML attribute name.
label - this is the name of the attribute to uselength - this is used to determine the array length| Method Detail |
|---|
public Value read(Type type,
NodeMap node,
java.util.Map map)
throws java.lang.Exception
read in interface Strategytype - this is the type of the XML element expectednode - this is the element used to resolve an overridemap - this is used to maintain contextual information
java.lang.Exception - thrown if the class cannot be resolved
public boolean write(Type type,
java.lang.Object value,
NodeMap node,
java.util.Map map)
write in interface Strategytype - this is the declared class for the field usedvalue - this is the instance variable being serializednode - this is the element used to represent the valuemap - this is used to maintain contextual information
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||