1
2
3
4
5
6
7
8
9
10
11
12
13 package org.astrogrid.applications.parameter;
14
15 import org.astrogrid.applications.CeaException;
16 import org.astrogrid.applications.beans.v1.parameters.ParameterValue;
17 import org.astrogrid.applications.description.ParameterDescription;
18 import org.astrogrid.applications.parameter.protocol.ExternalValue;
19
20 /***
21 * Base class for {@link org.astrogrid.applications.parameter.ParameterAdapter}. It contains the necessary fileds that the adapter wraps.
22 * @author Paul Harrison (pah@jb.man.ac.uk) 27-Oct-2004
23 * @version $Name: HEAD $
24 * @since iteration6
25 */
26 public abstract class AbstractParameterAdapter implements ParameterAdapter {
27 /*** Construct a new AbstractParameterAdapter
28 * @param val the parameter value to adapt.
29 * @param description the description associated with this value.
30 * @param externalVal wrapper around the external location that contains the true value of the parameter (in case of direct parameters, is null)
31 */
32 public AbstractParameterAdapter(ParameterValue val,ParameterDescription description,ExternalValue externalVal) {
33 this.val = val;
34 this.description = description;
35 this.externalVal = externalVal;
36 }
37
38
39
40
41 public abstract Object process() throws CeaException;
42
43
44
45 public abstract void writeBack(Object o) throws CeaException ;
46 /*** the parameter value */
47 protected final ParameterValue val;
48 /*** the parameter descritpion */
49 protected final ParameterDescription description;
50 /*** indirection to the external location containing the true value of an indirect parameter */
51 protected final ExternalValue externalVal;
52
53 public ParameterValue getWrappedParameter() {
54 return val;
55 }
56
57
58
59 }