| java.lang.Object com.xoetrope.template.XTemplateEngine
All known Subclasses: com.xoetrope.carousel.catalog.XCustomJavaTemplateEngine, com.xoetrope.carousel.catalog.XCustomXmlTemplateEngine,
XTemplateEngine | public class XTemplateEngine (Code) | | An engine for processing templates containing paramaterized resources.
Copyright (c) Xoetrope Ltd., 2001-2007, This software is licensed under
the GNU Public License (GPL), please see license.txt for more details. If
you make commercial use of this software you must purchase a commercial
license from Xoetrope.
$Revision: 1.5 $
|
Method Summary | |
public Object | evaluateAttribute(String attribValue) Evaluates an attribute value. | public String | getContent(String key) | public HashMap | getContents(XTemplateProcessor tp) | public HashMap | getIncludes(XTemplateProcessor tp) | public XTemplateProcessor | getProcessor(String sourceName, int processingType) | public String | getTargetResourceName(String sourcePattern, String sourceName, String targetPattern, int processingType) Get the name of the resource when processed
Parameters: sourcePattern - the pattern used to find the source file, the file name may contain wildcard characters Parameters: sourceName - the actual resource to process Parameters: targetPattern - the resource name/pattern following processing, the file name may contain wildcard characters, but they should match the pattern of the sourceResource argument. | public boolean | includes(String elementName) | public int | process(String[] sourceResources) Process the template resources.
Parameters: sourceResources - the resources to process, the file names may contain wildcard characters Parameters: targetResources - the resources name following processing, the file names may contain wildcard characters, but they should match the pattern of the sourceResource argument. | public int | process(String[] sourceResources, String[] targetResources, int[] processingTypes) Process the template resources.
Parameters: sourceResources - the resources to process, the file names may contain wildcard characters Parameters: targetResources - the resources name following processing, the file names may contain wildcard characters, but they should match the pattern of the sourceResource argument. | public void | putContent(String key, String value) |
currentProject | protected XProject currentProject(Code) | | |
evaluator | protected XDefaultAttributeEvaluator evaluator(Code) | | |
sourceDirtargetDir | protected File sourceDirtargetDir(Code) | | |
XTemplateEngine | public XTemplateEngine(XProject proj, String source, String target)(Code) | | Creates a new instance of TemplateEngine
Parameters: proj - the owner project Parameters: source - the source folder for the templates Parameters: target - the target folder for the template output |
evaluateAttribute | public Object evaluateAttribute(String attribValue)(Code) | | Evaluates an attribute value. An attribute may be a value or a method call.
If brackets are part of the value it is assumed that a method call is
intended. The method call is indicated by the '$' symbol e.g. ${myMethod()}
Parameters: attribValue - the raw attribute value the evaluated attribute |
getProcessor | public XTemplateProcessor getProcessor(String sourceName, int processingType)(Code) | | Get the processor for a particular type
Parameters: sourceName - the resource name Parameters: processingType - the processing instruction the appropriate Processor |
getTargetResourceName | public String getTargetResourceName(String sourcePattern, String sourceName, String targetPattern, int processingType)(Code) | | Get the name of the resource when processed
Parameters: sourcePattern - the pattern used to find the source file, the file name may contain wildcard characters Parameters: sourceName - the actual resource to process Parameters: targetPattern - the resource name/pattern following processing, the file name may contain wildcard characters, but they should match the pattern of the sourceResource argument. Parameters: processingType - the type of processing the new resource name |
includes | public boolean includes(String elementName)(Code) | | Include a given element
Parameters: elementName - the name of the element true if the element is included, false if it is to be excluded. |
process | public int process(String[] sourceResources)(Code) | | Process the template resources.
Parameters: sourceResources - the resources to process, the file names may contain wildcard characters Parameters: targetResources - the resources name following processing, the file names may contain wildcard characters, but they should match the pattern of the sourceResource argument. The number of array elements should also match that of the sourceResource. A null value may be passed for an element or for the argument, in which case the getTargetResourceNameshould fixup the resource name. zero if processing is sucessful or a positive integer if processing is completed, but with warnings, and a negative value if an error occursthat prevents complete processing |
process | public int process(String[] sourceResources, String[] targetResources, int[] processingTypes)(Code) | | Process the template resources.
Parameters: sourceResources - the resources to process, the file names may contain wildcard characters Parameters: targetResources - the resources name following processing, the file names may contain wildcard characters, but they should match the pattern of the sourceResource argument. The number of array elements should also match that of the sourceResource. A null value may be passed for an element or for the argument, in which case the getTargetResourceNameshould fixup the resource name. Parameters: processingType - the type of processing zero if processing is sucessful or a positive integer if processing is completed, but with warnings, and a negative value if an error occursthat prevents complete processing |
|
|