Package eu.europa.esig.dss.xml.common
Class ValidatorConfigurator
java.lang.Object
eu.europa.esig.dss.xml.common.AbstractConfigurator<Validator>
eu.europa.esig.dss.xml.common.ValidatorConfigurator
Configures a provided
Validator-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidConfigures thejavax.xml.validation.Validatorby setting the pre-defined features and attributesdisableFeature(String feature) Disables a custom featureenableFeature(String feature) Enables a custom featurestatic ValidatorConfiguratorInstantiates a pre-configured with security featuresValidatorConfiguratorvoidpostProcess(Validator validator) Handles the validation errors occurred during an XML file validationremoveAttribute(String attribute) Removes the attribute from a list of attributes to setsetAttribute(String attribute, Object value) Sets a custom attribute.protected voidsetErrorHandler(Validator validator) SetsDSSErrorHandlerin order to collect exceptions occurred during the validation processvoidsetErrorHandlerAlert(Alert<DSSErrorHandler> errorHandlerAlert) SetsAlert<DSSErrorHandler>used to process the collected exception during the XML file validationprotected voidsetSecurityAttribute(Validator validator, String attribute, Object value) Sets the attribute to the factoryprotected voidsetSecurityFeature(Validator validator, String feature, Boolean value) Sets the feature to the factoryMethods inherited from class eu.europa.esig.dss.xml.common.AbstractConfigurator
setSecurityAttributes, setSecurityExceptionAlert, setSecurityFeatures
-
Constructor Details
-
ValidatorConfigurator
protected ValidatorConfigurator()Default constructor
-
-
Method Details
-
getSecureValidatorConfigurator
Instantiates a pre-configured with security featuresValidatorConfigurator- Returns:
- default
ValidatorConfigurator
-
configure
-
enableFeature
Description copied from class:AbstractConfiguratorEnables a custom feature- Overrides:
enableFeaturein classAbstractConfigurator<Validator>- Parameters:
feature-Stringthe feature constraint- Returns:
- this builder
-
disableFeature
Description copied from class:AbstractConfiguratorDisables a custom feature- Overrides:
disableFeaturein classAbstractConfigurator<Validator>- Parameters:
feature-Stringthe feature constraint- Returns:
- this builder
-
setErrorHandlerAlert
SetsAlert<DSSErrorHandler>used to process the collected exception during the XML file validation- Parameters:
errorHandlerAlert-Alertto handle theDSSErrorHandler
-
setAttribute
Description copied from class:AbstractConfiguratorSets a custom attribute.- Overrides:
setAttributein classAbstractConfigurator<Validator>- Parameters:
attribute-Stringattribute constraint to setvalue-Objecta value to define for the attribute- Returns:
- this builder
-
removeAttribute
Description copied from class:AbstractConfiguratorRemoves the attribute from a list of attributes to set- Overrides:
removeAttributein classAbstractConfigurator<Validator>- Parameters:
attribute-Stringattribute to disable- Returns:
- this builder
-
setSecurityFeature
protected void setSecurityFeature(Validator validator, String feature, Boolean value) throws SecurityConfigurationException Description copied from class:AbstractConfiguratorSets the feature to the factory- Specified by:
setSecurityFeaturein classAbstractConfigurator<Validator>- Parameters:
validator- to set the feature tofeature-Stringfeature constraint to setvalue-Booleanvalue of the feature to add- Throws:
SecurityConfigurationException- in case if any exception occurs
-
setSecurityAttribute
protected void setSecurityAttribute(Validator validator, String attribute, Object value) throws SecurityConfigurationException Description copied from class:AbstractConfiguratorSets the attribute to the factory- Specified by:
setSecurityAttributein classAbstractConfigurator<Validator>- Parameters:
validator-Factoryto set the attribute toattribute-Stringattribute constraint to setvalue-Objectvalue of the attribute to add- Throws:
SecurityConfigurationException- in case if any exception occurs
-
setErrorHandler
-
postProcess
-