package org.geotools.wms.v1_1_1.bindings;


import org.geotools.data.ows.CRSEnvelope;
import org.geotools.xml.*;


import javax.xml.namespace.QName;

/**
 * Binding object for the type :_BoundingBox.
 *
 * <p>
 *	<pre>
 *	 <code>
 *  &lt;xs:complexType name="_BoundingBox"&gt;
 *      &lt;xs:attribute name="SRS" use="required"/&gt;
 *      &lt;xs:attribute name="minx" use="required"/&gt;
 *      &lt;xs:attribute name="miny" use="required"/&gt;
 *      &lt;xs:attribute name="maxx" use="required"/&gt;
 *      &lt;xs:attribute name="maxy" use="required"/&gt;
 *      &lt;xs:attribute name="resx"/&gt;
 *      &lt;xs:attribute name="resy"/&gt;
 *  &lt;/xs:complexType&gt; 
 *		
 *	  </code>
 *	 </pre>
 * </p>
 *
 * @generated
 */
public class _BoundingBoxBinding extends AbstractComplexBinding {

	/**
	 * @generated
	 */
	public QName getTarget() {
		return WMSV1_1_1._BoundingBox;
	}
	
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 *	
	 * @generated modifiable
	 */	
	public Class getType() {
		return CRSEnvelope.class;
	}
	
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 *	
	 * @generated modifiable
	 */	
	public Object parse(ElementInstance instance, Node node, Object value) 
		throws Exception {
		CRSEnvelope ret = new CRSEnvelope();
		ret.setEPSGCode((String)node.getAttributeValue("SRS"));
		ret.setMaxX(Double.parseDouble((String)node.getAttributeValue("maxx")));
		ret.setMaxY(Double.parseDouble((String)node.getAttributeValue("maxy")));
		ret.setMinX(Double.parseDouble((String)node.getAttributeValue("minx")));
		ret.setMinY(Double.parseDouble((String)node.getAttributeValue("miny")));
		return ret;
	}

}