Package eu.europa.esig.dss.jaxb.common
Class ValidatorConfigurator
java.lang.Object
eu.europa.esig.dss.jaxb.common.AbstractConfigurator<Validator>
eu.europa.esig.dss.jaxb.common.ValidatorConfigurator
Configures a provided
Validator
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Configures thejavax.xml.validation.Validator
by setting the pre-defined features and attributesdisableFeature
(String feature) Disables a custom featureenableFeature
(String feature) Enables a custom featurestatic ValidatorConfigurator
Instantiates a pre-configured with security featuresValidatorConfigurator
void
postProcess
(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 void
setErrorHandler
(Validator validator) SetsDSSErrorHandler
in order to collect exceptions occurred during the validation processvoid
setErrorHandlerAlert
(Alert<DSSErrorHandler> errorHandlerAlert) SetsAlert<DSSErrorHandler>
used to process the collected exception during the XML file validationprotected void
setSecurityAttribute
(Validator validator, String attribute, Object value) Sets the attribute to the factoryprotected void
setSecurityFeature
(Validator validator, String feature, Boolean value) Sets the feature to the factoryMethods inherited from class eu.europa.esig.dss.jaxb.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
Configures thejavax.xml.validation.Validator
by setting the pre-defined features and attributes- Parameters:
validator
-Validator
to be configured
-
enableFeature
Description copied from class:AbstractConfigurator
Enables a custom feature- Overrides:
enableFeature
in classAbstractConfigurator<Validator>
- Parameters:
feature
-String
the feature constraint- Returns:
- this builder
-
disableFeature
Description copied from class:AbstractConfigurator
Disables a custom feature- Overrides:
disableFeature
in classAbstractConfigurator<Validator>
- Parameters:
feature
-String
the feature constraint- Returns:
- this builder
-
setErrorHandlerAlert
SetsAlert<DSSErrorHandler>
used to process the collected exception during the XML file validation- Parameters:
errorHandlerAlert
-Alert
to handle theDSSErrorHandler
-
setAttribute
Description copied from class:AbstractConfigurator
Sets a custom attribute.- Overrides:
setAttribute
in classAbstractConfigurator<Validator>
- Parameters:
attribute
-String
attribute constraint to setvalue
-Object
a value to define for the attribute- Returns:
- this builder
-
removeAttribute
Description copied from class:AbstractConfigurator
Removes the attribute from a list of attributes to set- Overrides:
removeAttribute
in classAbstractConfigurator<Validator>
- Parameters:
attribute
-String
attribute to disable- Returns:
- this builder
-
setSecurityFeature
protected void setSecurityFeature(Validator validator, String feature, Boolean value) throws SecurityConfigurationException Description copied from class:AbstractConfigurator
Sets the feature to the factory- Specified by:
setSecurityFeature
in classAbstractConfigurator<Validator>
- Parameters:
validator
- to set the feature tofeature
-String
feature constraint to setvalue
-Boolean
value 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:AbstractConfigurator
Sets the attribute to the factory- Specified by:
setSecurityAttribute
in classAbstractConfigurator<Validator>
- Parameters:
validator
-Factory
to set the attribute toattribute
-String
attribute constraint to setvalue
-Object
value of the attribute to add- Throws:
SecurityConfigurationException
- in case if any exception occurs
-
setErrorHandler
SetsDSSErrorHandler
in order to collect exceptions occurred during the validation process- Parameters:
validator
-Validator
-
postProcess
Handles the validation errors occurred during an XML file validation- Parameters:
validator
-Validator
-