if (nextDefDatatype.getProfileOf() != null && !IPrimitiveType.class.isAssignableFrom(next)) { nextDefForChoice = null; nonPreferred = true; Class<? extends IBaseDatatype> profileType = nextDefDatatype.getProfileOf(); BaseRuntimeElementDefinition<?> elementDef = theClassToElementDefinitions.get(profileType); elementName = getElementName() + StringUtils.capitalize(elementDef.getName());
@Override public boolean isProfileOf(Class<? extends IBaseDatatype> theType) { if (myProfileOfType != null) { if (myProfileOfType.equals(theType)) { return true; } else if (myProfileOf instanceof IRuntimeDatatypeDefinition) { return ((IRuntimeDatatypeDefinition) myProfileOf).isProfileOf(theType); } } return false; }
if (((IRuntimeDatatypeDefinition) nextDef).isSpecialization()) {
@Override public boolean isProfileOf(Class<? extends IBaseDatatype> theType) { validateSealed(); if (myProfileOfType != null) { if (myProfileOfType.equals(theType)) { return true; } else if (myProfileOf instanceof IRuntimeDatatypeDefinition) { return ((IRuntimeDatatypeDefinition) myProfileOf).isProfileOf(theType); } } return false; }
@SuppressWarnings("unchecked") private void addParam(String theName, IBase theValue) { BaseRuntimeChildDefinition parameterChild = myParametersDef.getChildByName("parameter"); BaseRuntimeElementCompositeDefinition<?> parameterElem = (BaseRuntimeElementCompositeDefinition<?>) parameterChild.getChildByName("parameter"); IBase parameter = parameterElem.newInstance(); parameterChild.getMutator().addValue(myParameters, parameter); IPrimitiveType<String> name = (IPrimitiveType<String>) myContext.getElementDefinition("string").newInstance(); name.setValue(theName); parameterElem.getChildByName("name").getMutator().setValue(parameter, name); if (theValue instanceof IBaseDatatype) { BaseRuntimeElementDefinition<?> datatypeDef = myContext.getElementDefinition(theValue.getClass()); if (datatypeDef instanceof IRuntimeDatatypeDefinition) { Class<? extends IBaseDatatype> profileOf = ((IRuntimeDatatypeDefinition) datatypeDef).getProfileOf(); if (profileOf != null) { datatypeDef = myContext.getElementDefinition(profileOf); } } String childElementName = "value" + StringUtils.capitalize(datatypeDef.getName()); BaseRuntimeChildDefinition childByName = parameterElem.getChildByName(childElementName); childByName.getMutator().setValue(parameter, theValue); } else if (theValue instanceof IBaseResource) { parameterElem.getChildByName("resource").getMutator().setValue(parameter, theValue); } else { throw new IllegalArgumentException("Don't know how to handle parameter of type " + theValue.getClass()); } }
boolean isSpecialization = ((IRuntimeDatatypeDefinition) next).isSpecialization(); if (isSpecialization) { ourLog.trace("Not adding specialization: {}", next.getImplementingClass());
if (targetTypeDef instanceof IRuntimeDatatypeDefinition && sourceTypeDef instanceof IRuntimeDatatypeDefinition) { IRuntimeDatatypeDefinition targetTypeDtDef = (IRuntimeDatatypeDefinition) targetTypeDef; if (targetTypeDtDef.isProfileOf(sourceType)) { FhirTerser terser = myContext.newTerser(); IBase newTarget = targetTypeDef.newInstance();
if (nextDefDatatype.getProfileOf() != null && !IPrimitiveType.class.isAssignableFrom(next)) { nextDefForChoice = null; nonPreferred = true; Class<? extends IBaseDatatype> profileType = nextDefDatatype.getProfileOf(); BaseRuntimeElementDefinition<?> elementDef = theClassToElementDefinitions.get(profileType); elementName = getElementName() + StringUtils.capitalize(elementDef.getName());
if (((IRuntimeDatatypeDefinition) nextDef).isSpecialization()) {
@Override public boolean isProfileOf(Class<? extends IBaseDatatype> theType) { if (myProfileOfType != null) { if (myProfileOfType.equals(theType)) { return true; } else if (myProfileOf instanceof IRuntimeDatatypeDefinition) { return ((IRuntimeDatatypeDefinition) myProfileOf).isProfileOf(theType); } } return false; }
@SuppressWarnings("unchecked") private void addParam(String theName, IBase theValue) { BaseRuntimeChildDefinition parameterChild = myParametersDef.getChildByName("parameter"); BaseRuntimeElementCompositeDefinition<?> parameterElem = (BaseRuntimeElementCompositeDefinition<?>) parameterChild.getChildByName("parameter"); IBase parameter = parameterElem.newInstance(); parameterChild.getMutator().addValue(myParameters, parameter); IPrimitiveType<String> name = (IPrimitiveType<String>) myContext.getElementDefinition("string").newInstance(); name.setValue(theName); parameterElem.getChildByName("name").getMutator().setValue(parameter, name); if (theValue instanceof IBaseDatatype) { BaseRuntimeElementDefinition<?> datatypeDef = myContext.getElementDefinition(theValue.getClass()); if (datatypeDef instanceof IRuntimeDatatypeDefinition) { Class<? extends IBaseDatatype> profileOf = ((IRuntimeDatatypeDefinition) datatypeDef).getProfileOf(); if (profileOf != null) { datatypeDef = myContext.getElementDefinition(profileOf); } } String childElementName = "value" + StringUtils.capitalize(datatypeDef.getName()); BaseRuntimeChildDefinition childByName = parameterElem.getChildByName(childElementName); childByName.getMutator().setValue(parameter, theValue); } else if (theValue instanceof IBaseResource) { parameterElem.getChildByName("resource").getMutator().setValue(parameter, theValue); } else { throw new IllegalArgumentException("Don't know how to handle parameter of type " + theValue.getClass()); } }
boolean isSpecialization = ((IRuntimeDatatypeDefinition) next).isSpecialization(); if (isSpecialization) { ourLog.trace("Not adding specialization: {}", next.getImplementingClass());
@Override public boolean isProfileOf(Class<? extends IBaseDatatype> theType) { validateSealed(); if (myProfileOfType != null) { if (myProfileOfType.equals(theType)) { return true; } else if (myProfileOf instanceof IRuntimeDatatypeDefinition) { return ((IRuntimeDatatypeDefinition) myProfileOf).isProfileOf(theType); } } return false; }
if (targetTypeDef instanceof IRuntimeDatatypeDefinition && sourceTypeDef instanceof IRuntimeDatatypeDefinition) { IRuntimeDatatypeDefinition targetTypeDtDef = (IRuntimeDatatypeDefinition) targetTypeDef; if (targetTypeDtDef.isProfileOf(sourceType)) { FhirTerser terser = myContext.newTerser(); IBase newTarget = targetTypeDef.newInstance();