01: /*
02: * Copyright 2005-2007 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.test.web.framework;
18:
19: /**
20: * Represents a property that can be accessed relative to a specific "scheme"
21: */
22: public final class Property {
23: /**
24: * The property scheme (e.g. var:, url:, file:
25: */
26: public String scheme;
27: /**
28: * The property locator; in the case of a variable it is a name; in the case of a url, a url;
29: * in the case of a file, a file path
30: */
31: public String locator;
32:
33: /**
34: * Parses the scheme and locator from a property name/locator string
35: * @param string the property name/locator
36: */
37: public Property(String string) {
38: int i = string.indexOf(':');
39: if (i == -1) {
40: locator = string;
41: } else {
42: if (i > 0) {
43: scheme = string.substring(0, i);
44: }
45: locator = string.substring(i + 1);
46: }
47: }
48:
49: /**
50: * Initialized the property with specified scheme and locator
51: * @param scheme the scheme
52: * @param locator the locator
53: */
54: public Property(String scheme, String locator) {
55: this .scheme = scheme;
56: this .locator = locator;
57: }
58:
59: public String toString() {
60: return "[Property: scheme=" + scheme + ", locator=" + locator
61: + "]";
62: }
63: }
|