<deserialize>
Purpose/Function
Deserialize a bean from the given XML file.
There are two modes of usage:
- Initialize a
ncsa.tools.common.UserFacing
bean instance which has been assigned to the environment (see Assign and Declare for how to use the<new>
and<java-constructor>
tags). - Deserialize implicitly (in this case, the file must have originally been written using the
ncsa.tools.common.util.bean.ImplicitJBeanSerializer
; see<serialize>
).
NOTE that implicit deserialization may not work when running as an Eclipse plugin for the same reasons given regarding the scripted construction of arbitrary Java classes (see again Assign and Declare).
Attributes
NAME |
TYPE |
DEFAULT VALUE |
DESCRIPTION |
---|---|---|---|
bean |
|
(required if deserialization is not meant to be |
the empty instance to initialize from the file XML |
path |
|
required |
the path to the file XML |
If bean is null
, the path will be assumed to contain XML for an "implicit" bean (i.e., generated by a call to ImplicitJBeanSerializer
).
Elements
None.
ReturnValues
DEFAULT NAME |
TYPE |
DESCRIPTION |
---|---|---|
deserializedObject |
|
= bean, if the latter was not |
Examples
... <deserialize bean="${bean.instance}" path="bean.xml"> <!-- return value is redundant here: the object is already in memory --> <return-value defaultName="deserializedObject" assignedName="bean.instance"/> </deserialize> ... <deserialize path="implicit-bean.xml"> <return-value defaultName="deserializedObject" assignedName="implict.bean.instance"/> </deserialize> ...