ch.sahits.codegen.model
Class Config

java.lang.Object
  extended by ch.sahits.codegen.model.Config
All Implemented Interfaces:
IJetGatewayConfiguration

public class Config
extends java.lang.Object
implements IJetGatewayConfiguration

Meta-data for code generation. This class is immutable. It is initialized through a Builder that is retrieved from the ImmutableObjectFactory

Since:
0.9.0
Author:
Andi Hotz, Sahits GmbH

Method Summary
 boolean equals(java.lang.Object obj)
          All members of this class are compared unless mProject (which) has no equals defined and mForceOverwrite which is always true
 java.lang.String getClasspathVariable()
          Returns the classpath variable name to bind to the first jar in the plugin identified by getPluginId().
protected  java.lang.String getJetTemplatePluginID()
          Retrieve the plugin id of the plugin in which the jetemplate resides in.
 java.lang.Object getModel()
          Returns the model object to pass to the JET template.
 java.lang.String getPackageName()
          Returns the package name of the resource to generate.
 java.lang.String getPluginId()
          Returns the plugin id of the plugin containing the JET template file, the JMerge control model XML file, and the runtime library JAR file containing any classes necessary to compile the translated JET template implementation class.
 IProject getProject()
           
 java.lang.String getTargetFile()
          Returns the file name of the file where the generated code should be saved.
 java.lang.String getTargetFolder()
          Returns the target folder (relative to the workspace root) where the generated code should be saved.
 java.lang.String getTemplateFullUri()
          Returns the full URI of the JET template.
 java.lang.String getTemplateRelativeUri()
          Returns the relative uri of the JET template file.
 int hashCode()
          compute the hash code based on all fields unless mProject and mForceOverwrite which are excluded from equals(Object)
 boolean isBundledRecource()
          Check wether the requested Resource is in the bundle
 boolean isForceOverwrite()
          Returns whether existing read-only files should be overwritten.
 java.util.List<java.lang.String> plugInIDs()
          Retrieve the list of plug-ins needed for the classpath
 java.lang.String toString()
          Compile the virtual data into a string
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getModel

public java.lang.Object getModel()
Returns the model object to pass to the JET template.

Specified by:
getModel in interface IJetGatewayConfiguration
Returns:
the model object to pass to the JET template

getPluginId

public java.lang.String getPluginId()
Returns the plugin id of the plugin containing the JET template file, the JMerge control model XML file, and the runtime library JAR file containing any classes necessary to compile the translated JET template implementation class.

Specified by:
getPluginId in interface IJetGatewayConfiguration
Returns:
the plugin id

getTemplateRelativeUri

public java.lang.String getTemplateRelativeUri()
Returns the relative uri of the JET template file.

Specified by:
getTemplateRelativeUri in interface IJetGatewayConfiguration
Returns:
the relative uri of the JET template file

getTargetFolder

public java.lang.String getTargetFolder()
Returns the target folder (relative to the workspace root) where the generated code should be saved.

Specified by:
getTargetFolder in interface IJetGatewayConfiguration
Returns:
the target folder (relative to the workspace root) where the generated code should be saved

getPackageName

public java.lang.String getPackageName()
Returns the package name of the resource to generate.

Specified by:
getPackageName in interface IJetGatewayConfiguration
Returns:
the package name of the resource to generate

isForceOverwrite

public boolean isForceOverwrite()
Returns whether existing read-only files should be overwritten. This method returns true by default.

Specified by:
isForceOverwrite in interface IJetGatewayConfiguration
Returns:
whether existing read-only files should be overwritten

getTemplateFullUri

public java.lang.String getTemplateFullUri()
Returns the full URI of the JET template. This URI is found by appending the relative template URI to the installation URI of the plugin specified by the plugin id.

Specified by:
getTemplateFullUri in interface IJetGatewayConfiguration
Returns:
the full URI of the JET template

getJetTemplatePluginID

protected java.lang.String getJetTemplatePluginID()
Retrieve the plugin id of the plugin in which the jetemplate resides in. This is done by walking through all the contibuting plugins and trying to open an InputStream.

Returns:
id of the plugin where the jetemplate resides in or null if the plugin could not be found

getTargetFile

public java.lang.String getTargetFile()
Returns the file name of the file where the generated code should be saved.

Specified by:
getTargetFile in interface IJetGatewayConfiguration
Returns:
the file name of the file where the generated code should be saved

getClasspathVariable

public java.lang.String getClasspathVariable()
Returns the classpath variable name to bind to the first jar in the plugin identified by getPluginId().

Specified by:
getClasspathVariable in interface IJetGatewayConfiguration
Returns:
classpath variable name

getProject

public IProject getProject()
Specified by:
getProject in interface IJetGatewayConfiguration
Returns:
the mProject

isBundledRecource

public boolean isBundledRecource()
Check wether the requested Resource is in the bundle

Specified by:
isBundledRecource in interface IJetGatewayConfiguration
Returns:
the mBundledRecource

plugInIDs

public java.util.List<java.lang.String> plugInIDs()
Retrieve the list of plug-ins needed for the classpath

Specified by:
plugInIDs in interface IJetGatewayConfiguration
Returns:
List of plug-in IDs
Since:
1.2.0

hashCode

public int hashCode()
compute the hash code based on all fields unless mProject and mForceOverwrite which are excluded from equals(Object)

Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

equals

public boolean equals(java.lang.Object obj)
All members of this class are compared unless mProject (which) has no equals defined and mForceOverwrite which is always true

Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

toString

public java.lang.String toString()
Compile the virtual data into a string

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()