sk.uniba.euromath.gene
Class InstanceProvider

java.lang.Object
  extended by sk.uniba.euromath.gene.InstanceProvider

public final class InstanceProvider
extends Object

Provides instances of coordinators, exporters and graph builders.

Author:
Martin Vysny

Method Summary
 GraphNode getAdjustedGraph(TransformationInfo view, String coordinatorId)
          Tries to adjust given view to be able to get accepted by given coordinator.
 Set<String> getCoordinatorIds()
          Returns IDs of all registered coordinators (outputClassId).
 CoordinatorInfo getCoordinatorInfo(String coordinatorId)
          Returns the information about output document class.
 List<ExporterInfo> getExportersForNamespace(String namespace)
          Returns all registered exporters that are able to process given namespace.
 List<ExporterInfo> getExportersForNamespace(String namespace, EnumSet<ResultEnum> resultTypes)
          Returns all registered exporters that are able to process given namespace with given source type.
static InstanceProvider getInstance()
          Returns the singleton instance.
 ExportGraphBuilder newBuilder()
          Produces new graph builder.
 ICoordinator newCoordinator(String outputClassId, ICoordinatorFactory factory, XMLAccess xmlAccess)
           Returns the coordinator for given output class and prepares it for export.
 ICoordinator newCoordinator(String outputClassId, XMLAccess xmlAccess)
          Returns the coordinator for given output class and prepares it for export.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static InstanceProvider getInstance()
Returns the singleton instance.

Returns:
the instance of the object.

getExportersForNamespace

public List<ExporterInfo> getExportersForNamespace(String namespace)
Returns all registered exporters that are able to process given namespace.

Parameters:
namespace - source namespace
Returns:
list of exporters or null if no exporters are registered.

getExportersForNamespace

public List<ExporterInfo> getExportersForNamespace(String namespace,
                                                   EnumSet<ResultEnum> resultTypes)
Returns all registered exporters that are able to process given namespace with given source type.

Parameters:
namespace - source namespace.
resultTypes - all kinds of result types in which the document may be offered
Returns:
list of compatible exporters, never null - may be empty.

newBuilder

public ExportGraphBuilder newBuilder()
Produces new graph builder.

Returns:
the graph builder instance.

newCoordinator

public ICoordinator newCoordinator(String outputClassId,
                                   XMLAccess xmlAccess)
Returns the coordinator for given output class and prepares it for export. Returned coordinator instance is not yet configured.

Parameters:
outputClassId - the document class (coordinator id) that shall be produced.
xmlAccess - the instance of the document
Returns:
the coordinator instance

newCoordinator

public ICoordinator newCoordinator(String outputClassId,
                                   ICoordinatorFactory factory,
                                   XMLAccess xmlAccess)

Returns the coordinator for given output class and prepares it for export. Returned coordinator instance is not yet configured.

Serves primarily for instantiating custom coordinators, such as the editor framework coordinator.

Parameters:
outputClassId - the document class (coordinator id) that shall be produced.
xmlAccess - the instance of the document
factory - the factory producing the coordinator.
Returns:
the coordinator instance

getAdjustedGraph

public GraphNode getAdjustedGraph(TransformationInfo view,
                                  String coordinatorId)
Tries to adjust given view to be able to get accepted by given coordinator.

Parameters:
view - the transformation graph
coordinatorId - the export document class.
Returns:
adjusted transformation info instance, or null if the info cannot be adjusted. In such case, user should be queried for a new view object.

getCoordinatorInfo

public CoordinatorInfo getCoordinatorInfo(String coordinatorId)
Returns the information about output document class.

Parameters:
coordinatorId - the document class (coordinator identifier)
Returns:
The document class information. Never null.

getCoordinatorIds

public Set<String> getCoordinatorIds()
Returns IDs of all registered coordinators (outputClassId).

Returns:
set of ids.


Copyright 2003-2003-2006 null. All Rights Reserved.