Class IsPropertyDefinedCondition
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.boolex.PropertyConditionBase
ch.qos.logback.core.boolex.IsPropertyDefinedCondition
- All Implemented Interfaces:
PropertyCondition,Condition,ContextAware,LifeCycle
Checks whether a named property is defined in the
context (e.g. system properties, environment, or the configured
property map used by the surrounding framework).
This condition expects a property name to be provided via
setKey(String). When evaluate() is called it returns
true if the named property is defined and false
otherwise.
-
Field Summary
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanevaluate()Evaluate whether the configured property is defined.getKey()Return the configured property name (key) that this evaluator will test for definition.voidSet the property name (key) to be checked by this evaluator.voidstart()Start the evaluator.Methods inherited from class ch.qos.logback.core.boolex.PropertyConditionBase
getLocalPropertyContainer, isDefined, isNull, isStarted, p, property, propertyContains, propertyEquals, setLocalPropertyContainer, stopMethods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ch.qos.logback.core.spi.ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
-
Constructor Details
-
IsPropertyDefinedCondition
public IsPropertyDefinedCondition()
-
-
Method Details
-
start
Start the evaluator. If the requiredkeyis not set an error is reported and startup is aborted.- Specified by:
startin interfaceLifeCycle- Overrides:
startin classPropertyConditionBase
-
getKey
-
setKey
-
evaluate
Evaluate whether the configured property is defined.- Returns:
trueif the property named bykeyis defined,falseotherwise
-