当前位置: 首页>>代码示例>>Java>>正文


Java XMLHelper.constructAttribute方法代码示例

本文整理汇总了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);
        }
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:23,代码来源:EncryptionPropertyMarshaller.java

示例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);
        }
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:20,代码来源:AttributeValueTypeMarshaller.java

示例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);
        }
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:20,代码来源:ContactPersonMarshaller.java

示例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);
        }
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:39,代码来源:SubjectConfirmationDataMarshaller.java

示例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);
        }
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:EnvelopeMarshaller.java

示例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);
        }
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:HeaderMarshaller.java

示例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);
        }
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:28,代码来源:AttributeMarshaller.java

示例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);
        }
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:20,代码来源:AbstractExtensibleXMLObjectMarshaller.java

示例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);
        }
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:XSAnyMarshaller.java

示例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);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:LocalizedURIMarshaller.java

示例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);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:ServiceNameMarshaller.java

示例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);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:KeywordsMarshaller.java

示例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);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:LocalizedNameMarshaller.java

示例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);
        }
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:28,代码来源:EndpointMarshaller.java

示例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);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:OrganizationNameMarshaller.java


注:本文中的org.opensaml.xml.util.XMLHelper.constructAttribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。