@Retention(value=RUNTIME) @Target(value=TYPE) public @interface Exclude
@Exclude @Exclude(ifProjectStage=Production.class) @Exclude(exceptIfProjectStage=UnitTest.class) @Exclude(onExpression="myProperty==myValue") @Exclude(onExpression="[my custom expression syntax]", interpretedBy=CustomExpressionInterpreter.class)examples:
the following bean gets excluded in any case
@Exclude
public class NoBean {}
the following bean gets excluded in case of project-stage development
@Exclude(ifProjectStage = ProjectStage.Development.class)
public class ProductionBean {}
the following bean gets excluded in every case except of project-stage development
@Exclude(exceptIfProjectStage = ProjectStage.Development.class)
public class DevBean {}
the following bean gets excluded if the expression evaluates to true. that means there is a configured property called 'myProper' with the value 'myValue'
@Exclude(onExpression="myProperty==myValue")
public class ProductionBean {}
the following bean gets excluded if the expression evaluates to true
@Exclude(onExpression="[my custom expression syntax]", interpretedBy=CustomExpressionInterpreter.class) public class ProductionBean {}| Modifier and Type | Optional Element and Description |
|---|---|
Class<? extends ProjectStage>[] |
exceptIfProjectStage
The
ProjectStages
which lead to activating this bean. |
Class<? extends ProjectStage>[] |
ifProjectStage
The
ProjectStages
which lead to deactivating this bean. |
Class<? extends ExpressionInterpreter> |
interpretedBy |
String |
onExpression
Expression which signals if the annotated bean should be deactivated or not
|
public abstract Class<? extends ProjectStage>[] ifProjectStage
ProjectStages
which lead to deactivating this bean.
If the current ProjectStage is in this list, the bean will get vetoed.public abstract Class<? extends ProjectStage>[] exceptIfProjectStage
ProjectStages
which lead to activating this bean.
If the current ProjectStage is not in this list, the bean will get vetoed.public abstract String onExpression
public abstract Class<? extends ExpressionInterpreter> interpretedBy
Copyright © 2011-2013 The Apache Software Foundation. All Rights Reserved.