Class TemplateEngine
java.lang.Object
org.eclipse.cdt.core.templateengine.TemplateEngine
- Direct Known Subclasses:
TemplateEngine2
TemplateEngine is implemented as a Singleton. TemplateEngine is responsible for
creating SharedDefaults and initialising the SharedDefaults. Template instances
are obtained from TemplateEngine.
- Since:
- 4.0
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetChildrenOfElement
(Element element) Returns the Children of the Element.getChildrenOfElementByTag
(Element element, String tag) Returns the child elements by Tagstatic TemplateEngine
create the singleton instance, check for null condition of TEMPLATE_ENGINE.getFirstTemplate
(String projectType) Equivalent to calling the overloaded version of getFirstTemplate with null arguments for toolChain and usageFilter.getFirstTemplate
(String projectType, String toolChain, String usageFilter) Returns the first template defined for the specified parametersgetTemplateById
(String templateId) getTemplateInfos
(String projectType) getTemplateInfos
(String projectType, String toolChain) getTemplateInfos
(String projectType, String toolChain, String usageFilter) Gets an array of template info objects matching the criteria passed as parameters.Returns all the TemplateCore objects, no filtering is done.getTemplates
(String projectType) getTemplates
(String projectType, String toolChain) getTemplates
(String projectType, String toolChain, String usageFilter) This method will be called by Container UIs (Wizard, PropertyPage, PreferencePage).Returns the Template Schema URLvoid
updateSharedDefaults
(TemplateCore template) update The SharedDefaults Map.
-
Field Details
-
TEMPLATES_EXTENSION_ID
-
TEMPLATE_ASSOCIATIONS_EXTENSION_ID
-
-
Method Details
-
getTemplates
Returns all the TemplateCore objects, no filtering is done. -
getFirstTemplate
Returns the first template defined for the specified parameters- Parameters:
projectType
- may not be nulltoolChain
- may be null to indicate no tool-chain filteringusageFilter
- a regex in java.util.regex.Pattern format, may be null to indicate no filtering- Returns:
- the TemplateCore for the first template defined for the specified parameters, or null if no such definition exists, or if there is an error initializing the template (the error will be logged).
- See Also:
-
getFirstTemplate
Equivalent to calling the overloaded version of getFirstTemplate with null arguments for toolChain and usageFilter.- Returns:
- the first TemplateCore object registered, or null if this does not exist
- See Also:
-
getTemplates
This method will be called by Container UIs (Wizard, PropertyPage, PreferencePage). Create a Template instance, update the ValueStore, with SharedDefaults. This method calls the getTemplate(URL), after getting URL for the given String TemplateDescriptor. -
getTemplates
-
getTemplates
-
getTemplateById
-
getDefault
create the singleton instance, check for null condition of TEMPLATE_ENGINE. If TEMPLATE_ENGINE is null create the TemplateEngine instance assign it to TEMPLATE_ENGINE. There is no need to have synchronized here(while creating TemplateEngine).- Returns:
- TEMPLATE_ENGINE, instance of TemplateEngine.
- Since:
- 4.0
-
getTemplateInfos
Gets an array of template info objects matching the criteria passed as parameters.- Parameters:
projectType
- may not be nulltoolChain
- may be null to indicate no tool-chainusageFilter
- a usage string which is matched against the filter from the template, may be null to indicate no usage filtering- Returns:
- an array of TemplateInfo objects (never null)
-
getTemplateInfos
-
getTemplateInfos
-
getTemplateInfos
- Returns:
- all TemplateInfo objects known to the TemplateEngine
-
getTemplateInfoMap
- Returns:
- the map from project-type ID's to all associated TemplateInfo instances
-
getTemplateSchemaURL
Returns the Template Schema URL- Returns:
- URL of the Template Schema.
- Throws:
IOException
-
getChildrenOfElement
Returns the Children of the Element.- Parameters:
element
-- Returns:
- List of the child elements
- Since:
- 4.0
-
getChildrenOfElementByTag
Returns the child elements by Tag- Parameters:
element
-tag
-- Returns:
- List of child elements
- Since:
- 4.0
-