本文整理汇总了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());
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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));
}
示例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();
}
示例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));
}
示例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);
}
示例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());
}
示例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());
}
示例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());
}
示例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);
}
示例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);
}
示例14: validate
import org.opensaml.saml1.core.Attribute; //导入依赖的package包/类
/** {@inheritDoc} */
public void validate(Attribute attribute) throws ValidationException {
super.validate(attribute);
validateAttributeValue(attribute);
}
示例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);
}