Package org.geotools.xml

Examples of org.geotools.xml.Encoder.encode()


        FeatureCollectionType fc = WfsFactory.eINSTANCE.createFeatureCollectionType();
        fc.getFeature().add( features );
       
        Encoder e = new Encoder(configuration);
        e.getNamespaces().declarePrefix( "feature", featureType.getName().getNamespaceURI() );
        e.encode( fc, getElement(), handler );
    }
   
    public static class WFS10 extends WFSPPIO {
       
        public WFS10() {
View Full Code Here


            handler.setResult(new StreamResult(sw));

            encoder.setInline(true);
            loadNamespaceBindings(encoder.getNamespaces(), feature, xmlConfig.getXSD().getSchema());
           
            encoder.encode(feature, GML._Feature, handler);

            return sw.toString();
        } catch(Exception e) {
            success = false;
            throw new WFSException(e);
View Full Code Here

            for (Map.Entry<String, String> entry : getSchemaLocations().entrySet()) {
                e.setSchemaLocation(entry.getKey(), entry.getValue());
            }
            configureEncoder(e, elementName, xmlConfiguration);
           
            e.encode( value, new QName( c.getXSD().getNamespaceURI(), elementName ), output );
        }
        catch (Exception e) {
            throw (IOException) new IOException().initCause( e );
        }
    }
View Full Code Here

       
        String schemaLocation = buildSchemaURL(baseURL(request.getHttpRequest()), "ows/1.0.0/owsExceptionReport.xsd");
        encoder.setSchemaLocation(org.geoserver.ows.xml.v1_0.OWS.NAMESPACE, schemaLocation);

        try {
            encoder.encode(report, org.geoserver.ows.xml.v1_0.OWS.EXCEPTIONREPORT,
                    request.getHttpResponse().getOutputStream());
        } catch (Exception ex) {
            //throw new RuntimeException(ex);
            // Hmm, not much we can do here.  I guess log the fact that we couldn't write out the exception and be done with it...
            LOGGER.log(Level.INFO, "Problem writing exception information back to calling client:", e);
View Full Code Here

     */
    protected void writeFilter(Filter filter, ObjectOutputStream out) throws IOException {
        if (filter != null) {
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            Encoder encoder = new Encoder(CONFIGURATION);
            encoder.encode(filter, OGC.Filter, bos);
            out.writeObject(bos.toByteArray());
        } else {
            out.writeObject(null);
        }
    }
View Full Code Here

                if(force200httpcode) {
                    response.setStatus(200);
                }

                encoder.encode(report, OWS.ExceptionReport, response.getOutputStream());
//            }

        } catch (Exception ex) {
            //throw new RuntimeException(ex);
            // Hmm, not much we can do here.  I guess log the fact that we couldn't write out the exception and be done with it...
View Full Code Here

        nl.setName("");
        nl.styles().add((Style) obj);
        sld.setStyledLayers(new StyledLayer[] { nl });

        Encoder e = new Encoder(sldConfiguration);
        e.encode(sld, element, handler);
    }
   
    @Override
    public Object decode(Object input) throws Exception {
        Parser p = new Parser(sldConfiguration);
View Full Code Here

    }

    @Override
    public void encode(Object obj, ContentHandler handler) throws Exception {
        Encoder e = new Encoder( xml );
        e.encode( obj, element, handler );
    }
   
    public static class GML2 extends GMLPPIO {

        public GML2(Class type,QName element) {
View Full Code Here

    }

    @Override
    public void encode(Object obj, ContentHandler handler) throws Exception {
        Encoder e = new Encoder(xml);
        e.encode(obj, element, handler);
    }

    public static class Filter10 extends FilterPPIO {

        public Filter10() {
View Full Code Here

                filtered.add(new FilteringFeatureCollection<FeatureType, Feature>(fc, f));
            results.getFeature().clear();
            results.getFeature().addAll(filtered);
        }
       
        encoder.encode(results, org.geoserver.wfs.xml.v1_1_0.WFS.FEATURECOLLECTION, output);
    }

    private static void loadNamespaceBindings(NamespaceSupport nss, FeatureCollection fc) {
        XSDTypeDefinition type =
            (XSDTypeDefinition) fc.getSchema().getUserData().get(
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.