<deserialize>

Purpose/Function

Deserialize a bean from the given XML file.

There are two modes of usage:

  1. 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).
  2. 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

ncsa.tools.common.UserFacing

(required if deserialization is not meant to be implicit)

the empty instance to initialize from the file XML

path

java.lang.String

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

java.lang.Object

= bean, if the latter was not null; otherwise, the result of the implicit deserialization

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>
...
  • No labels