01: package org.geotools.wms.v1_1_1.bindings;
02:
03: import java.util.HashSet;
04:
05: import javax.xml.namespace.QName;
06:
07: import org.geotools.metadata.iso.citation.AddressImpl;
08: import org.geotools.util.SimpleInternationalString;
09: import org.geotools.xml.AbstractComplexBinding;
10: import org.geotools.xml.ElementInstance;
11: import org.geotools.xml.Node;
12:
13: /**
14: * Binding object for the type :_ContactAddress.
15: *
16: * <p>
17: * <pre>
18: * <code>
19: * <xs:complexType name="_ContactAddress">
20: * <xs:sequence>
21: * <xs:element ref="AddressType"/>
22: * <xs:element ref="Address"/>
23: * <xs:element ref="City"/>
24: * <xs:element ref="StateOrProvince"/>
25: * <xs:element ref="PostCode"/>
26: * <xs:element ref="Country"/>
27: * </xs:sequence>
28: * </xs:complexType>
29: *
30: * </code>
31: * </pre>
32: * </p>
33: *
34: * @generated
35: */
36: public class _ContactAddressBinding extends AbstractComplexBinding {
37:
38: /**
39: * @generated
40: */
41: public QName getTarget() {
42: return WMSV1_1_1._ContactAddress;
43: }
44:
45: /**
46: * <!-- begin-user-doc -->
47: * <!-- end-user-doc -->
48: *
49: * @generated modifiable
50: */
51: public Class getType() {
52: return AddressImpl.class;
53: }
54:
55: /**
56: * <!-- begin-user-doc -->
57: * <!-- end-user-doc -->
58: *
59: * @generated modifiable
60: */
61: public Object parse(ElementInstance instance, Node node,
62: Object value) throws Exception {
63: AddressImpl ret = new AddressImpl();
64: ret.setCity(new SimpleInternationalString((String) node
65: .getChildValue("City")));
66: ret.setCountry(new SimpleInternationalString((String) node
67: .getChildValue("Country")));
68: ret.setPostalCode((String) node.getChildValue("PostCode"));
69: ret.setElectronicMailAddresses(new HashSet());
70: ret.setAdministrativeArea(new SimpleInternationalString(
71: (String) node.getChildValue("StateOrProvince")));
72:
73: HashSet addrs = new HashSet();
74: addrs.addAll(node.getChildValues("Address"));
75:
76: ret.setDeliveryPoints(addrs);
77:
78: return ret;
79: }
80:
81: }
|