Package org.geotools.xml

Examples of org.geotools.xml.Configuration


        Object object;
        BufferedReader in = null;
        try
        {
            Configuration config = new WPSConfiguration();

            URL url;
            url = TestData.url(this, "deegree3ProcessDescriptions.xml");

            Parser parser = new Parser(config);
View Full Code Here


            return;
        }

        File file = TestData.file(this, "LiteralDataTypeTestFile.xml");
        BufferedReader in = new BufferedReader(new FileReader(file));
        Configuration config = new WPSConfiguration();
        Parser parser = new Parser(config);

        Object object = parser.parse(in);

        // try casting the response
View Full Code Here

        Collection<FeatureTypeInfo> featureTypes = ns2metas.values();
       
        //create the encoder
        ApplicationSchemaXSD xsd = new ApplicationSchemaXSD( null, catalog, gft.getBaseUrl(),
            org.geotools.wfs.v1_0.WFS.getInstance(), featureTypes );
        Configuration configuration = new ApplicationSchemaConfiguration( xsd, new org.geotools.wfs.v1_0.WFSConfiguration() );
       
        Encoder encoder = new Encoder(configuration);
        //encoder.setEncoding(wfs.getCharSet());
       
       encoder.setSchemaLocation(org.geoserver.wfs.xml.v1_1_0.WFS.NAMESPACE,
View Full Code Here

    @Override
    public void write(Object value, OutputStream output, Operation operation)
            throws IOException, ServiceException {
        try {
            Configuration c = (Configuration) xmlConfiguration.newInstance();
            Encoder e = new Encoder( c );
            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

     * @param stream
     * @return
     */
    public Object decode(InputStream stream) {
        Object        decoded = null;
        Configuration config  = null;

        try {
            config = (Configuration)(this.getXMLConfiguration().getConstructor().newInstance());
        } catch(Exception e) {
            throw new WPSException("NoApplicableCode", "Failed to initialize XMLConfiguration");
View Full Code Here

     */
    protected abstract Configuration getParserConfiguration();

    public Object parse(String value) throws Exception {
        // create the parser
        final Configuration configuration = getParserConfiguration();
        final Parser parser = new Parser(configuration);

        // seperate the individual filter strings
        List unparsed = KvpUtils.readFlat(value, KvpUtils.OUTER_DELIMETER);
        List filters = new ArrayList();
View Full Code Here

                final byte[] rawContent = string.getBytes();
                InputStream input = new ByteArrayInputStream(rawContent);
   
                try {
                    //create the parser
                    Configuration configuration = new OGCConfiguration();
                    Parser parser_1_0_0 = new Parser(configuration);
                    filter = (Filter) parser_1_0_0.parse(input);
                } catch (Exception e) {
                    //parsing failed, try with a Filter 1.1.0 parser
                    try{
                        input = new ByteArrayInputStream(rawContent);
                        Configuration configuration = new org.geotools.filter.v1_1.OGCConfiguration();
                        Parser parser_1_1_0 = new Parser(configuration);
                        filter = (Filter) parser_1_1_0.parse(input);
                       
                        filters.add(filter);
                    }catch(Exception e2){
View Full Code Here

        Collection<FeatureTypeInfo> featureTypes = ns2metas.values();
       
        //create the encoder
        ApplicationSchemaXSD xsd = new ApplicationSchemaXSD( null, catalog, gft.getBaseUrl(),
            org.geotools.wfs.v1_0.WFS.getInstance(), featureTypes );
        Configuration configuration = new ApplicationSchemaConfiguration( xsd, new org.geotools.wfs.v1_0.WFSConfiguration() );
       
        Encoder encoder = new Encoder(configuration);
        //encoder.setEncoding(wfs.getCharSet());
       
       encoder.setSchemaLocation(org.geoserver.wfs.xml.v1_1_0.WFS.NAMESPACE,
View Full Code Here

    @Override
    public void write(Object value, OutputStream output, Operation operation)
            throws IOException, ServiceException {
        try {
            Configuration c = (Configuration) xmlConfiguration.newInstance();
            Encoder e = new Encoder( c );
            for (Map.Entry<String, String> entry : getSchemaLocations().entrySet()) {
                e.setSchemaLocation(entry.getKey(), entry.getValue());
            }
           
            e.encode( value, new QName( c.getXSD().getNamespaceURI(), elementName ), output );
        }
        catch (Exception e) {
            throw (IOException) new IOException().initCause( e );
        }
    }
View Full Code Here

                final byte[] rawContent = string.getBytes();
                InputStream input = new ByteArrayInputStream(rawContent);
   
                try {
                    //create the parser
                    Configuration configuration = new OGCConfiguration();
                    Parser parser_1_0_0 = new Parser(configuration);
                    filter = (Filter) parser_1_0_0.parse(input);
                } catch (Exception e) {
                    //parsing failed, try with a Filter 1.1.0 parser
                    try{
                        input = new ByteArrayInputStream(rawContent);
                        Configuration configuration = new org.geotools.filter.v1_1.OGCConfiguration();
                        Parser parser_1_1_0 = new Parser(configuration);
                        filter = (Filter) parser_1_1_0.parse(input);
                       
                        filters.add(filter);
                    }catch(Exception e2){
View Full Code Here

TOP

Related Classes of org.geotools.xml.Configuration

Copyright © 2018 www.massapicom. 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.