@Override public Object convertDomToValue(DomElement parentElement, Object value) throws ConversionException, ValidationException { com.vividsolutions.jts.geom.GeometryFactory gf = new com.vividsolutions.jts.geom.GeometryFactory(); final DefaultDomConverter domConverter = new DefaultDomConverter(Coordinate.class); final DomElement[] children = parentElement.getChildren("coordinate"); List<Coordinate> coordList = new ArrayList<Coordinate>(); for (DomElement child : children) { final Coordinate coordinate = (Coordinate) domConverter.convertDomToValue(child, null); coordList.add(coordinate); } return gf.createPolygon(gf.createLinearRing(coordList.toArray(new Coordinate[coordList.size()])), null); }
@Override public Object convertDomToValue(DomElement parentElement, Object value) throws ConversionException, ValidationException { com.vividsolutions.jts.geom.GeometryFactory gf = new com.vividsolutions.jts.geom.GeometryFactory(); final DefaultDomConverter domConverter = new DefaultDomConverter(Coordinate.class); final DomElement[] children = parentElement.getChildren("coordinate"); List<Coordinate> coordList = new ArrayList<Coordinate>(); for (DomElement child : children) { final Coordinate coordinate = (Coordinate) domConverter.convertDomToValue(child, null); coordList.add(coordinate); } return gf.createPolygon(gf.createLinearRing(coordList.toArray(new Coordinate[coordList.size()])), null); }
private Shape convertDomToShape(DomElement parentElement) throws ConversionException, ValidationException { final DomElement shapeChild = parentElement.getChild("shape"); final DefaultDomConverter domConverter = new DefaultDomConverter(Shape.class); return (Shape) domConverter.convertDomToValue(shapeChild, null); }
public void fromDomElement(DomElement parametersElement) throws ValidationException, ConversionException { parameterMap.clear(); propertySet.setDefaultValues(); DefaultDomConverter domConverter = createDomConverter(); domConverter.convertDomToValue(parametersElement, propertySet); parameterUpdater.handleParameterLoadRequest(parameterMap); }
public void fromDomElement(DomElement parametersElement) throws ValidationException, ConversionException { parameterMap.clear(); propertySet.setDefaultValues(); DefaultDomConverter domConverter = createDomConverter(); domConverter.convertDomToValue(parametersElement, propertySet); parameterUpdater.handleParameterLoadRequest(parameterMap); }
private void convertXmlToPropertySet(String xml, Class<? extends Object> schema, PropertySet propertySet) throws ValidationException, ConversionException { propertySet.setDefaultValues(); DefaultDomConverter domConverter = new DefaultDomConverter(schema, parameterDescriptorFactory); DomElement domElement = convertXmlToDomElement(xml); domConverter.convertDomToValue(domElement, propertySet); } }
domConverter.convertDomToValue(parametersElement, container); } catch (ConversionException e) { String msgPattern = "Can not convert XML parameters for operator '%s'. Reason: %s";
private void configureOperator(OperatorConfiguration operatorConfiguration) throws ValidationException, ConversionException { OperatorDescriptor operatorDescriptor = getOperatorSpi().getOperatorDescriptor(); ParameterDescriptorFactory descriptorFactory = new ParameterDescriptorFactory(sourceProductMap); PropertySetDescriptor propertySetDescriptor = PropertySetDescriptorFactory.createForOperator(operatorDescriptor, descriptorFactory.getSourceProductMap()); Class<? extends Operator> operatorType = operatorDescriptor.getOperatorClass(); DefaultDomConverter domConverter = new DefaultDomConverter(operatorType, descriptorFactory, propertySetDescriptor); domConverter.convertDomToValue(operatorConfiguration.getConfiguration(), getParameterSet()); Set<Reference> referenceSet = operatorConfiguration.getReferenceSet(); for (Reference reference : referenceSet) { Property property = getParameterSet().getProperty(reference.getParameterName()); property.setValue(reference.getValue()); } }
dc.convertDomToValue(m2.getConfiguration(), configuration2);
domConverter.convertDomToValue(configurationDomElement, parameterSet); assertNotNull(parameterSet.getProperty("targetBands")); assertNotNull(parameterSet.getProperty("targetBands").getValue());