public interface Schema extends Map<Name,AttributeType>
A schema is organized as a map of Name to AttributeType. In each name,type
tuple, the name matches the name of the type.
//create some attribute types
AttributeType pointType =
new AttributeTypeImpl( new NameImpl( "http://www.opengis.net/gml", "PointType" ), ... );
AttributeType lineStringType =
new AttributeTypeImpl( new NameImpl( "http://www.opengis.net/gml", "LineStringType" ), ... );
AttributeType polygonType =
new AttributeTypeImpl( new NameImpl( "http://www.opengis.net/gml", "PolygonType" ), ... );
//create a schema
Schema schema = new SchemaImpl( "http://www.opengis.net/gml" );
//add types to the schema
schema.add( pointType );
schema.add( lineStringType );
schema.add( polygonType );
The intention of a schema is to provide a resuable set of attribute types. These types are used when building attribute instances.
| Modifier and Type | Method and Description |
|---|---|
void |
add(AttributeType type)
Adds a type to the schema.
|
String |
getURI()
The uri of the schema.
|
Schema |
profile(Set<Name> profile)
Profiles the schema, creating a new schema in the process.
|
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesString getURI()
This method is a convenience for keySet().getURI().
void add(AttributeType type)
This method is a convenience for put(type.getName(),type).
type - The type to add.Schema profile(Set<Name> profile)
A profile of a schema is a subset of the schema, and it also a schema itself.
Used to select a subset of types for a specific application. Profiles often are used to express limitiations of a source of data.
profile - The set of names which corresond to entries that will make up the profile.Copyright © 1996–2021 Geotools. All rights reserved.