package org.geotools.gml4wcs.bindings;
import java.util.List;
import javax.xml.namespace.QName;
import org.geotools.gml4wcs.GML;
import org.geotools.xml.AbstractSimpleBinding;
import org.geotools.xml.InstanceComponent;
/**
* Binding object for the type http://www.opengis.net/gml:doubleList.
*
* <p>
*
* <pre>
* <code>
* <simpleType name="doubleList">
* <annotation>
* <documentation>XML List based on XML Schema double type. An element of this type contains a space-separated list of double values</documentation>
* </annotation>
* <list itemType="double"/>
* </simpleType>
*
* </code>
* </pre>
*
* </p>
*
* @generated
*
* @source $URL: http://svn.osgeo.org/geotools/branches/2.7.x/build/maven/javadoc/../../../modules/extension/xsd/xsd-wcs/src/main/java/org/geotools/gml4wcs/bindings/DoubleListBinding.java $
*/
public class DoubleListBinding extends AbstractSimpleBinding {
/**
* @generated
*/
public QName getTarget() {
return GML.doubleList;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated modifiable
*/
public Class getType() {
// return double[].class;
return Double[].class;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated modifiable
*/
public Object parse(InstanceComponent instance, Object value)
throws Exception {
List list = (List) value;
return list.toArray(new Double[list.size()]);
// String[] values = ((String) value).split(" +");
// double[] doubles = new double[values.length];
//
// for (int i = 0; i < values.length; i++) {
// doubles[i] = Double.parseDouble(values[i]);
// }
//
// return doubles;
}
}