Package org.geotools.xml

Examples of org.geotools.xml.Configuration


                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


     * @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

        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 );
            e.encode( value, new QName( c.getXSD().getNamespaceURI(), elementName ), output );
        }
        catch (Exception e) {
            throw (IOException) new IOException().initCause( e );
        }
    }
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

         *
         * @param filterVersion
         * @return
         */
        private Parser getFilterParser(String filterVersion) {
      Configuration config;
      if (filterVersion.equals(FilterCapabilities.VERSION_100)) {
          config = FILTER_1_0_0;
      } else if (filterVersion.equals(FilterCapabilities.VERSION_200)) {
          config = FILTER_2_0_0;
      } else if (filterVersion.equals(FilterCapabilities.VERSION_110)) {
View Full Code Here

    } catch (CQLException e) {
      Log.error(Geonet.CSW, "Error parsing CQL or during conversion into Filter");
      throw new NoApplicableCodeEx("Error during CQL to Filter conversion : "+ e);
    }

    final Configuration filter110Config = new OGCConfiguration();
    final Encoder encoder = new Encoder(filter110Config);
   
    final Charset charset = Charset.forName("UTF-16");
    encoder.setEncoding(charset);
    ByteArrayOutputStream out = new ByteArrayOutputStream();
View Full Code Here

    @Test
    public void testCatalogSchemaResolution() throws Exception {
        URL catalogLocation = getClass().getResource(schemaBase + "mappedPolygons.oasis.xml");
        String namespace = "http://www.cgi-iugs.org/xml/GeoSciML/2";
        String schemaLocation = "http://schemas.opengis.net/GeoSciML/geosciml.xsd";
        Configuration config = new AppSchemaConfiguration(namespace, schemaLocation,
                new SchemaResolver(SchemaCatalog.build(catalogLocation)));
        String resolvedSchemaLocation = config.getXSD().getSchemaLocation();
        assertTrue(resolvedSchemaLocation.startsWith("file:/"));
        assertTrue(resolvedSchemaLocation.endsWith(schemaBase
                + "commonSchemas_new/GeoSciML/geosciml.xsd"));
    }
View Full Code Here

    @Test
    public void findGml31Configuration() {
        AppSchemaConfiguration configuration = new AppSchemaConfiguration(
                "urn:cgi:xmlns:CGI:GeoSciML:2.0",
                "http://www.geosciml.org/geosciml/2.0/xsd/geosciml.xsd", new SchemaResolver());
        Configuration gmlConfiguration = EmfAppSchemaReader.findGmlConfiguration(configuration);
        Assert.assertNotNull(gmlConfiguration);
        Assert.assertEquals(new GMLConfiguration(), gmlConfiguration);
    }
View Full Code Here

    public void findGml32Configuration() {
        AppSchemaConfiguration configuration = new AppSchemaConfiguration(
                "urn:cgi:xmlns:CGI:GeoSciML-Core:3.0.0",
                "https://www.seegrid.csiro.au/subversion/GeoSciML/branches/3.0.0_rc1_gml3.2/geosciml-core/3.0.0/xsd/geosciml-core.xsd",
                new SchemaResolver());
        Configuration gmlConfiguration = EmfAppSchemaReader.findGmlConfiguration(configuration);
        Assert.assertNotNull(gmlConfiguration);
        Assert.assertEquals(new org.geotools.gml3.v3_2.GMLConfiguration(), gmlConfiguration);
    }
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.