Package org.opengis.example.metadata
Class MetadataProxyFactory
- Object
-
- MetadataProxyFactory
-
public class MetadataProxyFactory extends Object
A factory of metadata objects implemented by JavaProxy
. The metadata values are specified by aMap
of attributes in which keys are UML identifiers, and values must be assignable to the return value of the corresponding GeoAPI methods.Example: create an
Individual
instance:
The metadata proxy are live, i.e. any change to the maps of attributes will be immediately reflected in the values returned by the metadata objects.Map<String,Object> attributes = new HashMap<String,Object>(); attributes.put("name", new SimpleInternationalString("Aristotle")); Individual party = factory.create(Individual.class, attributes);
- Since:
- 3.1
-
-
Method Detail
-
create
public <T> T create(Class<T> type, Map<String,?> attributes) throws IllegalArgumentException
Creates a new implementation of the given metadata interface which will contains the values in the given map. The returned metadata proxy is live, i.e. any change to the given map of attributes will be immediately reflected in the values returned by the metadata object.- Type Parameters:
T
- the compile-time type of thetype
argument.- Parameters:
type
- the metadata interface for which to get an instance.attributes
- the attribute values to give to the metadata instance.- Returns:
- a metadata object which will fetch the values in the given map.
- Throws:
IllegalArgumentException
- if the given type is not an interface from the GeoAPI metadata package.
-
-