01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2004-2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.xml.schema;
17:
18: /**
19: * <p>
20: * This interface is intended to represent a data structure to pass resolved
21: * Child elements to the parent element. This is of particular importance as
22: * this enable the programmer to reverse the direction of the recursion on the
23: * parse tree, hopefully reducing the impact on the heap and overall memory.
24: * </p>
25: *
26: * @author dzwiers www.refractions.net
27: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/xml/src/main/java/org/geotools/xml/schema/ElementValue.java $
28: */
29: public interface ElementValue {
30: /**
31: * <p>
32: * Returns the type which generated the associated value. The type is
33: * important because it allows easy access to the xml element inheritance
34: * tree, allowing the user to test whether it is a valid data entry.
35: * </p>
36: *
37: * @return Type
38: */
39:
40: // public Type getType();
41: public Element getElement();
42:
43: /**
44: * <p>
45: * This returns the realized value of an element which was associated with
46: * this type. We recommend that this value be realized prior to the first
47: * request for the value (use this object to cache the result). If you do
48: * chose to implement this method lazily, consider caching the result as
49: * it may be called more than once, expecting the same result both times.
50: * </p>
51: *
52: * @return Object (may be null)
53: */
54: public Object getValue();
55: }
|