/** * Constructs an attribute owned by the given document with the given name. * * @param owningDocument the owning document * @param attributeName the name of that attribute * * @return the constructed attribute */ public static Attr constructAttribute(Document owningDocument, QName attributeName) { return constructAttribute(owningDocument, attributeName.getNamespaceURI(), attributeName.getLocalPart(), attributeName.getPrefix()); }
/** * Constructs an attribute owned by the given document with the given name. * * @param owningDocument the owning document * @param attributeName the name of that attribute * * @return the constructed attribute */ public static Attr constructAttribute(Document owningDocument, QName attributeName) { return constructAttribute(owningDocument, attributeName.getNamespaceURI(), attributeName.getLocalPart(), attributeName.getPrefix()); }
/** * {@inheritDoc} */ protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException { Keywords words = (Keywords) samlObject; if (words.getXMLLang() != null) { Attr attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), SAMLConstants.XML_NS, LangBearing.XML_LANG_ATTR_LOCAL_NAME, SAMLConstants.XML_PREFIX); attribute.setValue(words.getXMLLang()); domElement.setAttributeNodeNS(attribute); } }
/** {@inheritDoc} */ protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException { AuthnContextDecl authnCtxDecl = (AuthnContextDecl) xmlObject; Attr attribute; for (Entry<QName, String> entry : authnCtxDecl.getUnknownAttributes().entrySet()) { attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey()); attribute.setValue(entry.getValue()); domElement.setAttributeNodeNS(attribute); if (Configuration.isIDAttribute(entry.getKey()) || authnCtxDecl.getUnknownAttributes().isIDAttribute(entry.getKey())) { attribute.getOwnerElement().setIdAttributeNode(attribute, true); } } }
/** * {@inheritDoc} */ protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException { ServiceDescription description = (ServiceDescription) samlObject; if (description.getDescription() != null) { Attr attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), SAMLConstants.XML_NS, ServiceDescription.LANG_ATTRIB_NAME, SAMLConstants.XML_PREFIX); attribute.setValue(description.getDescription().getLanguage()); domElement.setAttributeNodeNS(attribute); } }
/** * {@inheritDoc} */ protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException { LocalizedName name = (LocalizedName) samlObject; if (name.getName() != null) { Attr attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), SAMLConstants.XML_NS, LangBearing.XML_LANG_ATTR_LOCAL_NAME, SAMLConstants.XML_PREFIX); attribute.setValue(name.getName().getLanguage()); domElement.setAttributeNodeNS(attribute); } }
/** * {@inheritDoc} */ protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException { OrganizationName name = (OrganizationName) samlObject; if (name.getName() != null) { Attr attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), SAMLConstants.XML_NS, OrganizationName.LANG_ATTRIB_NAME, SAMLConstants.XML_PREFIX); attribute.setValue(name.getName().getLanguage()); domElement.setAttributeNodeNS(attribute); } }
/** * {@inheritDoc} */ protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException { OrganizationDisplayName name = (OrganizationDisplayName) samlObject; if (name.getName() != null) { Attr attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), SAMLConstants.XML_NS, OrganizationDisplayName.LANG_ATTRIB_NAME, SAMLConstants.XML_PREFIX); attribute.setValue(name.getName().getLanguage()); domElement.setAttributeNodeNS(attribute); } }
/** * {@inheritDoc} */ protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException { ServiceName name = (ServiceName) samlObject; if (name.getName() != null) { Attr attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), SAMLConstants.XML_NS, ServiceName.LANG_ATTRIB_NAME, SAMLConstants.XML_PREFIX); attribute.setValue(name.getName().getLanguage()); domElement.setAttributeNodeNS(attribute); } }
/** * {@inheritDoc} */ protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException { LocalizedURI name = (LocalizedURI) samlObject; if (name.getURI() != null) { Attr attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), SAMLConstants.XML_NS, LangBearing.XML_LANG_ATTR_LOCAL_NAME, SAMLConstants.XML_PREFIX); attribute.setValue(name.getURI().getLanguage()); domElement.setAttributeNodeNS(attribute); } }
/** * {@inheritDoc} */ protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException { OrganizationURL url = (OrganizationURL) samlObject; if (url.getURL() != null) { Attr attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), SAMLConstants.XML_NS, OrganizationURL.LANG_ATTRIB_NAME, SAMLConstants.XML_PREFIX); attribute.setValue(url.getURL().getLanguage()); domElement.setAttributeNodeNS(attribute); } }
/** {@inheritDoc} */ protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException { AttributeValueType attributeValue = (AttributeValueType) xmlObject; Attr attribute; for (Entry<QName, String> entry : attributeValue.getUnknownAttributes().entrySet()) { attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey()); attribute.setValue(entry.getValue()); domElement.setAttributeNodeNS(attribute); if (Configuration.isIDAttribute(entry.getKey()) || attributeValue.getUnknownAttributes().isIDAttribute(entry.getKey())) { attribute.getOwnerElement().setIdAttributeNode(attribute, true); } } }
/** {@inheritDoc} */ protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException { ResourceContentType resourceContent = (ResourceContentType)xmlObject; Attr attribute; for (Entry<QName, String> entry : resourceContent.getUnknownAttributes().entrySet()) { attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey()); attribute.setValue(entry.getValue()); domElement.setAttributeNodeNS(attribute); if (Configuration.isIDAttribute(entry.getKey()) || resourceContent.getUnknownAttributes().isIDAttribute(entry.getKey())) { attribute.getOwnerElement().setIdAttributeNode(attribute, true); } } }
/** {@inheritDoc} */ protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException { XSAny xsAny = (XSAny) xmlObject; Attr attribute; for (Entry<QName, String> entry : xsAny.getUnknownAttributes().entrySet()) { attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey()); attribute.setValue(entry.getValue()); domElement.setAttributeNodeNS(attribute); if (Configuration.isIDAttribute(entry.getKey()) || xsAny.getUnknownAttributes().isIDAttribute(entry.getKey())) { attribute.getOwnerElement().setIdAttributeNode(attribute, true); } } }
/** {@inheritDoc} */ protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException { Header header = (Header) xmlObject; Attr attribute; for (Entry<QName, String> entry : header.getUnknownAttributes().entrySet()) { attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey()); attribute.setValue(entry.getValue()); domElement.setAttributeNodeNS(attribute); if (Configuration.isIDAttribute(entry.getKey()) || header.getUnknownAttributes().isIDAttribute(entry.getKey())) { attribute.getOwnerElement().setIdAttributeNode(attribute, true); } } }
/** {@inheritDoc} */ protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException { XSAny xsAny = (XSAny) xmlObject; Attr attribute; for (Entry<QName, String> entry : xsAny.getUnknownAttributes().entrySet()) { attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey()); attribute.setValue(entry.getValue()); domElement.setAttributeNodeNS(attribute); if (Configuration.isIDAttribute(entry.getKey()) || xsAny.getUnknownAttributes().isIDAttribute(entry.getKey())) { attribute.getOwnerElement().setIdAttributeNode(attribute, true); } } }
/** {@inheritDoc} */ protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException { Envelope envelope = (Envelope) xmlObject; Attr attribute; for (Entry<QName, String> entry : envelope.getUnknownAttributes().entrySet()) { attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey()); attribute.setValue(entry.getValue()); domElement.setAttributeNodeNS(attribute); if (Configuration.isIDAttribute(entry.getKey()) || envelope.getUnknownAttributes().isIDAttribute(entry.getKey())) { attribute.getOwnerElement().setIdAttributeNode(attribute, true); } } }
/** {@inheritDoc} */ protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException { Detail detail = (Detail) xmlObject; Attr attribute; for (Entry<QName, String> entry : detail.getUnknownAttributes().entrySet()) { attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey()); attribute.setValue(entry.getValue()); domElement.setAttributeNodeNS(attribute); if (Configuration.isIDAttribute(entry.getKey()) || detail.getUnknownAttributes().isIDAttribute(entry.getKey())) { attribute.getOwnerElement().setIdAttributeNode(attribute, true); } } }
/** {@inheritDoc} */ protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException { Body body = (Body) xmlObject; Attr attribute; for (Entry<QName, String> entry : body.getUnknownAttributes().entrySet()) { attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey()); attribute.setValue(entry.getValue()); domElement.setAttributeNodeNS(attribute); if (Configuration.isIDAttribute(entry.getKey()) || body.getUnknownAttributes().isIDAttribute(entry.getKey())) { attribute.getOwnerElement().setIdAttributeNode(attribute, true); } } }
/** * {@inheritDoc} */ protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException { Logo logo = (Logo) samlObject; if (logo.getXMLLang() != null) { Attr attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), SAMLConstants.XML_NS, LangBearing.XML_LANG_ATTR_LOCAL_NAME, SAMLConstants.XML_PREFIX); attribute.setValue(logo.getXMLLang()); domElement.setAttributeNodeNS(attribute); } if (logo.getHeight() != null) { domElement.setAttributeNS(null, Logo.HEIGHT_ATTR_NAME, logo.getHeight().toString()); } if (logo.getWidth() != null) { domElement.setAttributeNS(null, Logo.WIDTH_ATTR_NAME, logo.getWidth().toString()); } }