BUILDER
- The type to return from the builder methods. Subclasses
should type this as their own class type.CONTEXT
- The type of SiteMesh context used.RESULT
- The resulting type built by the builder.public abstract class BaseSiteMeshBuilder<BUILDER extends BaseSiteMeshBuilder,CONTEXT extends SiteMeshContext,RESULT> extends Object
BaseSiteMeshFilterBuilder
and
BaseSiteMeshOfflineBuilder
.BaseSiteMeshFilterBuilder
,
BaseSiteMeshOfflineBuilder
Modifier | Constructor and Description |
---|---|
protected |
BaseSiteMeshBuilder() |
Modifier and Type | Method and Description |
---|---|
BUILDER |
addDecoratorPath(String contentPath,
String decoratorPath)
Add a decorator path to be used for a specific content path.
|
BUILDER |
addDecoratorPaths(String contentPath,
List<String> decoratorPaths)
Add multiple decorator paths to be used for a specific content path.
|
BUILDER |
addDecoratorPaths(String contentPath,
String... decoratorPaths)
Add multiple decorator paths to be used for a specific content path.
|
BUILDER |
addTagRuleBundle(TagRuleBundle bundle)
Add a new
TagRuleBundle to the
TagBasedContentProcessor . |
BUILDER |
addTagRuleBundles(Iterable<TagRuleBundle> bundles)
Convenient way to call
addTagRuleBundle(org.sitemesh.content.tagrules.TagRuleBundle)
multiple times. |
BUILDER |
addTagRuleBundles(TagRuleBundle... bundles)
Convenient way to call
addTagRuleBundle(org.sitemesh.content.tagrules.TagRuleBundle)
multiple times. |
BUILDER |
clearTagRuleBundles()
Clear any TagRuleBundles (including those added in
setupDefaults() . |
abstract RESULT |
create() |
ContentProcessor |
getContentProcessor()
Get configured
ContentProcessor . |
DecoratorSelector<CONTEXT> |
getDecoratorSelector()
Get configured
DecoratorSelector . |
protected BUILDER |
self() |
BUILDER |
setCustomContentProcessor(ContentProcessor contentProcessor)
Set the
ContentProcessor . |
BUILDER |
setCustomDecoratorSelector(DecoratorSelector<CONTEXT> decoratorSelector)
Set a custom
DecoratorSelector . |
BUILDER |
setTagRuleBundles(Iterable<TagRuleBundle> bundles)
Set the TagRuleBundles.
|
BUILDER |
setTagRuleBundles(TagRuleBundle... bundles)
Set the TagRuleBundles.
|
protected void |
setupDefaults()
Setup default settings.
|
public abstract RESULT create() throws IllegalStateException
IllegalStateException
protected void setupDefaults()
TagBasedContentProcessor
with
CoreHtmlTagRuleBundle
and DecoratorTagRuleBundle
(the typical setup).protected BUILDER self()
public BUILDER addTagRuleBundle(TagRuleBundle bundle)
TagRuleBundle
to the
TagBasedContentProcessor
.
This will always append to the existing list of TagRuleBundles, created in
setupDefaults()
. To remove these defaults, use clearTagRuleBundles()
or setTagRuleBundles(TagRuleBundle[])
.
Note: If setCustomContentProcessor(ContentProcessor)
is called,
any TagRuleBundles are ignored, as they are only used by the default ContentProcessor
implementation.
public BUILDER addTagRuleBundles(TagRuleBundle... bundles)
addTagRuleBundle(org.sitemesh.content.tagrules.TagRuleBundle)
multiple times.
This will always append to the existing list of TagRuleBundles, created in
setupDefaults()
. To remove these defaults, use clearTagRuleBundles()
or setTagRuleBundles(TagRuleBundle[])
.
Note: If setCustomContentProcessor(ContentProcessor)
is called,
any TagRuleBundles are ignored, as they are only used by the default ContentProcessor
implementation.
public BUILDER addTagRuleBundles(Iterable<TagRuleBundle> bundles)
addTagRuleBundle(org.sitemesh.content.tagrules.TagRuleBundle)
multiple times.
This will always append to the existing list of TagRuleBundles, created in
setupDefaults()
. To remove these defaults, use clearTagRuleBundles()
or setTagRuleBundles(TagRuleBundle[])
.
Note: If setCustomContentProcessor(ContentProcessor)
is called,
any TagRuleBundles are ignored, as they are only used by the default ContentProcessor
implementation.
public BUILDER clearTagRuleBundles()
setupDefaults()
.public BUILDER setTagRuleBundles(TagRuleBundle... bundles)
clearTagRuleBundles()
followed by addTagRuleBundles(TagRuleBundle[])
.
Note: If setCustomContentProcessor(ContentProcessor)
is called,
any TagRuleBundles are ignored, as they are only used by the default ContentProcessor
implementation.
public BUILDER setTagRuleBundles(Iterable<TagRuleBundle> bundles)
clearTagRuleBundles()
followed by #addTagRuleBundles(Iterable)
.
Note: If setCustomContentProcessor(ContentProcessor)
is called,
any TagRuleBundles are ignored, as they are only used by the default ContentProcessor
implementation.
public BUILDER setCustomContentProcessor(ContentProcessor contentProcessor)
ContentProcessor
. If called, this will override
any calls to addTagRuleBundle(TagRuleBundle)
.public ContentProcessor getContentProcessor()
ContentProcessor
.public BUILDER addDecoratorPaths(String contentPath, String... decoratorPaths)
Note: If setCustomDecoratorSelector(DecoratorSelector)
is called,
any decorator paths are ignored, as they are only used by the default
DecoratorSelector implementation.
public BUILDER addDecoratorPaths(String contentPath, List<String> decoratorPaths)
Note: If setCustomDecoratorSelector(DecoratorSelector)
is called,
any decorator paths are ignored, as they are only used by the default
DecoratorSelector implementation.
public BUILDER addDecoratorPath(String contentPath, String decoratorPath)
Note: If setCustomDecoratorSelector(DecoratorSelector)
is called,
any decorator paths are ignored, as they are only used by the default
DecoratorSelector implementation.
public BUILDER setCustomDecoratorSelector(DecoratorSelector<CONTEXT> decoratorSelector)
DecoratorSelector
. If called and decorator selector is not
instance of PathBasedDecoratorSelector
, this will override any paths
added with addDecoratorPath(String, String)
and instead delegate to
the custom DecoratorSelector.public DecoratorSelector<CONTEXT> getDecoratorSelector()
DecoratorSelector
.Copyright © 2015. All Rights Reserved.