EGF Engine
Release 0.1.0

org.eclipse.egf.pattern.production.template
Class TemplateHelper

java.lang.Object
  extended by org.eclipse.egf.pattern.production.template.TemplateHelper

public class TemplateHelper
extends Object


Field Summary
protected static IPath GENERATED_TEMPLATES_IPATH
          Generated templates relative IPath.
protected static String GENERATED_TEMPLATES_PATH
          Generated templates relative path.
static IPath TEMPLATES_ROOT_IPATH
          Generated templates relative root IPath.
static String TEMPLATES_ROOT_PATH
          Generated templates relative root path.
 
Constructor Summary
TemplateHelper()
           
 
Method Summary
static IFolder getGeneratedPatternTemplateIFolder(IJavaProject javaProject_p, String patternShortId_p)
          Get generated template IFolder for given pattern short id.
static IFolder getGeneratedTemplateIFolder(IJavaProject javaProject_p)
          Get generated template IFolder for given project.
static String getPatternTemplatePath(PatternHandler.PatternData patternData_p)
          Get generated template file path for given pattern data.
static Couple<String,String> getPatternTemplatesFolderRelativePaths(String patternShortId_p, String pluginId_p)
          Get templates folder relative paths.
static String getPhysicalRelativePath(String logicalRelativePath_p)
          Get physical relative path from logical one.
static String getPhysicalRelativePath(String logicalRelativePath_p, String pluginId_p)
          Get physical relative path from logical given one.
static String getTemplateRelativePath(String patternShortId_p, String pluginId_p, String operationName_p, String operationId_p)
          Get template relative path for identified operation.
static IFolder getTemplateRootIFolder(IJavaProject javaProject_p)
          Get generated template root IFolder for given project.
static String readTemplateFile(String templateRelativePath_p)
          Read template file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEMPLATES_ROOT_PATH

public static final String TEMPLATES_ROOT_PATH
Generated templates relative root path.

See Also:
Constant Field Values

TEMPLATES_ROOT_IPATH

public static final IPath TEMPLATES_ROOT_IPATH
Generated templates relative root IPath.


GENERATED_TEMPLATES_PATH

protected static final String GENERATED_TEMPLATES_PATH
Generated templates relative path.

See Also:
Constant Field Values

GENERATED_TEMPLATES_IPATH

protected static final IPath GENERATED_TEMPLATES_IPATH
Generated templates relative IPath.

Constructor Detail

TemplateHelper

public TemplateHelper()
Method Detail

getTemplateRootIFolder

public static IFolder getTemplateRootIFolder(IJavaProject javaProject_p)
Get generated template root IFolder for given project.

Parameters:
javaProject_p -
Returns:

getGeneratedTemplateIFolder

public static IFolder getGeneratedTemplateIFolder(IJavaProject javaProject_p)
Get generated template IFolder for given project.

Parameters:
javaProject_p -
Returns:

getGeneratedPatternTemplateIFolder

public static IFolder getGeneratedPatternTemplateIFolder(IJavaProject javaProject_p,
                                                         String patternShortId_p)
Get generated template IFolder for given pattern short id.

Parameters:
javaProject_p -
patternShortId_p -
Returns:

getPatternTemplatePath

public static String getPatternTemplatePath(PatternHandler.PatternData patternData_p)
Get generated template file path for given pattern data.
Only usable for in-development patterns.
Deployed patterns templates should be dealt with differently.
TODO Guillaume Write a unique helper method that can deal with both cases.

Parameters:
patternData_p -
Returns:

readTemplateFile

public static String readTemplateFile(String templateRelativePath_p)
Read template file.

Parameters:
templateRelativePath_p - the template relative path, prefixed by the factory component id.
Returns:

getPhysicalRelativePath

public static String getPhysicalRelativePath(String logicalRelativePath_p)
Get physical relative path from logical one.

Parameters:
logicalRelativePath_p -
Returns:

getPhysicalRelativePath

public static String getPhysicalRelativePath(String logicalRelativePath_p,
                                             String pluginId_p)
Get physical relative path from logical given one.

Parameters:
logicalRelativePath_p -
pluginId_p -
Returns:

getTemplateRelativePath

public static String getTemplateRelativePath(String patternShortId_p,
                                             String pluginId_p,
                                             String operationName_p,
                                             String operationId_p)
Get template relative path for identified operation.

Parameters:
patternShortId_p -
pluginId_p -
operationName_p -
operationId_p -
Returns:

getPatternTemplatesFolderRelativePaths

public static Couple<String,String> getPatternTemplatesFolderRelativePaths(String patternShortId_p,
                                                                           String pluginId_p)
Get templates folder relative paths.

Parameters:
patternShortId_p -
pluginId_p -
Returns:
A couple of (User templates relative (to workspace) path, Generated templates relative (to workspace) path).

EGF Engine
Release 0.1.0

Copyright (c) Thales Corporate Services S.A.S, 2009.

This page is made available under license. For full details see the LEGAL in the documentation book that contains this page.