Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
PropertyScheme |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 2005-2008 The Kuali Foundation | |
3 | * | |
4 | * | |
5 | * Licensed under the Educational Community License, Version 2.0 (the "License"); | |
6 | * you may not use this file except in compliance with the License. | |
7 | * You may obtain a copy of the License at | |
8 | * | |
9 | * http://www.opensource.org/licenses/ecl2.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 org.kuali.rice.kew.engine.node.var; | |
18 | ||
19 | import java.util.Arrays; | |
20 | import java.util.Collection; | |
21 | import java.util.Collections; | |
22 | ||
23 | import org.kuali.rice.kew.engine.RouteContext; | |
24 | import org.kuali.rice.kew.engine.node.var.schemes.LiteralScheme; | |
25 | import org.kuali.rice.kew.engine.node.var.schemes.ResourceScheme; | |
26 | import org.kuali.rice.kew.engine.node.var.schemes.URLScheme; | |
27 | import org.kuali.rice.kew.engine.node.var.schemes.VariableScheme; | |
28 | import org.kuali.rice.kew.engine.node.var.schemes.XPathScheme; | |
29 | ||
30 | ||
31 | /** | |
32 | * Interface representing an implementation that can resolve Property objects to | |
33 | * values. | |
34 | * | |
35 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
36 | */ | |
37 | public interface PropertyScheme { | |
38 | public static final PropertyScheme VARIABLE_SCHEME = new VariableScheme(); | |
39 | public static final PropertyScheme LITERAL_SCHEME = new LiteralScheme(); | |
40 | public static final PropertyScheme RESOURCE_SCHEME = new ResourceScheme(); | |
41 | public static final PropertyScheme URL_SCHEME = new URLScheme(); | |
42 | public static final PropertyScheme XPATH_SCHEME = new XPathScheme(); | |
43 | ||
44 | /** | |
45 | * Collection/enumeration of PropertyScheme types | |
46 | */ | |
47 | /* interfaces can't have static initializers */ | |
48 | public static final Collection SCHEMES = Collections.unmodifiableCollection( | |
49 | Arrays. | |
50 | asList(new PropertyScheme[] { | |
51 | VARIABLE_SCHEME, | |
52 | LITERAL_SCHEME, | |
53 | RESOURCE_SCHEME, | |
54 | URL_SCHEME, | |
55 | XPATH_SCHEME})); | |
56 | ||
57 | /** | |
58 | * Scheme name | |
59 | * @return scheme name | |
60 | */ | |
61 | public String getName(); | |
62 | /** | |
63 | * Short scheme name | |
64 | * @return short scheme name | |
65 | */ | |
66 | public String getShortName(); | |
67 | /** | |
68 | * Loads/resolves a Property | |
69 | * @param property the property to resolve | |
70 | * @param context the current RouteContext | |
71 | * @return the loaded/resolved value | |
72 | */ | |
73 | public Object load(Property property, RouteContext context); | |
74 | } |