本文整理汇总了Java中org.opensaml.xml.util.XMLHelper.constructAttribute方法的典型用法代码示例。如果您正苦于以下问题:Java XMLHelper.constructAttribute方法的具体用法?Java XMLHelper.constructAttribute怎么用?Java XMLHelper.constructAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opensaml.xml.util.XMLHelper
的用法示例。
在下文中一共展示了XMLHelper.constructAttribute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: marshallAttributes
import org.opensaml.xml.util.XMLHelper; //导入方法依赖的package包/类
/** {@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);
}
}
}
示例2: marshallAttributes
import org.opensaml.xml.util.XMLHelper; //导入方法依赖的package包/类
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
AttributeValueType attributeValue = (AttributeValueType) xmlObject;
if(!DatatypeHelper.isEmpty(attributeValue.getDataType())){
domElement.setAttributeNS(null,AttributeAssignmentType.DATA_TYPE_ATTRIB_NAME, attributeValue.getDataType());
}
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);
}
}
}
示例3: marshallAttributes
import org.opensaml.xml.util.XMLHelper; //导入方法依赖的package包/类
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
ContactPerson person = (ContactPerson) samlObject;
if (person.getType() != null) {
domElement.setAttributeNS(null, ContactPerson.CONTACT_TYPE_ATTRIB_NAME, person.getType().toString());
}
Attr attribute;
for (Entry<QName, String> entry : person.getUnknownAttributes().entrySet()) {
attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey());
attribute.setValue(entry.getValue());
domElement.setAttributeNodeNS(attribute);
if (Configuration.isIDAttribute(entry.getKey())
|| person.getUnknownAttributes().isIDAttribute(entry.getKey())) {
attribute.getOwnerElement().setIdAttributeNode(attribute, true);
}
}
}
示例4: marshallAttributes
import org.opensaml.xml.util.XMLHelper; //导入方法依赖的package包/类
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
SubjectConfirmationData subjectCD = (SubjectConfirmationData) samlObject;
if (subjectCD.getNotBefore() != null) {
String notBeforeStr = Configuration.getSAMLDateFormatter().print(subjectCD.getNotBefore());
domElement.setAttributeNS(null, SubjectConfirmationData.NOT_BEFORE_ATTRIB_NAME, notBeforeStr);
}
if (subjectCD.getNotOnOrAfter() != null) {
String notOnOrAfterStr = Configuration.getSAMLDateFormatter().print(subjectCD.getNotOnOrAfter());
domElement.setAttributeNS(null, SubjectConfirmationData.NOT_ON_OR_AFTER_ATTRIB_NAME, notOnOrAfterStr);
}
if (subjectCD.getRecipient() != null) {
domElement.setAttributeNS(null, SubjectConfirmationData.RECIPIENT_ATTRIB_NAME, subjectCD.getRecipient());
}
if (subjectCD.getInResponseTo() != null) {
domElement.setAttributeNS(null, SubjectConfirmationData.IN_RESPONSE_TO_ATTRIB_NAME, subjectCD
.getInResponseTo());
}
if (subjectCD.getAddress() != null) {
domElement.setAttributeNS(null, SubjectConfirmationData.ADDRESS_ATTRIB_NAME, subjectCD.getAddress());
}
Attr attribute;
for (Entry<QName, String> entry : subjectCD.getUnknownAttributes().entrySet()) {
attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey());
attribute.setValue(entry.getValue());
domElement.setAttributeNodeNS(attribute);
if (Configuration.isIDAttribute(entry.getKey())
|| subjectCD.getUnknownAttributes().isIDAttribute(entry.getKey())) {
attribute.getOwnerElement().setIdAttributeNode(attribute, true);
}
}
}
示例5: marshallAttributes
import org.opensaml.xml.util.XMLHelper; //导入方法依赖的package包/类
/** {@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);
}
}
}
示例6: marshallAttributes
import org.opensaml.xml.util.XMLHelper; //导入方法依赖的package包/类
/** {@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);
}
}
}
示例7: marshallAttributes
import org.opensaml.xml.util.XMLHelper; //导入方法依赖的package包/类
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException {
Attribute attribute = (Attribute) samlElement;
if (attribute.getName() != null) {
domElement.setAttributeNS(null, Attribute.NAME_ATTTRIB_NAME, attribute.getName());
}
if (attribute.getNameFormat() != null) {
domElement.setAttributeNS(null, Attribute.NAME_FORMAT_ATTRIB_NAME, attribute.getNameFormat());
}
if (attribute.getFriendlyName() != null) {
domElement.setAttributeNS(null, Attribute.FRIENDLY_NAME_ATTRIB_NAME, attribute.getFriendlyName());
}
Attr attr;
for (Entry<QName, String> entry : attribute.getUnknownAttributes().entrySet()) {
attr = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey());
attr.setValue(entry.getValue());
domElement.setAttributeNodeNS(attr);
if (Configuration.isIDAttribute(entry.getKey())
|| attribute.getUnknownAttributes().isIDAttribute(entry.getKey())) {
attr.getOwnerElement().setIdAttributeNode(attr, true);
}
}
}
示例8: marshallAttributes
import org.opensaml.xml.util.XMLHelper; //导入方法依赖的package包/类
/**
* Marshalls the <code>xs:anyAttribute</code> attributes.
*
* {@inheritDoc}
*/
protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
AttributeExtensibleXMLObject anyAttribute = (AttributeExtensibleXMLObject) xmlObject;
Attr attribute;
Document document = domElement.getOwnerDocument();
for (Entry<QName, String> entry : anyAttribute.getUnknownAttributes().entrySet()) {
attribute = XMLHelper.constructAttribute(document, entry.getKey());
attribute.setValue(entry.getValue());
domElement.setAttributeNodeNS(attribute);
if (Configuration.isIDAttribute(entry.getKey())
|| anyAttribute.getUnknownAttributes().isIDAttribute(entry.getKey())) {
attribute.getOwnerElement().setIdAttributeNode(attribute, true);
}
}
}
示例9: marshallAttributes
import org.opensaml.xml.util.XMLHelper; //导入方法依赖的package包/类
/** {@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);
}
}
}
示例10: marshallAttributes
import org.opensaml.xml.util.XMLHelper; //导入方法依赖的package包/类
/**
* {@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);
}
}
示例11: marshallAttributes
import org.opensaml.xml.util.XMLHelper; //导入方法依赖的package包/类
/**
* {@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);
}
}
示例12: marshallAttributes
import org.opensaml.xml.util.XMLHelper; //导入方法依赖的package包/类
/**
* {@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);
}
}
示例13: marshallAttributes
import org.opensaml.xml.util.XMLHelper; //导入方法依赖的package包/类
/**
* {@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);
}
}
示例14: marshallAttributes
import org.opensaml.xml.util.XMLHelper; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void marshallAttributes(XMLObject samlElement, Element domElement) {
Endpoint endpoint = (Endpoint) samlElement;
if (endpoint.getBinding() != null) {
domElement.setAttributeNS(null, Endpoint.BINDING_ATTRIB_NAME, endpoint.getBinding().toString());
}
if (endpoint.getLocation() != null) {
domElement.setAttributeNS(null, Endpoint.LOCATION_ATTRIB_NAME, endpoint.getLocation().toString());
}
if (endpoint.getResponseLocation() != null) {
domElement.setAttributeNS(null, Endpoint.RESPONSE_LOCATION_ATTRIB_NAME, endpoint.getResponseLocation()
.toString());
}
Attr attribute;
for (Entry<QName, String> entry : endpoint.getUnknownAttributes().entrySet()) {
attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey());
attribute.setValue(entry.getValue());
domElement.setAttributeNodeNS(attribute);
if (Configuration.isIDAttribute(entry.getKey())
|| endpoint.getUnknownAttributes().isIDAttribute(entry.getKey())) {
attribute.getOwnerElement().setIdAttributeNode(attribute, true);
}
}
}
示例15: marshallAttributes
import org.opensaml.xml.util.XMLHelper; //导入方法依赖的package包/类
/**
* {@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);
}
}