Object
MetadataProxyFactory
A factory of metadata objects implemented by Java
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.
Proxy
. The metadata values are
specified by a Map
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:
Map<String,Object> attributes = new HashMap<String,Object>();
attributes.put("name", new SimpleInternationalString("Aristotle"));
Individual party = factory.create(Individual.class, attributes);
- Since:
- 3.1
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
MetadataProxyFactory
public MetadataProxyFactory()Creates a new factory.
-
-
Method Details
-
create
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.
-