Search in sources :

Example 1 with Wfs20JaxbElementProvider

use of org.codice.ddf.spatial.ogc.wfs.v2_0_0.catalog.common.Wfs20JaxbElementProvider in project ddf by codice.

the class WfsSource method initProviders.

private List<? extends Object> initProviders() {
    // We need to tell the JAXBElementProvider to marshal the GetFeatureType
    // class as an element
    // because it is missing the @XmlRootElement Annotation
    JAXBElementProvider<GetFeatureType> provider = new Wfs20JaxbElementProvider<>();
    Map<String, String> jaxbClassMap = new HashMap<>();
    // Ensure a namespace is used when the GetFeature request is generated
    String expandedName = new QName(Wfs20Constants.WFS_2_0_NAMESPACE, Wfs20Constants.GET_FEATURE).toString();
    jaxbClassMap.put(GetFeatureType.class.getName(), expandedName);
    provider.setJaxbElementClassMap(jaxbClassMap);
    provider.setMarshallAsJaxbElement(true);
    featureCollectionReader = new FeatureCollectionMessageBodyReaderWfs20();
    return Arrays.asList(provider, new XmlSchemaMessageBodyReaderWfs20(), featureCollectionReader);
}
Also used : XmlSchemaMessageBodyReaderWfs20(org.codice.ddf.spatial.ogc.wfs.v2_0_0.catalog.source.reader.XmlSchemaMessageBodyReaderWfs20) HashMap(java.util.HashMap) QName(javax.xml.namespace.QName) FeatureCollectionMessageBodyReaderWfs20(org.codice.ddf.spatial.ogc.wfs.v2_0_0.catalog.source.reader.FeatureCollectionMessageBodyReaderWfs20) Wfs20JaxbElementProvider(org.codice.ddf.spatial.ogc.wfs.v2_0_0.catalog.common.Wfs20JaxbElementProvider) GetFeatureType(net.opengis.wfs.v_2_0_0.GetFeatureType)

Aggregations

HashMap (java.util.HashMap)1 QName (javax.xml.namespace.QName)1 GetFeatureType (net.opengis.wfs.v_2_0_0.GetFeatureType)1 Wfs20JaxbElementProvider (org.codice.ddf.spatial.ogc.wfs.v2_0_0.catalog.common.Wfs20JaxbElementProvider)1 FeatureCollectionMessageBodyReaderWfs20 (org.codice.ddf.spatial.ogc.wfs.v2_0_0.catalog.source.reader.FeatureCollectionMessageBodyReaderWfs20)1 XmlSchemaMessageBodyReaderWfs20 (org.codice.ddf.spatial.ogc.wfs.v2_0_0.catalog.source.reader.XmlSchemaMessageBodyReaderWfs20)1