View Javadoc
1   package ca.uhn.fhir.context;
2   
3   /*
4    * #%L
5    * HAPI FHIR - Core Library
6    * %%
7    * Copyright (C) 2014 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  import java.util.Map;
25  import java.util.Set;
26  
27  import ca.uhn.fhir.model.api.IElement;
28  
29  public abstract class BaseRuntimeChildDefinition {
30  
31  	public abstract IAccessor getAccessor();
32  
33  	@Override
34  	public String toString() {
35  		return getClass().getSimpleName()+"[" + getElementName() + "]";
36  	}
37  
38  	public abstract BaseRuntimeElementDefinition<?> getChildByName(String theName);
39  
40  	public abstract BaseRuntimeElementDefinition<?> getChildElementDefinitionByDatatype(Class<? extends IElement> theType);
41  
42  	public abstract String getChildNameByDatatype(Class<? extends IElement> theDatatype);
43  
44  	public abstract IMutator getMutator();
45  
46  	public abstract Set<String> getValidChildNames();
47  
48  	abstract void sealAndInitialize(Map<Class<? extends IElement>, BaseRuntimeElementDefinition<?>> theClassToElementDefinitions);
49  
50  	public interface IAccessor {
51  		List<? extends IElement> getValues(Object theTarget);
52  	}
53  
54  	public abstract String getElementName();
55  	
56  	public abstract int getMax();
57  	
58  	public abstract int getMin();
59  	
60  	public interface IMutator {
61  		void addValue(Object theTarget, IElement theValue);
62  	}
63  
64  	public String getExtensionUrl() {
65  		return null;
66  	}
67  
68  	public Object getInstanceConstructorArguments() {
69  		return null;
70  	}
71  
72  //	public String getExtensionUrl() {
73  //		return null;
74  //	}
75  }