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 |
ADDITIONAL_TARGET_KEY
Key used to retrieve additional targets.
|
static String |
ALLOW_UNLABELED_FILES_KEY
Key used to tell the tool to allow unlabeled files in a bundle or collection.
|
static String |
BUNDLE_PATTERN_KEY |
static String |
CATALOG_FILES
The key used to retrieve the catalog files.
|
static String |
CATALOG_RESOLVER
The key used to retrieve the XMLCatalogResolver object.
|
static String |
CHECK_DATA_KEY
The key used to indicate whether to disable data content validation.
|
static String |
CHECK_INBETWEEN_FIELDS |
static String |
CHECKSUM_MANIFEST_KEY
The key used to retrieve a hash map containing the checksum values from a given checksum
manifest.
|
static String |
COLLECTION_PATTERN_KEY |
static String |
CONTEXT_VALIDATION_KEY
The key used to indicate whether to disable context validation.
|
static String |
CRAWLER_KEY
The key used to retrieve the crawler.
|
static String |
FILE_FILTERS
The key used to set file name filters.
|
static String |
FORCE_LABEL_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 |
LABEL_EXTENSION_KEY |
static String |
LABEL_PATTERN_KEY |
static String |
LAST_DIRECTORY_FLAG_KEY |
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 |
REGISTERED_PRODUCTS_KEY
Key used to store a map of registered Product LIDVIDs.
|
static String |
REGISTRAR_KEY
The key used to retrieve the validation registrar from the execution context.
|
static String |
RULE_KEY |
static String |
RULE_MANAGER_KEY
The key used to retrieve the rule manager from the context.
|
static String |
SKIP_PRODUCT_VALIDATION_KEY
Key used to ignore(skip) product level validation.
|
static String |
SPOT_CHECK_DATA_KEY
The key used to indicate how many lines or records to skip during content validation.
|
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 |
---|---|
boolean |
getAllowUnlabeledFiles() |
Pattern |
getBundleLabelPattern() |
XMLCatalogResolver |
getCatalogResolver() |
List<String> |
getCatalogs() |
boolean |
getCheckData() |
boolean |
getCheckInbetweenFields() |
Map<URL,String> |
getChecksumManifest() |
Pattern |
getCollectionLabelPattern() |
<T> T |
getContextValue(String key,
Class<T> clazz)
Gets a value from the context in a type-safe manner.
|
Crawler |
getCrawler() |
AdditionalTarget |
getExtraTarget() |
WildcardOSFilter |
getFileFilters() |
String |
getLabelExtension() |
Pattern |
getLabelPattern() |
ExceptionType |
getLogLevel() |
String |
getParentTarget()
Gets the parent target location.
|
ProblemListener |
getProblemListener() |
Map<String,List<ContextProductReference>> |
getRegisteredProducts() |
LocationValidator |
getRootValidator()
Gets the top-level validator for getting singleton utilities, such as the label validator.
|
ValidationRule |
getRule() |
ValidationRuleManager |
getRuleManager()
Gets the rule manager used to find other rules to apply.
|
boolean |
getSkipProductValidation() |
int |
getSpotCheckData() |
URL |
getTarget() |
TargetRegistrar |
getTargetRegistrar() |
boolean |
getValidateContext() |
boolean |
isForceLabelSchemaValidation()
Tests whether to force validation of schemas and Schematrons defined in a label file.
|
boolean |
isLastDirectory() |
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 |
setAllowUnlabeledFiles(boolean flag) |
void |
setBundleLabelPattern(Pattern pattern) |
void |
setBundleLabelPatternWithExtension(String labelExtension) |
void |
setCatalogResolver(XMLCatalogResolver catalogResolver) |
void |
setCatalogs(List<String> catalogs) |
void |
setCheckData(boolean flag) |
void |
setCheckInbetweenFields(boolean flag) |
void |
setChecksumManifest(Map<URL,String> manifest) |
void |
setCollectionLabelPattern(Pattern pattern) |
void |
setCollectionLabelPatternWithExtension(String labelExtension) |
void |
setCrawler(Crawler crawler) |
void |
setExtraTarget(ArrayList<URL> targets) |
void |
setFileFilters(List<String> filters) |
void |
setFileFilters(WildcardOSFilter filter) |
void |
setForceLabelSchemaValidation(boolean force)
Sets whether to force schema and Schematron validation defined in a label.
|
void |
setLabelExtension(String labelExtension)
Set the label extension and the file name patterns to match
|
void |
setLabelPattern(Pattern pattern) |
void |
setLabelPatternWithExtension(String labelExtension) |
void |
setLastDirectoryFlag(boolean flag) |
void |
setLogLevel(ExceptionType logLevel) |
void |
setParentTarget(String parentLocation)
Sets the parent target location.
|
void |
setProblemListener(ProblemListener listener) |
void |
setRecursive(boolean isRecursive) |
void |
setRegisteredProducts(Map<String,List<ContextProductReference>> products) |
void |
setRootTarget(boolean flag)
Sets whether this is the root target for the validation.
|
void |
setRootValidator(LocationValidator validator)
Sets the top-level validator.
|
void |
setRule(ValidationRule rule) |
void |
setRuleManager(ValidationRuleManager ruleManager)
Sets the rule manager to use for finding new rules.
|
void |
setSkipProductValidation(boolean flag) |
void |
setSpotCheckData(int value) |
void |
setTarget(URL target) |
void |
setTargetRegistrar(TargetRegistrar registrar) |
void |
setValidateContext(boolean flag) |
clear, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, values
clone, compute, computeIfAbsent, computeIfPresent, containsKey, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll, size
equals, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, containsKey, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll, size
public static final String LOCATION_VALIDATOR_KEY
public static final String FORCE_LABEL_SCHEMA_VALIDATION
public static final String RECURSIVE_VALIDATION
public static final String FILE_FILTERS
public static final String TARGET_KEY
public static final String ADDITIONAL_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 RULE_KEY
public static final String PARENT_TARGET_KEY
public static final String CRAWLER_KEY
public static final String CHECKSUM_MANIFEST_KEY
public static final String CATALOG_FILES
public static final String CATALOG_RESOLVER
public static final String CHECK_DATA_KEY
public static final String SPOT_CHECK_DATA_KEY
public static final String ALLOW_UNLABELED_FILES_KEY
public static final String REGISTERED_PRODUCTS_KEY
public static final String CONTEXT_VALIDATION_KEY
public static final String SKIP_PRODUCT_VALIDATION_KEY
public static final String CHECK_INBETWEEN_FIELDS
public static final String LABEL_EXTENSION_KEY
public static final String LABEL_PATTERN_KEY
public static final String BUNDLE_PATTERN_KEY
public static final String COLLECTION_PATTERN_KEY
public static final String LAST_DIRECTORY_FLAG_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 ExceptionType getLogLevel()
public void setLogLevel(ExceptionType logLevel)
public URL getTarget()
public void setTarget(URL target) throws MalformedURLException, URISyntaxException
public AdditionalTarget getExtraTarget()
public void setExtraTarget(ArrayList<URL> targets) throws MalformedURLException, URISyntaxException
public ProblemListener getProblemListener()
public void setProblemListener(ProblemListener listener)
public TargetRegistrar getTargetRegistrar()
public void setTargetRegistrar(TargetRegistrar registrar)
public ValidationRuleManager getRuleManager()
public ValidationRule getRule()
public void setRuleManager(ValidationRuleManager ruleManager)
ruleManager
- the rule managerpublic void setRule(ValidationRule rule)
public 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 WildcardOSFilter getFileFilters()
public void setFileFilters(WildcardOSFilter filter)
public boolean isForceLabelSchemaValidation()
public void setForceLabelSchemaValidation(boolean force)
force
- true, if declared schema and Schematron files should be validatedpublic Crawler getCrawler()
public void setCrawler(Crawler crawler)
public void setCatalogResolver(XMLCatalogResolver catalogResolver)
public XMLCatalogResolver getCatalogResolver()
public boolean getCheckData()
public void setCheckData(boolean flag)
public int getSpotCheckData()
public void setSpotCheckData(int value)
public boolean getAllowUnlabeledFiles()
public void setAllowUnlabeledFiles(boolean flag)
public Map<String,List<ContextProductReference>> getRegisteredProducts()
public void setRegisteredProducts(Map<String,List<ContextProductReference>> products)
public boolean getValidateContext()
public void setValidateContext(boolean flag)
public boolean getSkipProductValidation()
public void setSkipProductValidation(boolean flag)
public boolean getCheckInbetweenFields()
public void setCheckInbetweenFields(boolean flag)
public String getLabelExtension()
public void setLabelExtension(String labelExtension)
labelExtension
- public Pattern getLabelPattern()
public void setLabelPattern(Pattern pattern)
public void setLabelPatternWithExtension(String labelExtension)
public Pattern getBundleLabelPattern()
public void setBundleLabelPattern(Pattern pattern)
public void setBundleLabelPatternWithExtension(String labelExtension)
public Pattern getCollectionLabelPattern()
public void setCollectionLabelPattern(Pattern pattern)
public void setCollectionLabelPatternWithExtension(String labelExtension)
public boolean isLastDirectory()
public void setLastDirectoryFlag(boolean flag)
Copyright © 2023 Jet Propulsion Laboratory, California Institute of Technology. All rights reserved.