Package org.opensaml.xml.encryption

Examples of org.opensaml.xml.encryption.EncryptionProperty


*/
public class EncryptionPropertyMarshaller extends AbstractXMLEncryptionMarshaller {

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
        EncryptionProperty ep = (EncryptionProperty) xmlObject;

        if (ep.getID() != null) {
            domElement.setAttributeNS(null, EncryptionProperty.ID_ATTRIB_NAME, ep.getID());
            domElement.setIdAttributeNS(null, EncryptionProperty.ID_ATTRIB_NAME, true);
        }
        if (ep.getTarget() != null) {
            domElement.setAttributeNS(null, EncryptionProperty.TARGET_ATTRIB_NAME, ep.getTarget());
        }

        Attr attribute;
        for (Entry<QName, String> entry : ep.getUnknownAttributes().entrySet()) {
            attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey());
            attribute.setValue(entry.getValue());
            domElement.setAttributeNodeNS(attribute);
            if (Configuration.isIDAttribute(entry.getKey()) || ep.getUnknownAttributes().isIDAttribute(entry.getKey())) {
                attribute.getOwnerElement().setIdAttributeNode(attribute, true);
            }
        }
    }
View Full Code Here


*/
public class EncryptionPropertyUnmarshaller extends AbstractXMLEncryptionUnmarshaller {

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
        EncryptionProperty ep = (EncryptionProperty) xmlObject;

        if (attribute.getLocalName().equals(EncryptionProperty.ID_ATTRIB_NAME)) {
            ep.setID(attribute.getValue());
            attribute.getOwnerElement().setIdAttributeNode(attribute, true);
        } else if (attribute.getLocalName().equals(EncryptionProperty.TARGET_ATTRIB_NAME)) {
            ep.setTarget(attribute.getValue());
        } else {
            QName attributeName = XMLHelper.getNodeQName(attribute);
            if (attribute.isId()) {
                ep.getUnknownAttributes().registerID(attributeName);
            }
            ep.getUnknownAttributes().put(attributeName, attribute.getValue());
        }
    }
View Full Code Here

    }

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
            throws UnmarshallingException {
        EncryptionProperty ep = (EncryptionProperty) parentXMLObject;

        // <any> content model
        ep.getUnknownXMLObjects().add(childXMLObject);
    }
View Full Code Here

*/
public class EncryptionPropertyMarshaller extends AbstractXMLEncryptionMarshaller {

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
        EncryptionProperty ep = (EncryptionProperty) xmlObject;

        if (ep.getID() != null) {
            domElement.setAttributeNS(null, EncryptionProperty.ID_ATTRIB_NAME, ep.getID());
            domElement.setIdAttributeNS(null, EncryptionProperty.ID_ATTRIB_NAME, true);
        }
        if (ep.getTarget() != null) {
            domElement.setAttributeNS(null, EncryptionProperty.TARGET_ATTRIB_NAME, ep.getTarget());
        }

        Attr attribute;
        for (Entry<QName, String> entry : ep.getUnknownAttributes().entrySet()) {
            attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey());
            attribute.setValue(entry.getValue());
            domElement.setAttributeNodeNS(attribute);
            if (Configuration.isIDAttribute(entry.getKey()) || ep.getUnknownAttributes().isIDAttribute(entry.getKey())) {
                attribute.getOwnerElement().setIdAttributeNode(attribute, true);
            }
        }
    }
View Full Code Here

*/
public class EncryptionPropertyUnmarshaller extends AbstractXMLEncryptionUnmarshaller {

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
        EncryptionProperty ep = (EncryptionProperty) xmlObject;

        if (attribute.getLocalName().equals(EncryptionProperty.ID_ATTRIB_NAME)) {
            ep.setID(attribute.getValue());
            attribute.getOwnerElement().setIdAttributeNode(attribute, true);
        } else if (attribute.getLocalName().equals(EncryptionProperty.TARGET_ATTRIB_NAME)) {
            ep.setTarget(attribute.getValue());
        } else {
            QName attributeName = XMLHelper.getNodeQName(attribute);
            if (attribute.isId()) {
                ep.getUnknownAttributes().registerID(attributeName);
            }
            ep.getUnknownAttributes().put(attributeName, attribute.getValue());
        }
    }
View Full Code Here

    }

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
            throws UnmarshallingException {
        EncryptionProperty ep = (EncryptionProperty) parentXMLObject;

        // <any> content model
        ep.getUnknownXMLObjects().add(childXMLObject);
    }
View Full Code Here

TOP

Related Classes of org.opensaml.xml.encryption.EncryptionProperty

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.