• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Attribute类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.opensaml.saml1.core.Attribute的典型用法代码示例。如果您正苦于以下问题:Java Attribute类的具体用法?Java Attribute怎么用?Java Attribute使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Attribute类属于org.opensaml.saml1.core包,在下文中一共展示了Attribute类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testChildElementsUnmarshall

import org.opensaml.saml1.core.Attribute; //导入依赖的package包/类
/** {@inheritDoc} */

    public void testChildElementsUnmarshall() {
        AttributeStatement attributeStatement = (AttributeStatement) unmarshallElement(childElementsFile);

        assertNotNull("<Subject> element not present", attributeStatement.getSubject());
        assertNotNull("<AuthorityBinding> elements not present", attributeStatement.getAttributes());
        assertEquals("count of <AuthorityBinding> elements", 5, attributeStatement.getAttributes().size());

        Attribute attribute = attributeStatement.getAttributes().get(0);
        attributeStatement.getAttributes().remove(attribute);
        assertEquals("count of <AttributeStatement> elements after single remove", 4, attributeStatement
                .getAttributes().size());

        ArrayList<Attribute> list = new ArrayList<Attribute>(2);

        list.add(attributeStatement.getAttributes().get(0));
        list.add(attributeStatement.getAttributes().get(2));

        attributeStatement.getAttributes().removeAll(list);

        assertEquals("count of <AttributeStatement> elements after double remove", 2, attributeStatement
                .getAttributes().size());
    }
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:25,代码来源:AttributeStatementTest.java


示例2: processChildElement

