Fix #36 - Allow removal of extensions

This commit is contained in:
James Agnew 2015-04-28 13:58:22 -04:00
parent 0d71be25dd
commit b68ce95b3f
4 changed files with 39 additions and 24 deletions

View File

@ -91,7 +91,7 @@ public abstract class BaseElement implements IElement, ISupportsUndeclaredExtens
if (myUndeclaredExtensions == null) { if (myUndeclaredExtensions == null) {
myUndeclaredExtensions = new ArrayList<ExtensionDt>(); myUndeclaredExtensions = new ArrayList<ExtensionDt>();
} }
return Collections.unmodifiableList(myUndeclaredExtensions); return (myUndeclaredExtensions);
} }
@Override @Override
@ -111,7 +111,7 @@ public abstract class BaseElement implements IElement, ISupportsUndeclaredExtens
if (myUndeclaredModifierExtensions == null) { if (myUndeclaredModifierExtensions == null) {
myUndeclaredModifierExtensions = new ArrayList<ExtensionDt>(); myUndeclaredModifierExtensions = new ArrayList<ExtensionDt>();
} }
return Collections.unmodifiableList(myUndeclaredModifierExtensions); return (myUndeclaredModifierExtensions);
} }
/** /**

View File

@ -27,22 +27,28 @@ import org.hl7.fhir.instance.model.api.IBaseDatatype;
public interface ISupportsUndeclaredExtensions extends IElement { public interface ISupportsUndeclaredExtensions extends IElement {
/** /**
* Returns a list containing all undeclared non-modifier extensions * Returns a list containing all undeclared non-modifier extensions. The returned list
* is mutable, so it may be modified (e.g. to add or remove an extension).
*/ */
List<ExtensionDt> getUndeclaredExtensions(); List<ExtensionDt> getUndeclaredExtensions();
/** /**
* Returns a list containing all undeclared extensions (modifier and non-modifier) by extension URL * Returns an <b>immutable</b> list containing all undeclared extensions (modifier and non-modifier) by extension URL
*
* @see #getUndeclaredExtensions() To return a mutable list which may be used to remove extensions
*/ */
List<ExtensionDt> getUndeclaredExtensionsByUrl(String theUrl); List<ExtensionDt> getUndeclaredExtensionsByUrl(String theUrl);
/** /**
* Returns an <b>immutable</b> list containing all extensions (modifier and non-modifier) * Returns an <b>immutable</b> list containing all extensions (modifier and non-modifier).
*
* @see #getUndeclaredExtensions() To return a mutable list which may be used to remove extensions
*/ */
List<ExtensionDt> getAllUndeclaredExtensions(); List<ExtensionDt> getAllUndeclaredExtensions();
/** /**
* Returns a list containing all undeclared modifier extensions * Returns a list containing all undeclared modifier extensions. The returned list
* is mutable, so it may be modified (e.g. to add or remove an extension).
*/ */
List<ExtensionDt> getUndeclaredModifierExtensions(); List<ExtensionDt> getUndeclaredModifierExtensions();
@ -65,6 +71,8 @@ public interface ISupportsUndeclaredExtensions extends IElement {
/** /**
* Adds an extension to this object * Adds an extension to this object
*
* @see #getUndeclaredExtensions() To return a mutable list which may be used to remove extensions
*/ */
ExtensionDt addUndeclaredExtension(boolean theIsModifier, String theUrl, IBaseDatatype theValue); ExtensionDt addUndeclaredExtension(boolean theIsModifier, String theUrl, IBaseDatatype theValue);
@ -72,6 +80,8 @@ public interface ISupportsUndeclaredExtensions extends IElement {
* Adds an extension to this object. This method is intended for use when * Adds an extension to this object. This method is intended for use when
* an extension is being added which will contain child extensions, as opposed to * an extension is being added which will contain child extensions, as opposed to
* a datatype. * a datatype.
*
* @see #getUndeclaredExtensions() To return a mutable list which may be used to remove extensions
*/ */
ExtensionDt addUndeclaredExtension(boolean theIsModifier, String theUrl); ExtensionDt addUndeclaredExtension(boolean theIsModifier, String theUrl);

View File

@ -144,6 +144,7 @@ PRE.resultBodyPre {
background-color: transparent; background-color: transparent;
overflow: visible; overflow: visible;
/*white-space: normal;*/ /*white-space: normal;*/
white-space: pre-wrap;
} }
/* /*

View File

@ -164,6 +164,10 @@
enter partial dates, or dates without times, or even test out invalid date enter partial dates, or dates without times, or even test out invalid date
options. options.
</action> </action>
<action type="fix" issue="36">
Make BaseElement#getUndeclaredExtensions() and BaseElement#getUndeclaredExtensions() return
a mutable list so that it is possible to delete extensions from a resource instance.
</action>
</release> </release>
<release version="0.9" date="2015-Mar-14"> <release version="0.9" date="2015-Mar-14">
<action type="add"> <action type="add">