use of org.codice.ddf.parser.ParserConfigurator in project ddf by codice.
the class GeometryTransformer method transform.
public BinaryContent transform(Attribute attribute) throws CatalogTransformerException {
ParserConfigurator parserConfigurator = getParserConfigurator().setHandler(new DefaultValidationEventHandler());
try {
ByteArrayOutputStream os = new ByteArrayOutputStream(BUFFER_SIZE);
getParser().marshal(parserConfigurator, GeometryAdapter.marshalFrom(attribute), os);
ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray());
return new BinaryContentImpl(bais, MIME_TYPE);
} catch (ParserException e) {
throw new CatalogTransformerException("Failed to marshall geometry data", e);
}
}
Aggregations