@Override public XSD getSchema() { return GML.getInstance(); }
public GMLParserDelegate() { super(new GMLConfiguration()); } }
@Override protected Schema buildTypeSchema() { return new GMLSchema(); }
/** Creates the new gml configuration, with a depenendency on {@link XLINKConfiguration} */ public GMLConfiguration() { super(GML.getInstance()); // add xlink cdependency addDependency(new XLINKConfiguration()); // add the parse unknown attributes property, this is mostly for // the "fid" attribute getProperties().add(Parser.Properties.PARSE_UNKNOWN_ELEMENTS); getProperties().add(Parser.Properties.PARSE_UNKNOWN_ATTRIBUTES); }
/** * Configures the gml3 context. * * <p>The following factories are registered: * * <ul> * <li>{@link CoordinateArraySequenceFactory} under {@link CoordinateSequenceFactory} * <li>{@link GeometryFactory} * </ul> */ public void configureContext(MutablePicoContainer container) { container.registerComponentInstance(Gml4wcsFactory.eINSTANCE); container.registerComponentInstance(new FeatureTypeCache()); container.registerComponentImplementation(FeaturePropertyExtractor.class); // factories container.registerComponentInstance( CoordinateSequenceFactory.class, CoordinateArraySequenceFactory.instance()); container.registerComponentImplementation(GeometryFactory.class); container.registerComponentImplementation(DefaultFeatureCollections.class); } }
List locators = Arrays.asList(GML.getInstance().createSchemaLocator()); XSDSchema schema = null; try {
@Override protected XSDSchema buildSchema() throws IOException { XSDSchema schema = super.buildSchema(); schema.resolveElementDeclaration(NAMESPACE, "_Feature") .eAdapters() .add(new SubstitutionGroupLeakPreventer()); schema.eAdapters().add(new ReferencingDirectiveLeakPreventer()); return schema; } }
@Override public void put(FeatureType type) { // only add to cache if the feature type has been parsed from schema if (Boolean.TRUE.equals( type.getUserData().get(GML2ParsingUtils.PARSED_FROM_SCHEMA_KEY))) { super.put(type); } else { dynamicTypeFound = true; } } };
private int getNumDecimals(Configuration configuration) { GMLConfiguration config = getGMLConfiguration(configuration); if (config == null) { return 6; } else { return config.getNumDecimals(); } }
private boolean getPadWithZeros(Configuration configuration) { GMLConfiguration config = getGMLConfiguration(configuration); if (config == null) { return false; } else { return config.getPadWithZeros(); } }
private boolean getForceDecimalEncoding(Configuration configuration) { GMLConfiguration config = getGMLConfiguration(configuration); if (config == null) { return true; } else { return config.getForceDecimalEncoding(); } }
put( new NameImpl("http://www.opengis.net/gml", "AbstractGeometryType"), ABSTRACTGEOMETRYTYPE_TYPE); put( new NameImpl("http://www.opengis.net/gml", "AbstractGeometryCollectionBaseType"), ABSTRACTGEOMETRYCOLLECTIONBASETYPE_TYPE); put( new NameImpl("http://www.opengis.net/gml", "GeometryAssociationType"), GEOMETRYASSOCIATIONTYPE_TYPE); put( new NameImpl("http://www.opengis.net/gml", "GeometryCollectionType"), GEOMETRYCOLLECTIONTYPE_TYPE); put(new NameImpl("http://www.opengis.net/gml", "CoordType"), COORDTYPE_TYPE); put(new NameImpl("http://www.opengis.net/gml", "CoordinatesType"), COORDINATESTYPE_TYPE); put(new NameImpl("http://www.opengis.net/gml", "LinearRingType"), LINEARRINGTYPE_TYPE); put( new NameImpl("http://www.opengis.net/gml", "LinearRingMemberType"), LINEARRINGMEMBERTYPE_TYPE); put(new NameImpl("http://www.opengis.net/gml", "PolygonType"), POLYGONTYPE_TYPE); put( new NameImpl("http://www.opengis.net/gml", "PolygonMemberType"), POLYGONMEMBERTYPE_TYPE); put(new NameImpl("http://www.opengis.net/gml", "MultiPolygonType"), MULTIPOLYGONTYPE_TYPE); put( new NameImpl("http://www.opengis.net/gml", "MultiPolygonPropertyType"), MULTIPOLYGONPROPERTYTYPE_TYPE); put( new NameImpl("http://www.opengis.net/gml", "MultiGeometryPropertyType"), MULTIGEOMETRYPROPERTYTYPE_TYPE);
@Override protected Schema buildTypeMappingProfile(Schema typeSchema) { Set profile = new LinkedHashSet(); profile.add(name(GML.PointPropertyType)); profile.add(name(GML.MultiPointPropertyType)); profile.add(name(GML.LineStringPropertyType)); profile.add(name(GML.MultiLineStringPropertyType)); profile.add(name(GML.PolygonPropertyType)); profile.add(name(GML.MultiPolygonPropertyType)); profile.add(name(GML.GeometryPropertyType)); return typeSchema.profile(profile); }
/** Adds a dependency on {@link GMLConfiguration} */ public OGCConfiguration() { super(OGC.getInstance()); addDependency(new GMLConfiguration()); }
/** * Configures the gml2 context. * * <p>The following classes are registered: * * <ul> * <li>{@link CoordinateArraySequenceFactory} under {@link CoordinateSequenceFactory} * <li>{@link GeometryFactory} * <li>{@link FeatureTypeCache} * <li>{@link DefaultFeatureCollections} * </ul> */ public void configureContext(MutablePicoContainer container) { super.configureContext(container); container.registerComponentInstance(new FeatureTypeCache()); container.registerComponentInstance( CoordinateSequenceFactory.class, CoordinateArraySequenceFactory.instance()); container.registerComponentImplementation(GeometryFactory.class); container.registerComponentImplementation(DefaultFeatureCollections.class); container.registerComponentInstance(srsSyntax); }
protected void addDependencies(Set dependencies) { dependencies.add(GML.getInstance()); }
@Override protected XSDSchema buildSchema() throws IOException { XSDSchema schema = super.buildSchema(); schema.resolveElementDeclaration(NAMESPACE, "_Feature") .eAdapters() .add(new SubstitutionGroupLeakPreventer()); schema.eAdapters().add(new ReferencingDirectiveLeakPreventer()); return schema; } }
@Override public void encode(ContentHandler output) throws Exception { Object value = ((PropertyType) object).getValue(); output.startElement(WFS.NAMESPACE, VALUE, "wfs:" + VALUE, new AttributesImpl()); if (value instanceof Geometry) { Encoder encoder = new Encoder(new org.geotools.gml2.GMLConfiguration()); encoder.setInline(true); encoder.encode(value, org.geotools.gml2.GML._Geometry, output); } else { String s = value.toString(); output.characters(s.toCharArray(), 0, s.length()); } output.endElement(WFS.NAMESPACE, VALUE, "wfs:" + VALUE); } };
protected void addDependencies(Set dependencies) { dependencies.add(GML.getInstance()); }
.add(new SubstitutionGroupLeakPreventer()); schema.eAdapters().add(new ReferencingDirectiveLeakPreventer()); return schema;