Package org.opensaml.xml.validation

Examples of org.opensaml.xml.validation.ValidationException


    protected void validateChildrenNamespaces(ReferenceType xmlObject) throws ValidationException {
        // Validate that any children are from another namespace.
        for (XMLObject child : xmlObject.getUnknownXMLObjects()) {
            QName childName = child.getElementQName();
            if (XMLConstants.XMLENC_NS.equals(childName.getNamespaceURI())) {
                throw new ValidationException("ReferenceType contains an illegal child extension element: " + childName);
            }
        }
    }
View Full Code Here


     * @param xmlObject the object to validate
     * @throws ValidationException  thrown if the object is invalid
     */
    protected void validateChildrenPresence(CipherData xmlObject) throws ValidationException {
        if (xmlObject.getCipherValue() == null && xmlObject.getCipherReference() == null) {
            throw new ValidationException("CipherData did not contain either a CipherValue or CipherReference child");
        }
        if (xmlObject.getCipherValue() != null && xmlObject.getCipherReference() != null) {
            throw new ValidationException("CipherData contained both a CipherValue and a CipherReference child");
        }
    }
View Full Code Here

     * @param xmlObject the object to validate
     * @throws ValidationException  thrown if the object is invalid
     */
    protected void validateTransforms(EncryptionProperties xmlObject) throws ValidationException {
        if (xmlObject.getEncryptionProperties().isEmpty()) {
            throw new ValidationException("No EncryptionProperty children were present in the EncryptionProperties object");
        }
    }
View Full Code Here

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

     * @param xmlObject the object to validate
     * @throws ValidationException  thrown if the object is invalid
     */
    protected void validateUnknownChildren(EncryptionProperty xmlObject) throws ValidationException {
        if (xmlObject.getUnknownXMLObjects().isEmpty()) {
            throw new ValidationException("No children were present in the EncryptionProperty object");
        }
    }
View Full Code Here

    protected void validateChildrenNamespaces(EncryptionProperty xmlObject) throws ValidationException {
        // Validate that any children are from another namespace.
        for (XMLObject child : xmlObject.getUnknownXMLObjects()) {
            QName childName = child.getElementQName();
            if (XMLConstants.XMLENC_NS.equals(childName.getNamespaceURI())) {
                throw new ValidationException("EncryptionProperty contains an illegal child extension element: " + childName);
            }
        }
    }
View Full Code Here

     */
    protected void validateAttributeNamespaces(EncryptionProperty xmlObject) throws ValidationException {
        // Validate that any extension attribute are from the XML namespace
        for (QName attribName : xmlObject.getUnknownAttributes().keySet()) {
            if (! XMLConstants.XML_NS.equals(attribName.getNamespaceURI())) {
                throw new ValidationException("EncryptionProperty contains an illegal extension attribute: " + attribName);
            }
        }
    }
View Full Code Here

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

     * @param xmlObject the object to validate
     * @throws ValidationException  thrown if the object is invalid
     */
    protected void validateReferences(ReferenceList xmlObject) throws ValidationException {
        if (xmlObject.getReferences().isEmpty()) {
            throw new ValidationException("No DataReference or KeyReference children were present in the ReferenceList object");
        }
    }
View Full Code Here

     * @param xmlObject the object to validate
     * @throws ValidationException  thrown if the object is invalid
     */
    protected void validateTransforms(Transforms xmlObject) throws ValidationException {
        if (xmlObject.getTransforms().isEmpty()) {
            throw new ValidationException("No Transform children were present in the Transforms object");
        }
    }
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.