org.geotoolkit.metadata
Class MetadataFactory
Object
Factory
MetadataFactory
@ThreadSafe
public class MetadataFactory
- extends Factory
Create metadata objects of the given Class using the properties given in a Map.
For any given type, this class tries to instantiate the metadata object in two ways:
First, if a collection of factories has been given to the constructor,
then this method will search for a create(Map, ...) method returning
an object assignable to the requested one. For example if the user requests a
VerticalCRS and this MetadataFactory has been
given a CRSFactory at construction time, then the
CRSFactory.createVerticalCRS(Map, ...) method will be used.
If no suitable factory is found, then MetadataFactory will try to instantiate
a metadata implementation directly using Class.newInstance(). The class can be an
interface like Citation or its implementation class
like DefaultCitation.
The keys in the map shall be the UML identifiers
or the Java Beans name of metadata properties,
for example "title" for the value to be returned by
Citation.getTitle().
- Since:
- 3.03
- Version:
- 3.03
- Author:
- Martin Desruisseaux (Geomatys)
- Module:
|
Method Summary |
|
create(Class<T> type,
Map<String,?> properties)
Creates a new metadata of the given type, initialized with the property values given in the
properties map. |
MetadataFactory
public MetadataFactory()
- Creates a new factory implementing the ISO 19115
standard and using the referencing factories known to
FactoryFinder.
MetadataFactory
public MetadataFactory(MetadataStandard... standards)
- Creates a new factory for the given metadata standards and the referencing factories
known to
FactoryFinder.
- Parameters:
standards - The metadata standards implemented by this factory.
MetadataFactory
public MetadataFactory(Set<?> factories,
MetadataStandard... standards)
- Creates a new factory for the given metadata standards. The given collection of
factories will be used if possible before to instantiate a metadata object directly.
- Parameters:
factories - The factories to try before to instantiate the metadata directly,
or null if none.standards - The metadata standards implemented by this factory.
create
public <T> T create(Class<T> type,
Map<String,?> properties)
throws FactoryException
- Creates a new metadata of the given type, initialized with the property values given in the
properties map.
- Type Parameters:
T - The parameterized type of the type argument.- Parameters:
type - The interface or implementation type of the metadata object to be created.properties - The property values to be given to the metadata object.
- Returns:
- A new metadata object of the given class or implementation, filled with the given values.
- Throws:
FactoryException - If the metadata object can not be created.
Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.