public abstract class AbstractContentRewriter<T> extends Object implements ContentRewriter<T>
An abstract adapter class for ContentRewriter
.
The methods in this class are empty.
This class exists as convenience for creating ContentRewriter
objects.
Constructor and Description |
---|
AbstractContentRewriter() |
Modifier and Type | Method and Description |
---|---|
ImageVariant |
getImageVariant() |
boolean |
isCanonicalLinks() |
boolean |
isFullyQualifiedLinks() |
T |
rewrite(T content,
HstRequestContext requestContext)
Rewrites the
content with HstRequestContext . |
T |
rewrite(T content,
javax.jcr.Node contentNode,
HstRequestContext requestContext)
Rewrites the
content for Node contentNode . |
T |
rewrite(T content,
javax.jcr.Node contentNode,
HstRequestContext requestContext,
Mount targetMount)
Rewrites the content of the content node.
|
T |
rewrite(T content,
javax.jcr.Node contentNode,
HstRequestContext requestContext,
String targetMountAlias)
Rewrites the content of the content node.
|
void |
setCanonicalLinks(boolean canonicalLinks) |
void |
setFullyQualifiedLinks(boolean fullyQualifiedLinks)
Sets whether this
ContentRewriter should create fully qualified links (URLs) for internal links. |
void |
setImageVariant(ImageVariant imageVariant)
Sets whether this
ContentRewriter should use an imageVariant. |
public T rewrite(T content, HstRequestContext requestContext)
ContentRewriter
content
with HstRequestContext
. Since there is no contentNode
param as is for ContentRewriter.rewrite(Object, javax.jcr.Node, org.hippoecm.hst.core.request.HstRequestContext)
this
method typically cannot translate internal links in the content
rewrite
in interface ContentRewriter<T>
public T rewrite(T content, javax.jcr.Node contentNode, HstRequestContext requestContext)
ContentRewriter
content
for Node
contentNode
.rewrite
in interface ContentRewriter<T>
content
- content object. It can be type of String or whatever, depending on the implementation and the context.contentNode
- the Node
that contains the content
requestContext
- the HstRequestContext
T
public T rewrite(T content, javax.jcr.Node contentNode, HstRequestContext requestContext, String targetMountAlias)
ContentRewriter
rewrite
in interface ContentRewriter<T>
public T rewrite(T content, javax.jcr.Node contentNode, HstRequestContext requestContext, Mount targetMount)
ContentRewriter
rewrite
in interface ContentRewriter<T>
public void setFullyQualifiedLinks(boolean fullyQualifiedLinks)
ContentRewriter
ContentRewriter
should create fully qualified links (URLs) for internal links.setFullyQualifiedLinks
in interface ContentRewriter<T>
public boolean isFullyQualifiedLinks()
isFullyQualifiedLinks
in interface ContentRewriter<T>
true
when fully qualified links (URLs) should be createdpublic void setCanonicalLinks(boolean canonicalLinks)
setCanonicalLinks
in interface ContentRewriter<T>
canonicalLinks
- when true
this ContentRewriter
will return canonical links for internal linkspublic boolean isCanonicalLinks()
isCanonicalLinks
in interface ContentRewriter<T>
true
when canonical links should be created for internal linkspublic void setImageVariant(ImageVariant imageVariant)
ContentRewriter
ContentRewriter
should use an imageVariant.setImageVariant
in interface ContentRewriter<T>
public ImageVariant getImageVariant()
getImageVariant
in interface ContentRewriter<T>
ContentRewriter.setImageVariant(ImageVariant)
or null
when
no image variant was setCopyright © 2008–2016 Hippo B.V. (http://www.onehippo.com). All rights reserved.