The OpenSAML V2 software has reached its End of Life and is no longer supported. This documentation is available for historical purposes only.
OSTwoDevManJavaNewValidator
Creating a new SAML Object Validator
To implement a Validator create a class that implements the org.opensaml.xml.validation.Validator
interface and meets the follow guidelines:
- Provides a public no-argument constructor
- Implements its validation rules in the
validate(XMLObject)
method
In order to allow other developers to extend validators at a later date we suggest that you do not implement your rules directly within the validate method, but instead create one additional method, per rule, and then simply invoke these rules in the validate method. This allows future developers to override one rule, or add new rules, without having to recreate the whole validator. The org.opensaml.saml2.metadata.validator.EntityDescriptorSchemaValidator
class is an example of this approach.