View Javadoc
1   package ca.uhn.fhir.model.api;
2   
3   /*
4    * #%L
5    * HAPI FHIR - Core Library
6    * %%
7    * Copyright (C) 2014 - 2018 University Health Network
8    * %%
9    * Licensed under the Apache License, Version 2.0 (the "License");
10   * you may not use this file except in compliance with the License.
11   * You may obtain a copy of the License at
12   * 
13   *      http://www.apache.org/licenses/LICENSE-2.0
14   * 
15   * Unless required by applicable law or agreed to in writing, software
16   * distributed under the License is distributed on an "AS IS" BASIS,
17   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18   * See the License for the specific language governing permissions and
19   * limitations under the License.
20   * #L%
21   */
22  
23  import java.util.List;
24  
25  import org.hl7.fhir.instance.model.api.IBaseDatatype;
26  
27  public interface ISupportsUndeclaredExtensions extends IElement {
28  	
29  	/**
30  	 * Returns a list containing all undeclared non-modifier extensions. The returned list
31  	 * is mutable, so it may be modified (e.g. to add or remove an extension).
32  	 */
33  	List<ExtensionDt> getUndeclaredExtensions();
34  
35  	/**
36  	 * Returns an <b>immutable</b> list containing all undeclared extensions (modifier and non-modifier) by extension URL
37  	 * 
38  	 * @see #getUndeclaredExtensions() To return a mutable list which may be used to remove extensions
39  	 */
40  	List<ExtensionDt> getUndeclaredExtensionsByUrl(String theUrl);
41  
42  	/**
43  	 * Returns an <b>immutable</b> list containing all extensions (modifier and non-modifier).
44  	 * 
45  	 * @see #getUndeclaredExtensions() To return a mutable list which may be used to remove extensions
46  	 */
47  	List<ExtensionDt> getAllUndeclaredExtensions();
48  
49  	/**
50  	 * Returns a list containing all undeclared modifier extensions. The returned list
51  	 * is mutable, so it may be modified (e.g. to add or remove an extension).
52  	 */
53  	List<ExtensionDt> getUndeclaredModifierExtensions();
54  	
55  	/**
56  	 * Adds an extension to this object. This extension should have the
57  	 * following properties set:
58  	 * <ul>
59  	 * <li>{@link ExtensionDt#setModifier(boolean) Is Modifier}</li>
60  	 * <li>{@link ExtensionDt#setUrl(String) URL}</li>
61  	 * <li>And one of:
62  	 * <ul>
63  	 * <li>{@link ExtensionDt#setValue(IBaseDatatype) A datatype value}</li>
64  	 * <li>{@link #addUndeclaredExtension(ExtensionDt) Further sub-extensions}</li>
65  	 * </ul>
66  	 * </ul> 
67  	 * 
68  	 * @param theExtension The extension to add. Can not be null.
69  	 */
70  	void addUndeclaredExtension(ExtensionDt theExtension);
71  	
72  	/**
73  	 * Adds an extension to this object
74  	 * 
75  	 * @see #getUndeclaredExtensions() To return a mutable list which may be used to remove extensions
76  	 */
77  	ExtensionDt addUndeclaredExtension(boolean theIsModifier, String theUrl, IBaseDatatype theValue);
78  
79  	/**
80  	 * Adds an extension to this object. This method is intended for use when
81  	 * an extension is being added which will contain child extensions, as opposed to
82  	 * a datatype.
83  	 * 
84  	 * @see #getUndeclaredExtensions() To return a mutable list which may be used to remove extensions
85  	 */
86  	ExtensionDt addUndeclaredExtension(boolean theIsModifier, String theUrl);
87  
88  }