mirror of
https://github.com/hapifhir/hapi-fhir.git
synced 2025-02-16 18:05:19 +00:00
FIx test
This commit is contained in:
parent
e5876f7d86
commit
d6ea0552b7
@ -23,14 +23,16 @@ import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
|||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Modifier;
|
import java.lang.reflect.Modifier;
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.hl7.fhir.instance.model.api.IBase;
|
import org.hl7.fhir.instance.model.api.IBase;
|
||||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
|
||||||
|
|
||||||
import ca.uhn.fhir.model.api.IElement;
|
import ca.uhn.fhir.model.api.IElement;
|
||||||
import ca.uhn.fhir.model.api.annotation.Child;
|
import ca.uhn.fhir.model.api.annotation.Child;
|
||||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
|
||||||
import ca.uhn.fhir.model.api.annotation.Description;
|
import ca.uhn.fhir.model.api.annotation.Description;
|
||||||
import ca.uhn.fhir.model.api.annotation.Extension;
|
import ca.uhn.fhir.model.api.annotation.Extension;
|
||||||
import ca.uhn.fhir.util.ReflectionUtil;
|
import ca.uhn.fhir.util.ReflectionUtil;
|
||||||
@ -54,7 +56,6 @@ public class RuntimeChildDeclaredExtensionDefinition extends RuntimeChildChoiceD
|
|||||||
* @param theDefinedLocally
|
* @param theDefinedLocally
|
||||||
* See {@link Extension#definedLocally()}
|
* See {@link Extension#definedLocally()}
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
RuntimeChildDeclaredExtensionDefinition(Field theField, Child theChild, Description theDescriptionAnnotation, Extension theExtension, String theElementName, String theExtensionUrl,
|
RuntimeChildDeclaredExtensionDefinition(Field theField, Child theChild, Description theDescriptionAnnotation, Extension theExtension, String theElementName, String theExtensionUrl,
|
||||||
Class<? extends IBase> theChildType, Object theBoundTypeBinder)
|
Class<? extends IBase> theChildType, Object theBoundTypeBinder)
|
||||||
throws ConfigurationException {
|
throws ConfigurationException {
|
||||||
@ -75,12 +76,6 @@ public class RuntimeChildDeclaredExtensionDefinition extends RuntimeChildChoiceD
|
|||||||
choiceTypes.add(theChildType);
|
choiceTypes.add(theChildType);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (Modifier.isAbstract(theField.getType().getModifiers()) == false) {
|
|
||||||
// Class<?> type = theField.getType();
|
|
||||||
// if (type.getAnnotation(DatatypeDef.class) != null) {
|
|
||||||
// choiceTypes.add((Class<? extends IBase>) type);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
setChoiceTypes(choiceTypes);
|
setChoiceTypes(choiceTypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,16 +123,6 @@ public class RuntimeChildDeclaredExtensionDefinition extends RuntimeChildChoiceD
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseRuntimeElementDefinition<?> getChildByName(String theName) {
|
public BaseRuntimeElementDefinition<?> getChildByName(String theName) {
|
||||||
// if (myDatatypeChildName != null) {
|
|
||||||
// if (myDatatypeChildName.equals(theName)) {
|
|
||||||
// return myChildDef;
|
|
||||||
// } else {
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
|
|
||||||
String name = theName;
|
String name = theName;
|
||||||
if ("extension".equals(name)||"modifierExtension".equals(name)) {
|
if ("extension".equals(name)||"modifierExtension".equals(name)) {
|
||||||
if (myChildResourceBlock != null) {
|
if (myChildResourceBlock != null) {
|
||||||
@ -147,19 +132,12 @@ public class RuntimeChildDeclaredExtensionDefinition extends RuntimeChildChoiceD
|
|||||||
return myChildDef;
|
return myChildDef;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// if ("valueResourceReference".equals(name)) {
|
if (getValidChildNames().contains(name) == false) {
|
||||||
// name = "valueReference";
|
return null;
|
||||||
// }
|
|
||||||
|
|
||||||
if (myChildResourceBlock != null) {
|
|
||||||
return myChildResourceBlock;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.getChildByName(name);
|
return super.getChildByName(name);
|
||||||
//
|
|
||||||
//
|
|
||||||
// return super.getChildByName(theName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -176,17 +154,6 @@ public class RuntimeChildDeclaredExtensionDefinition extends RuntimeChildChoiceD
|
|||||||
return myUrlToChildExtension.get(theUrl);
|
return myUrlToChildExtension.get(theUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
|
||||||
// public String getChildNameByDatatype(Class<? extends IBase> theDatatype) {
|
|
||||||
// String retVal = super.getChildNameByDatatype(theDatatype);
|
|
||||||
// if (retVal )
|
|
||||||
// if (myChildType.equals(theDatatype) && myDatatypeChildName != null) {
|
|
||||||
// return myDatatypeChildName;
|
|
||||||
// } else {
|
|
||||||
// return "extension";
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getExtensionUrl() {
|
public String getExtensionUrl() {
|
||||||
return myExtensionUrl;
|
return myExtensionUrl;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user