01: /*
02: * Copyright 2005-2006 The Kuali Foundation.
03: *
04: *
05: * Licensed under the Educational Community License, Version 1.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.opensource.org/licenses/ecl1.php
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package edu.iu.uis.eden.engine.node.var;
18:
19: import java.util.Arrays;
20: import java.util.Collection;
21: import java.util.Collections;
22:
23: import edu.iu.uis.eden.engine.RouteContext;
24: import edu.iu.uis.eden.engine.node.var.schemes.LiteralScheme;
25: import edu.iu.uis.eden.engine.node.var.schemes.ResourceScheme;
26: import edu.iu.uis.eden.engine.node.var.schemes.URLScheme;
27: import edu.iu.uis.eden.engine.node.var.schemes.VariableScheme;
28: import edu.iu.uis.eden.engine.node.var.schemes.XPathScheme;
29:
30: /**
31: * Interface representing an implementation that can resolve Property objects to
32: * values.
33: *
34: * @author Aaron Hamid (arh14 at cornell dot edu)
35: */
36: public interface PropertyScheme {
37: public static final PropertyScheme VARIABLE_SCHEME = new VariableScheme();
38: public static final PropertyScheme LITERAL_SCHEME = new LiteralScheme();
39: public static final PropertyScheme RESOURCE_SCHEME = new ResourceScheme();
40: public static final PropertyScheme URL_SCHEME = new URLScheme();
41: public static final PropertyScheme XPATH_SCHEME = new XPathScheme();
42:
43: /**
44: * Collection/enumeration of PropertyScheme types
45: */
46: /* interfaces can't have static initializers */
47: public static final Collection SCHEMES = Collections
48: .unmodifiableCollection(Arrays.asList(new PropertyScheme[] {
49: VARIABLE_SCHEME, LITERAL_SCHEME, RESOURCE_SCHEME,
50: URL_SCHEME, XPATH_SCHEME }));
51:
52: /**
53: * Scheme name
54: * @return scheme name
55: */
56: public String getName();
57:
58: /**
59: * Short scheme name
60: * @return short scheme name
61: */
62: public String getShortName();
63:
64: /**
65: * Loads/resolves a Property
66: * @param property the property to resolve
67: * @param context the current RouteContext
68: * @return the loaded/resolved value
69: */
70: public Object load(Property property, RouteContext context);
71: }
|