org.openbp.cockpit.generator
Class GeneratorMgr

java.lang.Object
  extended by org.openbp.cockpit.generator.GeneratorMgr

public final class GeneratorMgr
extends java.lang.Object

The generator manager maintains a list of generator descriptors. This class is a singleton.
Each descriptor defines a possible generation procedure for a particular item type (see Generator.
The descriptors are loaded from a the client's generator directory ($OpenBP/cockpit/generator).
The generators are grouped by the item type.

Author:
Andreas Putz

Method Summary
 Generator getGenerator(java.lang.String name)
          Retrieves the specified generator.
 java.util.List getGenerators(java.lang.String itemType, boolean createItem)
          Creates a sorted iterator of generators for a particular item type.
static GeneratorMgr getInstance()
          Gets the singleton instance of this class.
 void reload()
          Reload all generator infos and template sets.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static GeneratorMgr getInstance()
Gets the singleton instance of this class.


reload

public void reload()
Reload all generator infos and template sets.


getGenerator

public Generator getGenerator(java.lang.String name)
Retrieves the specified generator.

Parameters:
name - Name of the generator as defined in the generator descriptor
Returns:
The generator or null if not found

getGenerators

public java.util.List getGenerators(java.lang.String itemType,
                                    boolean createItem)
Creates a sorted iterator of generators for a particular item type.

Parameters:
itemType - The item type or null to retrieve a list of all generators
createItem - true: Returns only generators that create an item of the specified type.
false: Returns generator that operate on an existing type.
Returns:
A list of Generator objects


Copyright © 2011. All Rights Reserved.