public class ObjectWrapper extends Object
toString() method uses XStream to serialise the
ObjectWrapper as XML; while the ObjectWrapper(String) constructor
performs the reverse, parsing the previously saved XML and re-creating the
wrapped value.| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
log |
protected Object |
value
The value being wrapped.
|
| Constructor and Description |
|---|
ObjectWrapper(Object value)
Wraps an arbitrary value, which must be serialisable by XStream.
|
ObjectWrapper(String xmlSerialisation)
De-serialises an
ObjectWrapper instance from a string previously
obtained by calling toString(). |
| Modifier and Type | Method and Description |
|---|---|
Object |
getValue()
Gets the wrapped value.
|
String |
toString()
Produces an XML serialisation of this
ObjectWrapper instance, that
can be deserialised by using the ObjectWrapper(String) constructor. |
protected Object value
protected static final org.slf4j.Logger log
public ObjectWrapper(Object value)
value - any of any class that can be XML-serialised by XStream.public ObjectWrapper(String xmlSerialisation)
ObjectWrapper instance from a string previously
obtained by calling toString().xmlSerialisation - the XML string representing the saved
ObjectWrapper instance.public String toString()
ObjectWrapper instance, that
can be deserialised by using the ObjectWrapper(String) constructor.toString in class ObjectObject.toString()public Object getValue()
Copyright © 2024 GATE. All rights reserved.