import org.opensaml.saml1.core.Attribute; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
        throws UnmarshallingException {

    AttributeStatement attributeStatement = (AttributeStatement) parentSAMLObject;

    if (childSAMLObject instanceof Attribute) {
        attributeStatement.getAttributes().add((Attribute) childSAMLObject);
    } else {
        super.processChildElement(parentSAMLObject, childSAMLObject);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:AttributeStatementUnmarshaller.java


示例3: processChildElement

import org.opensaml.saml1.core.Attribute; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
        throws UnmarshallingException {

    Attribute attribute = (Attribute) parentSAMLObject;

    QName childQName = childSAMLObject.getElementQName();
    if (childQName.getLocalPart().equals("AttributeValue")
            && childQName.getNamespaceURI().equals(SAMLConstants.SAML1_NS)) {
        attribute.getAttributeValues().add(childSAMLObject);
    } else {
        super.processChildElement(parentSAMLObject, childSAMLObject);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:AttributeUnmarshaller.java


示例4: processChildElement

import org.opensaml.saml1.core.Attribute; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject) throws UnmarshallingException {

    Attribute attribute = (Attribute) parentSAMLObject;

    QName childQName = childSAMLObject.getElementQName();
    if (childQName.getLocalPart().equals("AttributeValue") && childQName.getNamespaceURI().equals(SAMLConstants.SAML1_NS)) {
        attribute.getAttributeValues().add(childSAMLObject);
    } else {
        super.processChildElement(parentSAMLObject, childSAMLObject);
    }
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:13,代码来源:AttributeUnmarshaller.java


示例5: populateRequiredData

import org.opensaml.saml1.core.Attribute; //导入依赖的package包/类
/** {@inheritDoc} */
protected void populateRequiredData() {
    super.populateRequiredData();

    AttributeStatement attributeStatement = (AttributeStatement) target;
 
    QName qname = new QName(SAMLConstants.SAML1_NS, Attribute.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
    attributeStatement.getAttributes().add((Attribute)buildXMLObject(qname));
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:10,代码来源:AttributeStatementSchemaTest.java


示例6: AttributeSchemaTest

import org.opensaml.saml1.core.Attribute; //导入依赖的package包/类
/** Constructor */
public AttributeSchemaTest() {
    super();
    targetQName = new QName(SAMLConstants.SAML1_NS, Attribute.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
    validator = new AttributeSchemaValidator();

}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:8,代码来源:AttributeSchemaTest.java


示例7: populateRequiredData

import org.opensaml.saml1.core.Attribute; //导入依赖的package包/类
/** {@inheritDoc} */
protected void populateRequiredData() {
    super.populateRequiredData();

    Attribute attribute = (Attribute) target;
    
    XSStringBuilder attributeValueBuilder = (XSStringBuilder) builderFactory.getBuilder(XSString.TYPE_NAME);
    attribute.getAttributeValues().add(attributeValueBuilder.buildObject(AttributeValue.DEFAULT_ELEMENT_NAME));
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:10,代码来源:AttributeSchemaTest.java


示例8: AttributeTest

import org.opensaml.saml1.core.Attribute; //导入依赖的package包/类
/**
 * Constructor
 */
public AttributeTest() {
    super();
    singleElementFile = "/data/org/opensaml/saml1/impl/singleAttribute.xml";
    singleElementOptionalAttributesFile = "/data/org/opensaml/saml1/impl/singleAttributeAttributes.xml";
    childElementsFile = "/data/org/opensaml/saml1/impl/AttributeWithChildren.xml";
    expectedAttributeName = "AttributeName";
    expectedAttributeNamespace = "namespace";
    qname = new QName(SAMLConstants.SAML1_NS, Attribute.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:13,代码来源:AttributeTest.java


示例9: testSingleElementUnmarshall

import org.opensaml.saml1.core.Attribute; //导入依赖的package包/类
/** {@inheritDoc} */
public void testSingleElementUnmarshall() {
    Attribute attribute = (Attribute) unmarshallElement(singleElementFile);

    assertNull("AttributeName", attribute.getAttributeName());
    assertNull("AttributeNamespace", attribute.getAttributeNamespace());
    assertEquals("<AttributeValue> subelement found", 0, attribute.getAttributeValues().size());
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:9,代码来源:AttributeTest.java


示例10: testSingleElementOptionalAttributesUnmarshall

import org.opensaml.saml1.core.Attribute; //导入依赖的package包/类
/** {@inheritDoc} */
public void testSingleElementOptionalAttributesUnmarshall() {
    Attribute attribute = (Attribute) unmarshallElement(singleElementOptionalAttributesFile);

    assertEquals("AttributeName", expectedAttributeName, attribute.getAttributeName());
    assertEquals("AttributeNamespace", expectedAttributeNamespace, attribute.getAttributeNamespace());
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:8,代码来源:AttributeTest.java


示例11: testChildElementsUnmarshall

import org.opensaml.saml1.core.Attribute; //导入依赖的package包/类
/** {@inheritDoc} */
public void testChildElementsUnmarshall() {
    Attribute attribute = (Attribute) unmarshallElement(childElementsFile);

    assertNotNull("<AttributeValue> subelement not found", attribute.getAttributeValues());
    assertEquals("Number of <AttributeValue> subelement not found", 4, attribute.getAttributeValues().size());
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:8,代码来源:AttributeTest.java


示例12: testSingleElementOptionalAttributesMarshall

import org.opensaml.saml1.core.Attribute; //导入依赖的package包/类
/** {@inheritDoc} */
public void testSingleElementOptionalAttributesMarshall() {
    Attribute attribute = (Attribute) buildXMLObject(qname);

    attribute.setAttributeName(expectedAttributeName);
    attribute.setAttributeNamespace(expectedAttributeNamespace);
    assertEquals(expectedOptionalAttributesDOM, attribute);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:9,代码来源:AttributeTest.java


示例13: testChildElementsMarshall

import org.opensaml.saml1.core.Attribute; //导入依赖的package包/类
/** {@inheritDoc} */
public void testChildElementsMarshall(){
    Attribute attribute = (Attribute) buildXMLObject(qname);

    XSStringBuilder attributeValueBuilder = (XSStringBuilder) builderFactory.getBuilder(XSString.TYPE_NAME);
    
    attribute.getAttributeValues().add(attributeValueBuilder.buildObject(AttributeValue.DEFAULT_ELEMENT_NAME, XSString.TYPE_NAME)); 
    attribute.getAttributeValues().add(attributeValueBuilder.buildObject(AttributeValue.DEFAULT_ELEMENT_NAME, XSString.TYPE_NAME)); 
    attribute.getAttributeValues().add(attributeValueBuilder.buildObject(AttributeValue.DEFAULT_ELEMENT_NAME, XSString.TYPE_NAME)); 
    attribute.getAttributeValues().add(attributeValueBuilder.buildObject(AttributeValue.DEFAULT_ELEMENT_NAME, XSString.TYPE_NAME)); 

    assertEquals(expectedChildElementsDOM, attribute);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:14,代码来源:AttributeTest.java


示例14: validate

import org.opensaml.saml1.core.Attribute; //导入依赖的package包/类
/** {@inheritDoc} */
public void validate(Attribute attribute) throws ValidationException {
    super.validate(attribute);

    validateAttributeValue(attribute);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:7,代码来源:AttributeSchemaValidator.java


示例15: buildObject

import org.opensaml.saml1.core.Attribute; //导入依赖的package包/类
/** {@inheritDoc} */
public Attribute buildObject() {
    return buildObject(SAMLConstants.SAML1_NS, Attribute.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:AttributeBuilder.java


示例16: getAttributes

import org.opensaml.saml1.core.Attribute; //导入依赖的package包/类
/** {@inheritDoc} */
public List<Attribute> getAttributes() {
    return attributes;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:AttributeStatementImpl.java


示例17: createStatement

import org.opensaml.saml1.core.Attribute; //导入依赖的package包/类
@Override
public void createStatement(GenericIdentityProviderData ipData, RahasData rahasData)
        throws IdentityProviderException {
    if (log.isDebugEnabled()) {
        log.debug("Begin SAML statement creation.");
    }
    attributeStmt = (AttributeStatement) buildXMLObject(AttributeStatement.DEFAULT_ELEMENT_NAME);

    Subject subject = (Subject) buildXMLObject(Subject.DEFAULT_ELEMENT_NAME);
    SubjectConfirmation subjectConf =
            (SubjectConfirmation) buildXMLObject(SubjectConfirmation.DEFAULT_ELEMENT_NAME);
    ConfirmationMethod confMethod = (ConfirmationMethod) buildXMLObject(ConfirmationMethod.DEFAULT_ELEMENT_NAME);
    confMethod.setConfirmationMethod(CONF_KEY);
    subjectConf.getConfirmationMethods().add(confMethod);
    subject.setSubjectConfirmation(subjectConf);

    attributeStmt.setSubject(subject);

    Map<String, RequestedClaimData> mapClaims = ipData.getRequestedClaims();

    if (rahasData.getAppliesToAddress() != null) {
        appilesTo = rahasData.getAppliesToAddress();
    }

    Iterator<RequestedClaimData> ite = mapClaims.values().iterator();

    while (ite.hasNext()) {
        RequestedClaimData claim = ite.next();
        String uri = claim.getUri();

        int index = uri.lastIndexOf("/");
        String attrName = uri.substring(index + 1, uri.length());
        String attrNamespace = uri.substring(0, index);

        Attribute attribute = (Attribute) buildXMLObject(Attribute.DEFAULT_ELEMENT_NAME);
        attribute.setAttributeName(attrName);
        attribute.setAttributeNamespace(attrNamespace);

        XMLObjectBuilderFactory builderFactory = Configuration.getBuilderFactory();
        XSStringBuilder attributeValueBuilder = (XSStringBuilder) builderFactory.getBuilder(XSString.TYPE_NAME);

        XSString stringValue =
                attributeValueBuilder.buildObject(AttributeValue.DEFAULT_ELEMENT_NAME, XSString.TYPE_NAME);
        stringValue.setValue(claim.getValue());
        attribute.getAttributeValues().add(stringValue);

        attributeStmt.getAttributes().add(attribute);
    }
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:50,代码来源:SAML1TokenBuilder.java


示例18: AttributeUnmarshaller

import org.opensaml.saml1.core.Attribute; //导入依赖的package包/类
/**
 * Constructor
 */
public AttributeUnmarshaller() {
    super(SAMLConstants.SAML1_NS, Attribute.DEFAULT_ELEMENT_LOCAL_NAME);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:7,代码来源:AttributeUnmarshaller.java


示例19: AttributeMarshaller

import org.opensaml.saml1.core.Attribute; //导入依赖的package包/类
/**
 * Constructor
 */
public AttributeMarshaller() {
    super(SAMLConstants.SAML1_NS, Attribute.DEFAULT_ELEMENT_LOCAL_NAME);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:7,代码来源:AttributeMarshaller.java


示例20: testMissingValue

import org.opensaml.saml1.core.Attribute; //导入依赖的package包/类
public void testMissingValue() {
    Attribute attribute = (Attribute) target;
    attribute.getAttributeValues().clear();
    
    assertValidationFail("No AttributeValue elements");
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:7,代码来源:AttributeSchemaTest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SpillRecord类代码示例发布时间:2022-05-23
下一篇:
Java VehicleServiceException类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap