01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2002-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.sld.bindings;
17:
18: import org.picocontainer.MutablePicoContainer;
19: import org.w3c.dom.Document;
20: import org.w3c.dom.Element;
21: import java.net.URI;
22: import javax.xml.namespace.QName;
23: import org.geotools.xml.*;
24:
25: /**
26: * Binding object for the element http://www.opengis.net/sld:OnlineResource.
27: *
28: * <p>
29: * <pre>
30: * <code>
31: * <xsd:element name="OnlineResource">
32: * <xsd:annotation>
33: * <xsd:documentation> An OnlineResource is typically used
34: * to refer to an HTTP URL. </xsd:documentation>
35: * </xsd:annotation>
36: * <xsd:complexType>
37: * <xsd:attributeGroup ref="xlink:simpleLink"/>
38: * </xsd:complexType>
39: * </xsd:element>
40: *
41: * </code>
42: * </pre>
43: * </p>
44: *
45: * @generated
46: */
47: public class SLDOnlineResourceBinding extends AbstractComplexBinding {
48: /**
49: * @generated
50: */
51: public QName getTarget() {
52: return SLD.ONLINERESOURCE;
53: }
54:
55: /**
56: * <!-- begin-user-doc -->
57: * <!-- end-user-doc -->
58: *
59: * @generated modifiable
60: */
61: public int getExecutionMode() {
62: return AFTER;
63: }
64:
65: /**
66: * <!-- begin-user-doc -->
67: * <!-- end-user-doc -->
68: *
69: * @generated modifiable
70: */
71: public Class getType() {
72: return URI.class;
73: }
74:
75: /**
76: * <!-- begin-user-doc -->
77: * <!-- end-user-doc -->
78: *
79: * @generated modifiable
80: */
81: public void initialize(ElementInstance instance, Node node,
82: MutablePicoContainer context) {
83: }
84:
85: /**
86: * <!-- begin-user-doc -->
87: * <!-- end-user-doc -->
88: *
89: * @generated modifiable
90: */
91: public Object parse(ElementInstance instance, Node node,
92: Object value) throws Exception {
93: //just grab the URI and pass it back
94: return node.getAttributeValue("href");
95: }
96: }
|