public interface Transformer
Modifier and Type | Method and Description |
---|---|
StringBuffer |
assembleContent(StringBuffer body,
TransformContext context)
Deprecated.
Assembles all of the transformed content, and turns it into a page,
by adding the first line and header and footer to the body.
|
StringBuffer |
getContentsFromTag(TCDLTag currentTag,
String inputItem,
TransformContext context)
Deprecated.
This is a recursive function which reads the contents of a particular tag,
then goes through all child tags this tag has, calling the necessary transformer
to deal with the contents of the tag.
|
StringBuffer |
startProcessingItem(String inputItem,
TreeMap dataModel,
TransformContext transformContext)
Deprecated.
This is the entry point for transforming a text containing TCDL.
|
StringBuffer |
transformFooter(StringBuffer footer)
Deprecated.
Generate the final output of a footer for a TransformContext.
|
StringBuffer |
transformHeader(StringBuffer header)
Deprecated.
Generate the final output of a Header for a TransformContext.
|
String |
transformTag(TCDLTag tag,
TransformContext context)
Deprecated.
This is the method which will transforms the attributes and contents of the tag into the configured target output
language.
|
StringBuffer assembleContent(StringBuffer body, TransformContext context)
body
- The transformed contents of the input file.context
- The TransformContext containing the Context associated with this input file.StringBuffer getContentsFromTag(TCDLTag currentTag, String inputItem, TransformContext context)
currentTag
- A TCDLTag which you want to transform.inputItem
- A string from which to copy the non-transformable parts from.StringBuffer startProcessingItem(String inputItem, TreeMap dataModel, TransformContext transformContext)
TransformProcessor
, based on the file which it is processing.
This method scans the file, copying everything not contained in tags,
and transforming the rest, based on the Data Model created by the TCDLParser
.
It also updates the TransformContext
,
ensuring that the correct headers and footers are generated.inputItem
- A string containing the file to be processed.dataModel
- A TreeMap containing TCDLTags, forming a representation of the data model generated by the TCDL.transformContext
- The context of the item being processed. This can be used to generate the correct
headers and footers.StringBuffer transformFooter(StringBuffer footer)
footer
- The contents of the footer.StringBuffer transformHeader(StringBuffer header)
header
- The contents of the header.String transformTag(TCDLTag tag, TransformContext context)
AbstractTransformer
class from the TransformProcessor,
and then calls the appropriate
transformer method for the tag, based on the name
field. The attributes
field is
passed to the appropriate transformer method, together with the tagContents
field. The
AbstractTransformer
class
then returns a formatted string.Copyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries