/* (c) 2014 Open Source Geospatial Foundation - all rights reserved
* (c) 2001 - 2013 OpenPlans
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
*/
package org.geoserver.wfs.xml.v1_1_0;
import java.math.BigInteger;
import javax.xml.namespace.QName;
import net.opengis.wfs.WfsFactory;
import net.opengis.wfs.XlinkPropertyNameType;
import org.geotools.xml.AbstractComplexBinding;
import org.geotools.xml.ElementInstance;
import org.geotools.xml.Node;
/**
* Binding object for the element http://www.opengis.net/wfs:XlinkPropertyName.
*
* <p>
* <pre>
* <code>
* <xsd:element name="XlinkPropertyName">
* <xsd:annotation>
* <xsd:documentation>
* This element may be used in place of an wfs:PropertyName element
* in a wfs:Query element in a wfs:GetFeature element to selectively
* request the traversal of nested XLinks in the returned element for
* the named property. This element may not be used in other requests
* -- GetFeatureWithLock, LockFeature, Insert, Update, Delete -- in
* this version of the WFS specification.
* </xsd:documentation>
* </xsd:annotation>
* <xsd:complexType>
* <xsd:simpleContent>
* <xsd:extension base="xsd:string">
* <xsd:attribute name="traverseXlinkDepth"
* type="xsd:string" use="required">
* <xsd:annotation>
* <xsd:documentation>
* This attribute indicates the depth to which nested property
* XLink linking element locator attribute (href) XLinks are
* traversed and resolved if possible. A value of "1" indicates
* that one linking element locator attribute (href) Xlink
* will be traversed and the referenced element returned if
* possible, but nested property XLink linking element locator
* attribute (href) XLinks in the returned element are not
* traversed. A value of "*" indicates that all nested property
* XLink linking element locator attribute (href) XLinks will be
* traversed and the referenced elements returned if possible.
* The range of valid values for this attribute consists of
* positive integers plus "*".
* </xsd:documentation>
* </xsd:annotation>
* </xsd:attribute>
* <xsd:attribute name="traverseXlinkExpiry"
* type="xsd:positiveInteger" use="optional">
* <xsd:annotation>
* <xsd:documentation>
* The traverseXlinkExpiry attribute value is specified in
* minutes It indicates how long a Web Feature Service should
* wait to receive a response to a nested GetGmlObject request.
* </xsd:documentation>
* </xsd:annotation>
* </xsd:attribute>
* </xsd:extension>
* </xsd:simpleContent>
* </xsd:complexType>
* </xsd:element>
*
* </code>
* </pre>
* @generated
*/
public class XlinkPropertyNameBinding extends AbstractComplexBinding {
WfsFactory factory;
public XlinkPropertyNameBinding( WfsFactory factory ) {
this.factory = factory;
}
/**
* @generated
*/
public QName getTarget() {
return WFS.XLINKPROPERTYNAME;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated modifiable
*/
public Class getType() {
return XlinkPropertyNameType.class;
}
public int getExecutionMode() {
return OVERRIDE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value)
throws Exception {
XlinkPropertyNameType property = factory.createXlinkPropertyNameType();
property.setValue( (String) value );
//<xsd:attribute name="traverseXlinkDepth"
// type="xsd:string" use="required">
property.setTraverseXlinkDepth( (String) node.getAttributeValue( "traverseXlinkDepth" ) );
//<xsd:attribute name="traverseXlinkExpiry"
// type="xsd:positiveInteger" use="optional">
if ( node.hasAttribute( "traverseXlinkExpiry" ) ) {
property.setTraverseXlinkExpiry( (BigInteger) node.getAttributeValue( "traverseXlinkExpiry" ) );
}
return property;
}
}