/** {@inheritDoc} */ protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject) throws UnmarshallingException { CipherData cipherData = (CipherData) parentXMLObject; if (childXMLObject instanceof CipherValue) { cipherData.setCipherValue((CipherValue) childXMLObject); } else if (childXMLObject instanceof CipherReference) { cipherData.setCipherReference((CipherReference) childXMLObject); } else { super.processChildElement(parentXMLObject, childXMLObject); } }
/** * Validate that required children are present. * * @param xmlObject the object to validate * @throws ValidationException thrown if the object is invalid */ protected void validateChildrenPresence(CipherData xmlObject) throws ValidationException { if (xmlObject.getCipherValue() == null && xmlObject.getCipherReference() == null) { throw new ValidationException("CipherData did not contain either a CipherValue or CipherReference child"); } if (xmlObject.getCipherValue() != null && xmlObject.getCipherReference() != null) { throw new ValidationException("CipherData contained both a CipherValue and a CipherReference child"); } } }
cipherData.setCipherValue(cipherValue);
/** {@inheritDoc} */ protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject) throws UnmarshallingException { CipherData cipherData = (CipherData) parentXMLObject; if (childXMLObject instanceof CipherValue) { cipherData.setCipherValue((CipherValue) childXMLObject); } else if (childXMLObject instanceof CipherReference) { cipherData.setCipherReference((CipherReference) childXMLObject); } else { super.processChildElement(parentXMLObject, childXMLObject); } }
/** * Validate that required children are present. * * @param xmlObject the object to validate * @throws ValidationException thrown if the object is invalid */ protected void validateChildrenPresence(CipherData xmlObject) throws ValidationException { if (xmlObject.getCipherValue() == null && xmlObject.getCipherReference() == null) { throw new ValidationException("CipherData did not contain either a CipherValue or CipherReference child"); } if (xmlObject.getCipherValue() != null && xmlObject.getCipherReference() != null) { throw new ValidationException("CipherData contained both a CipherValue and a CipherReference child"); } } }