org.geotoolkit.metadata
Class MetadataFactory

Object
  extended by Factory
      extended by 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:

Since:
3.03
Version:
3.03
Author:
Martin Desruisseaux (Geomatys)
Module:
metadata/geotk-metadata (download)    View source code for this class

Nested Class Summary
 
Nested classes/interfaces inherited from class Factory
Factory.Availability, Factory.Organizer
 
Field Summary
 
Fields inherited from class Factory
EMPTY_HINTS, hints
 
Constructor Summary
MetadataFactory()
          Creates a new factory implementing the ISO 19115 standard and using the referencing factories known to FactoryFinder.
MetadataFactory(MetadataStandard... standards)
          Creates a new factory for the given metadata standards and the referencing factories known to FactoryFinder.
MetadataFactory(Set<?> factories, MetadataStandard... standards)
          Creates a new factory for the given metadata standards.
 
Method Summary
<T> T
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.
 
Methods inherited from class Factory
availability, dispose, equals, getImplementationHints, hasCompatibleHints, hashCode, setOrdering, toString
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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.
Method Detail

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.