Package org.eclipse.cdt.core.templateengine

## Class TemplateEngineHelper

- java.lang.Object
- - org.eclipse.cdt.core.templateengine.TemplateEngineHelper

    public class TemplateEngineHelper
    extends Object

Acts as an Helper class for Template Engine

Since:
  4.0

### Field Summary

Fields
`static String` `BOOLTRUE`
`static String` `CLOSE_MARKER`
`static String` `EXTRA_PAGES_PROVIDER`
`static String` `FILTER_PATTERN`
`static String` `ID`
`static String` `IS_CATEGORY`
`static String` `LOCATION`
`static String` `LOGGER_FILE_NAME`
`static String` `OPEN_MARKER`
`static String` `PLUGIN_ID`
`static String` `PLUGIN_PROPERTIES`
`static String` `PROJECT_TYPE`
`static String` `PROJRESOURCE`
`static String` `SDLOG_FILE_NAME`
`static String` `STRING_EXTERNALIZATION_MARKER`
`static String` `TEMPLATE_PROPERTIES`
`static String` `TOOL_CHAIN`
`static String` `US`
`static String` `USAGE_DESCRIPTION`
`static String` `VALUE`
`static String` `WIZARD_ID`

### Constructor Summary

Constructors
`TemplateEngineHelper()`

### Method Summary

All Methods Static Methods Concrete Methods
`static boolean` `checkDirectoryInWorkspace​(String directoryName)` Check whether there is a directory existing in present workspace, with the given name.
`static String` `externalizeTemplateString​(String pluginId, String location, String key)`
`static String` `externalizeTemplateString​(TemplateInfo ti, String key)`
`static String` `getFirstMarkerID​(String markerString)`
`static File` `getSharedDefaultLocation​(String sharedLocation)` Gets the backup shareddefaults XML file.
`static URL` `getTemplateResourceURL​(String pluginId, String resourcePath)` Return Template Source path as URL
`static URL` `getTemplateResourceURLRelativeToTemplate​(TemplateCore template, String resourcePath)` Returns the Template Resource Relative Path as URL
`static org.eclipse.core.runtime.IPath` `getWorkspacePath()` This method returns the workspace path present in the workspace
`static File` `storeSharedDefaultLocation​(String sharedLocation)` Stores the shareddefaults xml file in "${workspace}/.metadata/.plugins/${plugin.name}/shareddefaults.xml" path.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### US

    public static final String US

See Also:
  Constant Field Values

#### OPEN_MARKER

    public static final String OPEN_MARKER

See Also:
  Constant Field Values

#### CLOSE_MARKER

    public static final String CLOSE_MARKER

See Also:
  Constant Field Values

#### STRING_EXTERNALIZATION_MARKER

    public static final String STRING_EXTERNALIZATION_MARKER

See Also:
  Constant Field Values

#### LOGGER_FILE_NAME

    public static final String LOGGER_FILE_NAME

See Also:
  Constant Field Values

#### PROJRESOURCE

    public static final String PROJRESOURCE

See Also:
  Constant Field Values

#### PLUGIN_ID

    public static final String PLUGIN_ID

See Also:
  Constant Field Values

#### PLUGIN_PROPERTIES

    public static final String PLUGIN_PROPERTIES

See Also:
  Constant Field Values

#### TEMPLATE_PROPERTIES

    public static final String TEMPLATE_PROPERTIES

See Also:
  Constant Field Values

#### BOOLTRUE

    public static final String BOOLTRUE

See Also:
  Constant Field Values

#### ID

    public static final String ID

See Also:
  Constant Field Values

#### VALUE

    public static final String VALUE

See Also:
  Constant Field Values

#### SDLOG_FILE_NAME

    public static final String SDLOG_FILE_NAME

See Also:
  Constant Field Values

#### LOCATION

    public static final String LOCATION

See Also:
  Constant Field Values

#### WIZARD_ID

    public static final String WIZARD_ID

See Also:
  Constant Field Values

#### FILTER_PATTERN

    public static final String FILTER_PATTERN

See Also:
  Constant Field Values

#### USAGE_DESCRIPTION

    public static final String USAGE_DESCRIPTION

See Also:
  Constant Field Values

#### PROJECT_TYPE

    public static final String PROJECT_TYPE

See Also:
  Constant Field Values

#### TOOL_CHAIN

    public static final String TOOL_CHAIN

See Also:
  Constant Field Values

#### EXTRA_PAGES_PROVIDER

    public static final String EXTRA_PAGES_PROVIDER

See Also:
  Constant Field Values

#### IS_CATEGORY

    public static final String IS_CATEGORY

See Also:
  Constant Field Values

### Constructor Detail

#### TemplateEngineHelper

    public TemplateEngineHelper()

### Method Detail

#### getSharedDefaultLocation

    public static File getSharedDefaultLocation​(String sharedLocation)

Gets the backup shareddefaults XML file. Presence of the file indicates that the template engine or the application underwent some crash or destruction.

Parameters:
  `sharedLocation` -
Returns:
  sharedXMLFile
Since:
  4.0

#### storeSharedDefaultLocation

    public static File storeSharedDefaultLocation​(String sharedLocation)

Stores the shareddefaults xml file in "${workspace}/.metadata/.plugins/${plugin.name}/shareddefaults.xml" path.

Parameters:
  `sharedLocation` - the relative path within the plug-in
Returns:
  a File object corresponding to the location within the plug-in
Since:
  4.0

#### getWorkspacePath

    public static org.eclipse.core.runtime.IPath getWorkspacePath()

This method returns the workspace path present in the workspace

Returns:
  String Example : file:/C:/eclipse/workspace/
Since:
  4.0

#### getFirstMarkerID

    public static String getFirstMarkerID​(String markerString)

Parameters:
  `markerString` -
Returns:
  the first content of a region matching $(.*) e.g. given a String of the form "foo $(ID) bar", return ID.
Since:
  4.0

#### checkDirectoryInWorkspace

    public static boolean checkDirectoryInWorkspace​(String directoryName)

Check whether there is a directory existing in present workspace, with the given name.

Parameters:
  `directoryName` -
Returns:
  true, if directory exists.
Since:
  4.0

#### getTemplateResourceURL

    public static URL getTemplateResourceURL​(String pluginId,
                                             String resourcePath)
                                      throws IOException

Return Template Source path as URL

Parameters:
  `pluginId` -
  `resourcePath` -
Returns:
  URL, of the Template Resource
Throws:
  `IOException`
Since:
  4.0

#### getTemplateResourceURLRelativeToTemplate

    public static URL getTemplateResourceURLRelativeToTemplate​(TemplateCore template,
                                                               String resourcePath)
                                                        throws IOException

Returns the Template Resource Relative Path as URL

Parameters:
  `template` -
  `resourcePath` -
Returns:
  URL, of the Template Resource
Throws:
  `IOException`
Since:
  4.0

#### externalizeTemplateString

    public static String externalizeTemplateString​(TemplateInfo ti,
                                                   String key)

#### externalizeTemplateString

    public static String externalizeTemplateString​(String pluginId,
                                                   String location,
                                                   String key)