Code example for Attr

Methods: getOwnerElement, getValue

0
public class EncryptedHeaderUnmarshaller extends AbstractWSSecurityObjectUnmarshaller { 
 
    /** {@inheritDoc} */ 
    protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
        EncryptedHeader eh = (EncryptedHeader) xmlObject;
        QName attrName = XMLHelper.getNodeQName(attribute);
        if (EncryptedHeader.WSU_ID_ATTR_NAME.equals(attrName)) {
            eh.setWSUId(attribute.getValue());
            attribute.getOwnerElement().setIdAttributeNode(attribute, true);
        } else if (EncryptedHeader.SOAP11_MUST_UNDERSTAND_ATTR_NAME.equals(attrName)) {
            eh.setSOAP11MustUnderstand(XSBooleanValue.valueOf(attribute.getValue()));
        } else if (EncryptedHeader.SOAP11_ACTOR_ATTR_NAME.equals(attrName)) {
            eh.setSOAP11Actor(attribute.getValue());
        } else if (EncryptedHeader.SOAP12_MUST_UNDERSTAND_ATTR_NAME.equals(attrName)) {
            eh.setSOAP12MustUnderstand(XSBooleanValue.valueOf(attribute.getValue()));
        } else if (EncryptedHeader.SOAP12_ROLE_ATTR_NAME.equals(attrName)) {
            eh.setSOAP12Role(attribute.getValue());
        } else if (EncryptedHeader.SOAP12_RELAY_ATTR_NAME.equals(attrName)) {
            eh.setSOAP12Relay(XSBooleanValue.valueOf(attribute.getValue()));
        } else { 
            super.processAttribute(xmlObject, attribute);
        } 
    }