01: /**
02: * MVEL (The MVFLEX Expression Language)
03: *
04: * Copyright (C) 2007 Christopher Brock, MVFLEX/Valhalla Project and the Codehaus
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: *
18: */package org.mvel.integration;
19:
20: /**
21: * A variable resolver is responsible for physically accessing a variable, for either read or write. VariableResolver's
22: * are obtained via a {@link org.mvel.integration.VariableResolverFactory}.
23: */
24: public interface VariableResolver {
25: /**
26: * Returns the name of external variable.
27: *
28: * @return A string representing the variable name.
29: */
30: public String getName();
31:
32: /**
33: * This should return the type of the variable. However, this is not completely necessary, and is particularily
34: * only of benefit to systems that require use of MVEL's strict typing facilities. In most cases, this implementation
35: * can simply return: Object.class
36: *
37: * @return A Class instance representing the type of the target variable.
38: */
39: public Class getType();
40:
41: /*
42: * If this is a declared variable of a static type, MVEL will make it known by passing the type here.
43: */
44: public void setStaticType(Class type);
45:
46: /**
47: * Returns the bitset of special variable flags. Internal use only. This should just return 0 in custom
48: * implentations.
49: *
50: * @return Bitset of special flags.
51: */
52: public int getFlags();
53:
54: /**
55: * Returns the physical target value of the variable.
56: *
57: * @return The actual variable value.
58: */
59: public Object getValue();
60:
61: /**
62: * Sets the value of the physical target value.
63: *
64: * @param value The new value.
65: */
66: public void setValue(Object value);
67: }
|