public class RuleContext
extends org.apache.commons.chain.impl.ContextBase
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Modifier and Type | Field and Description |
---|---|
static String |
FILE_FILTERS
The key used to set file name filters.
|
static String |
FORCE_SCHEMA_VALIDATION
The key used to indicate that declared schema and Schematron files in a label
should be validated before the label is validate.
|
static String |
LISTENER_KEY
The key used to retrieve the definition listener from the
execution context.
|
static String |
LOCATION_VALIDATOR_KEY
The key used to retrieve the top-level validator for getting singleton utilities.
|
static String |
PARENT_TARGET_KEY
The key used to retrieve the parent target from the context.
|
static String |
RECURSIVE_VALIDATION
The key used to set whether to validate recursively.
|
static String |
REGISTRAR_KEY
The key used to retrieve the validation registrar from the execution
context.
|
static String |
RULE_MANAGER_KEY
The key used to retrieve the rule manager from the context.
|
static String |
TARGET_KEY
The key used to retrieve the current validation target from the
execution context.
|
Constructor and Description |
---|
RuleContext() |
Modifier and Type | Method and Description |
---|---|
<T> T |
getContextValue(String key,
Class<T> clazz)
Gets a value from the context in a type-safe manner.
|
List<String> |
getFileFilters() |
String |
getParentTarget()
Gets the parent target location.
|
ProblemListener |
getProblemListener() |
LocationValidator |
getRootValidator()
Gets the top-level validator for getting singleton utilities, such
as the label validator.
|
ValidationRuleManager |
getRuleManager()
Gets the rule manager used to find other rules to apply.
|
File |
getTarget() |
TargetRegistrar |
getTargetRegistrar() |
boolean |
isForceSchemaValidation()
Tests whether to force schema and Schematron validation on each
label file.
|
boolean |
isRecursive() |
boolean |
isRootTarget()
Tests whether this is the root target for the validation.
|
<T> void |
putContextValue(String key,
T value)
Puts a value into the context in a type-safe manner.
|
void |
setFileFilters(List<String> filters) |
void |
setForceSchemaValidation(boolean force)
Sets whether to force schema and Schematron validation.
|
void |
setParentTarget(String parentLocation)
Sets the parent target location.
|
void |
setProblemListener(ProblemListener listener) |
void |
setRecursive(boolean isRecursive) |
void |
setRootTarget(boolean flag)
Sets whether this is the root target for the validation.
|
void |
setRootValidator(LocationValidator validator)
Sets the top-level validator.
|
void |
setRuleManager(ValidationRuleManager ruleManager)
Sets the rule manager to use for finding new rules.
|
void |
setTarget(File target) |
void |
setTargetRegistrar(TargetRegistrar registrar) |
clear, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, values
clone, containsKey, size
equals, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
containsKey, equals, hashCode, size
public static final String LOCATION_VALIDATOR_KEY
public static final String FORCE_SCHEMA_VALIDATION
public static final String RECURSIVE_VALIDATION
public static final String FILE_FILTERS
public static final String TARGET_KEY
public static final String LISTENER_KEY
public static final String REGISTRAR_KEY
public static final String RULE_MANAGER_KEY
public static final String PARENT_TARGET_KEY
public <T> T getContextValue(String key, Class<T> clazz)
key
- the keyclazz
- the expected classpublic <T> void putContextValue(String key, T value)
key
- the keyvalue
- the valuepublic File getTarget()
public void setTarget(File target)
public ProblemListener getProblemListener()
public void setProblemListener(ProblemListener listener)
public TargetRegistrar getTargetRegistrar()
public void setTargetRegistrar(TargetRegistrar registrar)
public ValidationRuleManager getRuleManager()
public void setRuleManager(ValidationRuleManager ruleManager)
ruleManager
- the rule managerpublic String getParentTarget()
public void setParentTarget(String parentLocation)
parent
- the parent target locationpublic boolean isRootTarget()
public void setRootTarget(boolean flag)
flag
- true, if this context is for the root targetpublic LocationValidator getRootValidator()
public void setRootValidator(LocationValidator validator)
validator
- the top-level validatorpublic boolean isRecursive()
public void setRecursive(boolean isRecursive)
public boolean isForceSchemaValidation()
public void setForceSchemaValidation(boolean force)
force
- true, if declared schema and Schematron files should be validatedCopyright © 2010–2016 Planetary Data System. All rights reserved.