public class LinkTagRenderer extends Object implements TagRenderer
Constructor and Description |
---|
LinkTagRenderer() |
Modifier and Type | Method and Description |
---|---|
String |
doEndTag(Tag tag,
StringBuffer tagBody,
TransformContext context,
OutputDocument target)
Called whenever an ending Tag that is associated with the handler is encountered in TCDL content.
|
int |
doStartTag(Tag tag,
StringBuffer tagBody,
TransformContext context,
OutputDocument target)
Called whenever as starting Tag that is associated with the handler is encountered in TCDL content.
|
protected String |
generateBinaryLink(String binaryURI,
String theVariantId,
String linkAnchor,
String linkText,
String theLinkAttributes,
boolean linkTextOnFail,
boolean relativeLink)
Creating binary HTML link content based on input parameters.
|
protected String |
generateBinaryLink(String binaryURI,
String theVariantId,
String linkAnchor,
String linkText,
String theLinkAttributes,
boolean linkTextOnFail,
boolean relativeLink,
Tag tag)
Creating binary HTML link content based on input parameters.
|
boolean |
requiresCodeBlock(TransformContext context,
OutputDocument target,
Tag tag)
This method is called right before doStartTag and its return value indicates
if the engine must wrap the result of doEndTag inside a code block.
|
void |
setAddAnchor(String addAnchor) |
void |
setBinaryUrl(String binaryUrl) |
void |
setLinkAttributes(String linkAttributes) |
void |
setOrigin(String theOriginURI) |
void |
setParameters(String parameters) |
void |
setRequiredDestination(String requiredDestination) |
void |
setRequiredType(String requiredType) |
void |
setTemplateURI(String templateURI) |
void |
setTextOnFail(String textOnFail) |
void |
setVariantId(String variantId) |
public void setOrigin(String theOriginURI)
public void setRequiredDestination(String requiredDestination)
public void setBinaryUrl(String binaryUrl)
public void setTemplateURI(String templateURI)
public void setLinkAttributes(String linkAttributes)
public void setTextOnFail(String textOnFail)
public void setAddAnchor(String addAnchor)
public void setRequiredType(String requiredType)
public void setVariantId(String variantId)
public void setParameters(String parameters)
public int doStartTag(Tag tag, StringBuffer tagBody, TransformContext context, OutputDocument target)
TagHandlerBase
It is possible to prepend data to the tagContents using the [tagBody] buffer. The tagBody StringBuffer collects the content occurring (or generated by nested tags) between the start and closing tag.
doStartTag
in interface TagHandlerBase
tag
- The fully initialized tagtagBody
- Buffer that will be used by the framework to write tag content to.context
- TransformContext offering access to context attributestarget
- OutputDocument for setting supporting information to build the final documentpublic String doEndTag(Tag tag, StringBuffer tagBody, TransformContext context, OutputDocument target)
TagHandlerBase
Note that the Tag [tag] parameter will have all attributes set of the start tag (in fact it is the start tag), so all information of the tag is at your disposal.
doEndTag
in interface TagHandlerBase
tag
- The fully initialized tagtagBody
- Buffer that will be used by the framework to write tag content to.context
- TransformContext offering access to context attributestarget
- OutputDocument for setting supporting information to build the final documentpublic boolean requiresCodeBlock(TransformContext context, OutputDocument target, Tag tag)
TagHandlerBase
The start [tag] is passed, so the handler may use attribute values to decide upon it's result
requiresCodeBlock
in interface TagHandlerBase
context
- TransformContext offering access to context attributestarget
- OutputDocument for setting supporting information to build the final documenttag
- The fully initialized tagprotected String generateBinaryLink(String binaryURI, String theVariantId, String linkAnchor, String linkText, String theLinkAttributes, boolean linkTextOnFail, boolean relativeLink, Tag tag)
binaryURI
- Binary URI.theVariantId
- Variant identifier.linkAnchor
- Link anchor.linkText
- Link text.theLinkAttributes
- Link attributes.linkTextOnFail
- Text to be shown if link can not be rendered.tag
- Tag (tcdl:Link) which is supposed to be replacedprotected String generateBinaryLink(String binaryURI, String theVariantId, String linkAnchor, String linkText, String theLinkAttributes, boolean linkTextOnFail, boolean relativeLink)
binaryURI
- Binary URI.theVariantId
- Variant identifier.linkAnchor
- Link anchor.linkText
- Link text.theLinkAttributes
- Link attributes.linkTextOnFail
- Text to be shown if link can not be rendered.Copyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries