import org.apache.ws.secpolicy.model.SignedEncryptedElements;
public class EncryptedElementsBuilder implements AssertionBuilder<OMElement> {
public Assertion build(OMElement element, AssertionBuilderFactory factory) throws IllegalArgumentException {
SignedEncryptedElements signedEncryptedElements = new SignedEncryptedElements(false, SPConstants.SP_V12);
OMAttribute attribute = element.getAttribute(SP12Constants.ATTR_XPATH_VERSION);
if (attribute != null) {
signedEncryptedElements.setXPathVersion(attribute.getAttributeValue());
}
for (Iterator iterator = element.getChildElements(); iterator.hasNext();) {
processElement((OMElement) iterator.next(), signedEncryptedElements);
}
OMAttribute isOptional = element
.getAttribute(Constants.Q_ELEM_OPTIONAL_ATTR);
if (isOptional != null) {
signedEncryptedElements.setOptional(Boolean.valueOf(isOptional
.getAttributeValue()).booleanValue());
}
return signedEncryptedElements;
}