public class DefaultSubComponentEvaluation extends Object implements SubComponentEvaluation
This is the default implementation of the SubComponentEvaluation interface. It is
used by the SubComponent.
| Constructor and Description |
|---|
DefaultSubComponentEvaluation(String id,
boolean renderIfEvaluated) |
| Modifier and Type | Method and Description |
|---|---|
void |
addEvaluator(String evaluatorId,
Map<String,String> evaluationParams,
boolean negate)
Adds a
SubComponentEvaluator along with the parameters that should be used to evaluate it to the
evaluator map. |
void |
addProperty(String name,
String value) |
boolean |
evaluate(RequestContext context,
org.springframework.context.ApplicationContext applicationContext)
Iterates over all the entries in the
evaluators map evaluating each one. |
String |
getId()
An evaluation should define an ID to help with debugging.
|
Map<String,String> |
getProperties() |
String |
getUri() |
boolean |
renderIfEvaluated()
Indicates whether or not the successful evaluation means that the
SubComponent should
be rendered or not. |
void |
setUri(String uri)
Sets the URI that should be used to render a
SubComponent if the evaluation passes. |
public DefaultSubComponentEvaluation(String id, boolean renderIfEvaluated)
public String getId()
SubComponentEvaluationgetId in interface SubComponentEvaluationpublic void setUri(String uri)
Sets the URI that should be used to render a SubComponent if the evaluation passes.
uri - The URI to set.public String getUri()
getUri in interface SubComponentEvaluationSubComponent if the evaluation passes.public Map<String,String> getProperties()
getProperties in interface SubComponentEvaluationpublic void addEvaluator(String evaluatorId, Map<String,String> evaluationParams, boolean negate)
Adds a SubComponentEvaluator along with the parameters that should be used to evaluate it to the
evaluator map.
evaluatorId - The id of a SubComponentEvaluator that should be used as part of the overall evaluation.evaluationParams - A Map of name/value parameters that should be passed to the SubComponentEvaluator when
evaluation is performed.negate - Indicates that the result of the evaluator should be negated (e.g. an evaluator returning false should
be converted to truepublic boolean evaluate(RequestContext context, org.springframework.context.ApplicationContext applicationContext)
Iterates over all the entries in the evaluators map evaluating each one.
evaluate in interface SubComponentEvaluationcontext - The current RequestContextapplicationContext - The ApplicationContext to use to look up the SubComponentEvaluator
instances from.true if all evaluators pass and false otherwise.public boolean renderIfEvaluated()
SubComponentEvaluationIndicates whether or not the successful evaluation means that the SubComponent should
be rendered or not. This should return false if the the <evaluation> XML configuration
includes has the attribute renderIfEvaluated set to the value "false".
renderIfEvaluated in interface SubComponentEvaluationtrue if this SubComponentEvaluation is configured for the purpose of providing
a rendering URL and false if it is configured for the purpose of preventing a SubComponent
from being rendered.Copyright © 2005–2016 Alfresco Software. All rights reserved.