ch.sahits.codegen.java.extensions
Class JavaGenerator

java.lang.Object
  extended by ch.sahits.codegen.java.extensions.JavaGenerator

public final class JavaGenerator
extends java.lang.Object

This class provides utilities to handle the extension point ch.sahits.codegen.java.generator

Since:
0.9.2
Author:
Andi Hotz

Constructor Summary
JavaGenerator()
           
 
Method Summary
static IBaseGenerator getGenerator(java.lang.String name)
          Deprecated. Use getGenerator(String, String) instead. Will be remove with 3.0
static IBaseGenerator getGenerator(java.lang.String bundle, java.lang.String className)
          Retrieve a generator instance from the extension registry
static java.util.Map<java.lang.String,java.lang.String> getGenerator4DisplaySelection()
          This methods retrieves the map of generates in the form .
static IClassGeneratorExtension getGeneratorExtension(java.lang.String bundle, java.lang.String className)
          Retrieve an class extension generator by bundle and class name
static java.lang.String[] getGenerators()
          Deprecated. Use the method getGenerator4DisplaySelection() instead. This method will be removed in 3.0
static IGeneratorCollection getJavaGenerators()
          Retrieve all registered jetemplates
static java.lang.String getPluginIdOfContibutingPlugin(java.lang.String generatorClass)
          Deprecated. with the use of getGenerator4DisplaySelection() this method is obsolete. This method will be removed with 3.0
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaGenerator

public JavaGenerator()
Method Detail

getJavaGenerators

public static IGeneratorCollection getJavaGenerators()
Retrieve all registered jetemplates

Returns:
Collection of jetemplates

getGeneratorExtension

public static IClassGeneratorExtension getGeneratorExtension(java.lang.String bundle,
                                                             java.lang.String className)
Retrieve an class extension generator by bundle and class name

Parameters:
bundle - bundle ID
className - generator class name
Returns:
Generator extension or null if the generator could not be resolved.

getGenerator

@Deprecated
public static IBaseGenerator getGenerator(java.lang.String name)
Deprecated. Use getGenerator(String, String) instead. Will be remove with 3.0

Retrieve the IBaseGenerator from the extension point. If there are more than one implementation for one and the same class registered, the first found in the registry is choosen.

Parameters:
name - of the class (full name)
Returns:
Instance of an generator or null if for the specified product no implementation is found.

getGenerators

@Deprecated
public static java.lang.String[] getGenerators()
Deprecated. Use the method getGenerator4DisplaySelection() instead. This method will be removed in 3.0

Retrieve a list of all generators registered as extension points

Returns:
Array of the class names

getGenerator4DisplaySelection

public static java.util.Map<java.lang.String,java.lang.String> getGenerator4DisplaySelection()
This methods retrieves the map of generates in the form . If the generator is a JET it is the location of the file else the class name. Each display name is unique. Should two generators have the same display name the second and all further will display the key as display name of the generator

Returns:
Map of generators

getGenerator

public static IBaseGenerator getGenerator(java.lang.String bundle,
                                          java.lang.String className)
Retrieve a generator instance from the extension registry

Parameters:
bundle - name of the bundel the generator is defined in
className - fully qualified class name of the generator
Returns:
Instance of the generator or null

getPluginIdOfContibutingPlugin

@Deprecated
public static java.lang.String getPluginIdOfContibutingPlugin(java.lang.String generatorClass)
Deprecated. with the use of getGenerator4DisplaySelection() this method is obsolete. This method will be removed with 3.0

Get the plugin id of the plugin that holds the template

Parameters:
generatorClass - name of the template to be looked up in the contributing extension points
Returns:
plugin id or null