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

@ -11,8 +11,8 @@ fieldset[disabled].btn {
/* Move down content because we have a fixed navbar that is 50px tall */ /* Move down content because we have a fixed navbar that is 50px tall */
body { body {
padding-top: 50px; padding-top: 50px;
overflow-x: hidden; overflow-x: hidden;
} }
.clientCodeBox .clientCodeBox
@ -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;
} }
/* /*
@ -151,16 +152,16 @@ PRE.resultBodyPre {
*/ */
.sub-header { .sub-header {
padding-bottom: 10px; padding-bottom: 10px;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
} }
body .syntaxhighlighter .line { body .syntaxhighlighter .line {
white-space: pre-wrap !important; /* make code wrap */ white-space: pre-wrap !important; /* make code wrap */
} }
.syntaxhighlight { .syntaxhighlight {
white-space: pre-wrap; white-space: pre-wrap;
} }
/* /*
@ -216,14 +217,14 @@ body .syntaxhighlighter .line {
padding: 20px; padding: 20px;
} }
@media (min-width: 768px) { @media (min-width: 768px) {
.main { .main {
padding-top: 10px; padding-top: 10px;
padding-right: 10px; padding-right: 10px;
padding-left: 10px; padding-left: 10px;
} }
} }
.main .page-header { .main .page-header {
margin-top: 0; margin-top: 0;
} }
.navBarButtonLabel { .navBarButtonLabel {
@ -235,18 +236,18 @@ body .syntaxhighlighter .line {
*/ */
.placeholders { .placeholders {
margin-bottom: 30px; margin-bottom: 30px;
text-align: center; text-align: center;
} }
.placeholders h4 { .placeholders h4 {
margin-bottom: 0; margin-bottom: 0;
} }
.placeholder { .placeholder {
margin-bottom: 20px; margin-bottom: 20px;
} }
.placeholder img { .placeholder img {
display: inline-block; display: inline-block;
border-radius: 50%; border-radius: 50%;
} }
DIV.queryParameter { DIV.queryParameter {

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">