public class KeyValueUnmarshaller extends AbstractXMLSignatureUnmarshaller {
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
throws UnmarshallingException {
KeyValue keyValue = (KeyValue) parentXMLObject;
if (childXMLObject instanceof DSAKeyValue) {
keyValue.setDSAKeyValue((DSAKeyValue) childXMLObject);
} else if (childXMLObject instanceof RSAKeyValue) {
keyValue.setRSAKeyValue((RSAKeyValue) childXMLObject);
} else {
// There can be only one...
if (keyValue.getUnknownXMLObject() == null) {
keyValue.setUnknownXMLObject(childXMLObject);
} else {
// If this happens, throw the others up to the parent class to be logged/handled.
super.processChildElement(parentXMLObject, childXMLObject);
}
}