More work on these extensison

This commit is contained in:
James Agnew 2017-01-26 06:25:47 -05:00
parent 2eb780a690
commit 234b4a0c1c
1 changed files with 10 additions and 1 deletions

View File

@ -29,6 +29,7 @@ import org.hl7.fhir.instance.model.api.IBase;
import ca.uhn.fhir.model.api.IElement;
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.Extension;
@ -66,11 +67,19 @@ public class RuntimeChildDeclaredExtensionDefinition extends RuntimeChildChoiceD
choiceTypes.add(next);
}
if (Modifier.isAbstract(theField.getType().getModifiers()) == false) {
choiceTypes.add((Class<? extends IBase>) theField.getType());
Class<?> type = theField.getType();
if (type.getAnnotation(DatatypeDef.class) != null) {
choiceTypes.add((Class<? extends IBase>) type);
}
}
setChoiceTypes(choiceTypes);
}
@Override
public String getElementName() {
return "value";
}
@Override
public Object getInstanceConstructorArguments() {
Object retVal = myInstanceConstructorArguments;