Skip to Content.
Sympa Menu

mace-opensaml-users - RE: How can I create an instance of a AttributeValue

Subject: OpenSAML user discussion

List archive

RE: How can I create an instance of a AttributeValue


Chronological Thread 
  • From: "Singh, Manish" <>
  • To: <>
  • Subject: RE: How can I create an instance of a AttributeValue
  • Date: Fri, 29 Feb 2008 10:29:50 -0500

This is code from org.opensaml.saml1.core.impl.AttributeTest that might
be helpful to you.

public void testChildElementsMarshall(){
Attribute attribute = (Attribute) buildXMLObject(qname);

XSStringBuilder attributeValueBuilder = (XSStringBuilder)
builderFactory.getBuilder(XSString.TYPE_NAME);


attribute.getAttributeValues().add(attributeValueBuilder.buildObject(Att
ributeValue.DEFAULT_ELEMENT_NAME, XSString.TYPE_NAME));

attribute.getAttributeValues().add(attributeValueBuilder.buildObject(Att
ributeValue.DEFAULT_ELEMENT_NAME, XSString.TYPE_NAME));

attribute.getAttributeValues().add(attributeValueBuilder.buildObject(Att
ributeValue.DEFAULT_ELEMENT_NAME, XSString.TYPE_NAME));

attribute.getAttributeValues().add(attributeValueBuilder.buildObject(Att
ributeValue.DEFAULT_ELEMENT_NAME, XSString.TYPE_NAME));

assertEquals(expectedChildElementsDOM, attribute);
}

-----Original Message-----
From:

[mailto:]

Sent: Friday, February 29, 2008 10:11 AM
To:

Subject: How can I create an instance of a AttributeValue

How can I create an instance of an AttributeValue of a simple type such
as xs:string.

I have tried the following, but the returned XMLObjectBuilder is null.

XMLObjectBuilder xmlObjectBuilder =
xmlObjectBuilderFactory.getBuilder(AttributeValue.DEFAULT_ELEMENT_NAME);

XSString xsString =
(XSString)xmlObjectBuilder.buildObject(AttributeValue.DEFAULT_ELEMENT_NA
ME, XSString.TYPE_NAME);

xsString.setValue(value);

Thanks

Regards

Matthew Webb



Archive powered by MHonArc 2.6.16.

Top of Page