|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensaml.xml.validation.ValidatorSuite
public class ValidatorSuite
A collection of validators that can be applied to an XMLObject and its children. These collections can represent
usage specific checks, such as those outlined in things like profiles for specific XML specification.
Registered Validator
s must be stateless. The xmlObjectTarget may be the
XMLObject's element QName retrieved by XMLObject.getElementQName()
or schema type, retrieved
by XMLObject.getSchemaType()
, with schema type registered checks performed first.
Field Summary | |
---|---|
private String |
id
Unique ID for this suite. |
private Logger |
log
Class logger. |
private Map<QName,List<Validator>> |
validators
Validators registered in this suite. |
Constructor Summary | |
---|---|
ValidatorSuite(String suiteId)
Constructor. |
Method Summary | |
---|---|
void |
deregisterValidator(QName xmlObjectTarget,
Validator validator)
Removes a validator from this suite. |
String |
getId()
Gets a unique ID for this suite. |
List<Validator> |
getValidators(QName xmlObjectTarget)
Gets an immutable list of validators for a given XMLObject target. |
private void |
performValidation(QName validatorSetKey,
XMLObject xmlObject)
Validates the given XMLObject against the validators registered under the given key. |
private void |
performValidation(XMLObject xmlObject)
Validates the given XMLObject. |
void |
registerValidator(QName xmlObjectTarget,
Validator validator)
Registers a new validator in the suite. |
void |
validate(XMLObject xmlObject)
Evaluates the registered validators against the given XMLObject and it's children. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final Logger log
private String id
private Map<QName,List<Validator>> validators
Constructor Detail |
---|
public ValidatorSuite(String suiteId)
suiteId
- unique ID for this suiteMethod Detail |
---|
public String getId()
public void validate(XMLObject xmlObject) throws ValidationException
xmlObject
- the XMLObject to validate
ValidationException
- thrown if the element is not validpublic List<Validator> getValidators(QName xmlObjectTarget)
xmlObjectTarget
- the XMLObject the returned list of validators operates on
public void registerValidator(QName xmlObjectTarget, Validator validator)
validator
- the validatorxmlObjectTarget
- the XMLObject the validator should operate onpublic void deregisterValidator(QName xmlObjectTarget, Validator validator)
xmlObjectTarget
- the XMLObject the validator is currently registered forvalidator
- the validator to removeprivate void performValidation(XMLObject xmlObject) throws ValidationException
xmlObject
- the XMLObject to validate.
ValidationException
- thrown if the XMLObject does not validateprivate void performValidation(QName validatorSetKey, XMLObject xmlObject) throws ValidationException
validatorSetKey
- the key to the list of validatorsxmlObject
- the XMLObject to validate
ValidationException
- thrown if any validations fail
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |