private void scanCompositeDatatype(Class<? extends ICompositeType> theClass, DatatypeDef theDatatypeDefinition) { ourLog.debug("Scanning datatype class: {}", theClass.getName()); RuntimeCompositeDatatypeDefinition elementDef; if (theClass.equals(ExtensionDt.class)) { elementDef = new RuntimeExtensionDtDefinition(theDatatypeDefinition, theClass, true, myContext, myClassToElementDefinitions); // } else if (IBaseMetaType.class.isAssignableFrom(theClass)) { // resourceDef = new RuntimeMetaDefinition(theDatatypeDefinition, theClass, isStandardType(theClass)); } else { elementDef = new RuntimeCompositeDatatypeDefinition(theDatatypeDefinition, theClass, isStandardType(theClass), myContext, myClassToElementDefinitions); } myClassToElementDefinitions.put(theClass, elementDef); myNameToElementDefinitions.put(elementDef.getName().toLowerCase(), elementDef); /* * See #423: * If the type contains a field that has a custom type, we want to make * sure that this type gets scanned as well */ elementDef.populateScanAlso(myScanAlso); }
@Override public void sealAndInitialize(FhirContext theContext, Map<Class<? extends IBase>, BaseRuntimeElementDefinition<?>> theClassToElementDefinitions) { super.sealAndInitialize(theContext, theClassToElementDefinitions); /* * The "url" child is a weird child because it is not parsed and encoded in the normal way, * so we exclude it here */ List<BaseRuntimeChildDefinition> superChildren = super.getChildren(); ArrayList<BaseRuntimeChildDefinition> children = new ArrayList<BaseRuntimeChildDefinition>(); for (BaseRuntimeChildDefinition baseRuntimeChildDefinition : superChildren) { if (baseRuntimeChildDefinition.getValidChildNames().contains("url")) { continue; } children.add(baseRuntimeChildDefinition); } myChildren = Collections.unmodifiableList(children); }
@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; }
} else if (nextChild.getChildType() != null && ICompositeDatatype.class.isAssignableFrom(nextChild.getChildType())) { RuntimeCompositeDatatypeDefinition pdef = (RuntimeCompositeDatatypeDefinition) nextChild.getSingleChildOrThrow(); defn.getDefinition().addType().setCode(DataTypeEnum.VALUESET_BINDER.fromCodeString(pdef.getName())); } else { BaseRuntimeElementDefinition<?> singleChildOrThrow = nextChild.getSingleChildOrThrow();
public List<BaseRuntimeChildDefinition> getChildrenIncludingUrl() { return super.getChildren(); }
public List<BaseRuntimeChildDefinition> getChildrenIncludingUrl() { return super.getChildren(); }
private void scanCompositeDatatype(Class<? extends ICompositeType> theClass, DatatypeDef theDatatypeDefinition) { ourLog.debug("Scanning datatype class: {}", theClass.getName()); RuntimeCompositeDatatypeDefinition elementDef; if (theClass.equals(ExtensionDt.class)) { elementDef = new RuntimeExtensionDtDefinition(theDatatypeDefinition, theClass, true, myContext, myClassToElementDefinitions); // } else if (IBaseMetaType.class.isAssignableFrom(theClass)) { // resourceDef = new RuntimeMetaDefinition(theDatatypeDefinition, theClass, isStandardType(theClass)); } else { elementDef = new RuntimeCompositeDatatypeDefinition(theDatatypeDefinition, theClass, isStandardType(theClass), myContext, myClassToElementDefinitions); } myClassToElementDefinitions.put(theClass, elementDef); myNameToElementDefinitions.put(elementDef.getName().toLowerCase(), elementDef); /* * See #423: * If the type contains a field that has a custom type, we want to make * sure that this type gets scanned as well */ elementDef.populateScanAlso(myScanAlso); }
@Override public void sealAndInitialize(FhirContext theContext, Map<Class<? extends IBase>, BaseRuntimeElementDefinition<?>> theClassToElementDefinitions) { super.sealAndInitialize(theContext, theClassToElementDefinitions); /* * The "url" child is a weird child because it is not parsed and encoded in the normal way, * so we exclude it here */ List<BaseRuntimeChildDefinition> superChildren = super.getChildren(); ArrayList<BaseRuntimeChildDefinition> children = new ArrayList<BaseRuntimeChildDefinition>(); for (BaseRuntimeChildDefinition baseRuntimeChildDefinition : superChildren) { if (baseRuntimeChildDefinition.getValidChildNames().contains("url")) { continue; } children.add(baseRuntimeChildDefinition); } myChildren = Collections.unmodifiableList(children); }
@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; }