package org.geotools.wms.v1_1_1.bindings;


import javax.xml.namespace.QName;

import org.geotools.data.ows.StyleImpl;
import org.geotools.util.SimpleInternationalString;
import org.geotools.xml.AbstractComplexBinding;
import org.geotools.xml.ElementInstance;
import org.geotools.xml.Node;
import org.opengis.layer.StyleSheetURL;
import org.opengis.layer.StyleURL;

/**
 * Binding object for the type :_Style.
 *
 * <p>
 *	<pre>
 *	 <code>
 *  &lt;xs:complexType name="_Style"&gt;
 *      &lt;xs:sequence&gt;
 *          &lt;xs:element ref="Name"/&gt;
 *          &lt;xs:element ref="Title"/&gt;
 *          &lt;xs:element minOccurs="0" ref="Abstract"/&gt;
 *          &lt;xs:element maxOccurs="unbounded" minOccurs="0" ref="LegendURL"/&gt;
 *          &lt;xs:element minOccurs="0" ref="StyleSheetURL"/&gt;
 *          &lt;xs:element minOccurs="0" ref="StyleURL"/&gt;
 *      &lt;/xs:sequence&gt;
 *  &lt;/xs:complexType&gt; 
 *		
 *	  </code>
 *	 </pre>
 * </p>
 *
 * @generated
 */
public class _StyleBinding extends AbstractComplexBinding {

	/**
	 * @generated
	 */
	public QName getTarget() {
		return WMSV1_1_1._Style;
	}
	
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 *	
	 * @generated modifiable
	 */	
	public Class getType() {
		return StyleImpl.class;
	}
	
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 *	
	 * @generated modifiable
	 */	
	public Object parse(ElementInstance instance, Node node, Object value) 
		throws Exception {
		StyleImpl ret = new StyleImpl();
		
		// Currently un-implemented
		//ret.setStyleURL((StyleURL)node.getChildValue("StyleURL"));
		//ret.setStyleSheetURL((StyleSheetURL)node.getChildValue("StyleSheetURL"));
		//ret.setLegendURLs(node.getChildValues("LegendURL"));
		if (node.getChildValue("Abstract")!= null)
			ret.setAbstract(new SimpleInternationalString((String)node.getChildValue("Abstract")));
		if (node.getChildValue("Title") != null)
			ret.setTitle(new SimpleInternationalString((String)node.getChildValue("Title")));
		ret.setName((String)node.getChildValue("Name"));
		
		return ret;
	}

}