Package org.opensaml.xml.validation

Examples of org.opensaml.xml.validation.ValidationException


     * @param xmlObject the object to validate
     * @throws ValidationException  thrown if the object is invalid
     */
    protected void validateURI(CipherReference xmlObject) throws ValidationException {
        if (DatatypeHelper.isEmpty(xmlObject.getURI())) {
            throw new ValidationException("CipherReference URI was empty");
        }
    }
View Full Code Here


     * @param xmlObject the object to validate
     * @throws ValidationException  thrown if the object is invalid
     */
    protected void validateChildrenPresence(DSAKeyValue xmlObject) throws ValidationException {
        if (xmlObject.getY() == null) {
            throw new ValidationException("DSAKeyValue did not contain a required Y value");
        }
       
        if (xmlObject.getP() != null && xmlObject.getQ() == null) {
            throw new ValidationException("RSAKeyValue did contained a P value without a Q value");
        } else if (xmlObject.getQ() != null && xmlObject.getP() == null) {
            throw new ValidationException("RSAKeyValue did contained a Q value without a P value");
        }
       
        if (xmlObject.getPgenCounter() != null && xmlObject.getSeed() == null) {
            throw new ValidationException("RSAKeyValue did contained a PgenCounter value without a Seed value");
        } else if (xmlObject.getSeed() != null && xmlObject.getPgenCounter() == null) {
            throw new ValidationException("RSAKeyValue did contained a Seed value without a PgenCounter value");
        }
       
    }
View Full Code Here

     * @param xmlObject the object to validate
     * @throws ValidationException  thrown if the object is invalid
     */
    protected void validateAlgorithm(Transform xmlObject) throws ValidationException {
        if (DatatypeHelper.isEmpty(xmlObject.getAlgorithm())) {
            throw new ValidationException("Transform algorithm URI was empty");
        }
    }
View Full Code Here

     * @param xmlObject the object to validate
     * @throws ValidationException  thrown if the object is invalid
     */
    protected void validateChildrenPresence(X509IssuerSerial xmlObject) throws ValidationException {
        if (xmlObject.getX509IssuerName() == null) {
            throw new ValidationException("X509IssuerSerial does not contain an X509IssuerName");
        }
        if (xmlObject.getX509SerialNumber() == null) {
            throw new ValidationException("X509IssuerSerial does not contain an X509SerialNumber");
        }
    }
View Full Code Here

     * @param xmlObject the object to validate
     * @throws ValidationException  thrown if the object is invalid
     */
    protected void validateContent(X509SerialNumber xmlObject) throws ValidationException {
        if (xmlObject.getValue() == null) {
            throw new ValidationException("X509SerialNumber did not contain a value");
        }
    }
View Full Code Here

     * @param xmlObject the object to validate
     * @throws ValidationException  thrown if the object is invalid
     */
    protected void validateURI(RetrievalMethod xmlObject) throws ValidationException {
        if (DatatypeHelper.isEmpty(xmlObject.getURI())) {
            throw new ValidationException("RetrievalMethod URI was empty");
        }
    }
View Full Code Here

     * @param xmlObject the object to be validated
     * @throws ValidationException thrown if object is invalid
     */
    protected void validateCanonicalizationMethod(Signature xmlObject) throws ValidationException {
        if (DatatypeHelper.isEmpty(xmlObject.getCanonicalizationAlgorithm())) {
            throw new ValidationException("The CanonicalizationMethod value was empty");
        }
    }
View Full Code Here

     * @param xmlObject the object to be validated
     * @throws ValidationException thrown if object is invalid
     */
    protected void validateSignatureMethod(Signature xmlObject) throws ValidationException {
        if (DatatypeHelper.isEmpty(xmlObject.getSignatureAlgorithm())) {
            throw new ValidationException("The SignatureMethod value was empty");
        }
    }
View Full Code Here

     * @throws ValidationException  thrown if the object is invalid
     */
    protected void validateChildrenPresence(KeyValue xmlObject) throws ValidationException {
        List<XMLObject> children = xmlObject.getOrderedChildren();
        if (children == null || children.isEmpty()) {
            throw new ValidationException("No children were present in the KeyValue object");
        }
        if (children.size() > 1) {
            throw new ValidationException("Invalid number of children were present in the KeyValue object");
        }
    }
View Full Code Here

        if (unknownChild == null) {
            return;
        }
        QName childName = unknownChild.getElementQName();
        if (XMLConstants.XMLSIG_NS.equals(childName.getNamespaceURI())) {
            throw new ValidationException("KeyValue contains an illegal child extension element: " + childName);
        }
    }
View Full Code Here

TOP

Related Classes of org.opensaml.xml.validation.ValidationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.