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


Java Attribute类代码示例

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


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


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