Deprecate getAllPopulatedChildElementsOfType

This commit is contained in:
James 2017-01-31 06:53:04 -05:00
parent e5b9aa4536
commit 11f1f4f6ee
3 changed files with 28 additions and 0 deletions

View File

@ -28,7 +28,15 @@ public interface ICompositeElement extends IElement {
* Returns a list containing all child elements matching a given type
*
* @param theType The type to match. If set to null, all child elements will be returned
*
* @deprecated This method is not used by HAPI at this point, so there isn't much
* point to keeping it around. We are not deleting it just so that we don't break
* existing implementer code, but you do not need to supply an implementation
* of this code in your own structures. Deprecated in HAPI FHIR 2.3 (Jan 2017).
* See See <a href="https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/hapi-fhir/AeV2hTDt--E/6EOgRA8YBwAJ"> for
* a discussion about this.
*/
@Deprecated
<T extends IElement>
List<T> getAllPopulatedChildElementsOfType(Class<T> theType);

View File

@ -34,6 +34,8 @@ import org.hl7.fhir.instance.model.api.IIdType;
import org.hl7.fhir.instance.model.api.IPrimitiveType;
import ca.uhn.fhir.model.api.BaseElement;
import ca.uhn.fhir.model.api.ICompositeElement;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum;
import ca.uhn.fhir.model.api.Tag;
@ -92,6 +94,17 @@ public abstract class BaseResource extends BaseElement implements IResource {
@Child(name = "text", order = 1, min = 0, max = 1)
private NarrativeDt myText;
/**
* NOP implementation of this method.
*
* @see ICompositeElement#getAllPopulatedChildElementsOfType(Class) for an explanation of why you
* don't need to override this method
*/
@Override
public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
return Collections.emptyList();
}
@Override
public ContainedDt getContained() {
if (myContained == null) {

View File

@ -256,6 +256,13 @@
successful operation under Spring 4.3. Thanks to
Robbert van Waveren for the pull request!
</action>
<action type="remove">
Deprecate the method
<![CDATA[<code>ICompositeElement#getAllPopulatedChildElementsOfType(Class)</code>]]>
as it is no longer used by HAPI and is just an annoying step
in creating custom structures. Thanks to Allan Bro Hansen
for pointing this out.
</action>
</release>
<release version="2.1" date="2016-11-11">
<action type="add">