Package org.opencds.cqf.cql.engine.model
Class CachingModelResolverDecorator
java.lang.Object
org.opencds.cqf.cql.engine.model.CachingModelResolverDecorator
- All Implemented Interfaces:
ModelResolver
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCast the specified value to the specified type.createInstance(String typeName) Create an instance of the model object that corresponds to the specified type.getContextPath(String contextType, String targetType) Get the path expression that expresses the relationship between thetargetTypeand the givencontextType.Check whether or not a specified value instance is of the specified type.objectEqual(Object left, Object right) Compare two objects for equalityobjectEquivalent(Object left, Object right) Compare two objects for equivalenceresolvePath(Object target, String path) Resolve the provided path expression for the provided target.Class<?>resolveType(Object value) Resolve the Java class that corresponds to the given model object instance.Class<?>resolveType(String typeName) Resolve the Java class that corresponds to the given model typevoidsetPackageName(String packageName) voidSet the value of a particular property on the given model object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opencds.cqf.cql.engine.model.ModelResolver
getPackageNames, setPackageNames
-
Constructor Details
-
CachingModelResolverDecorator
-
-
Method Details
-
getPackageName
- Specified by:
getPackageNamein interfaceModelResolver
-
setPackageName
- Specified by:
setPackageNamein interfaceModelResolver
-
resolvePath
Description copied from interface:ModelResolverResolve the provided path expression for the provided target. Paths can be things like simple dotted property notation (e.g. Patient.id) or more complex things like list indexed property expressions (e.g. Patient.name[0].given). The exact details are configued in the model definition and passed to the ELM file during CQL to ELM translation.- Specified by:
resolvePathin interfaceModelResolver- Returns:
- result of the provided expression. Null is expected whenever a path doesn't exist on the target.
-
getContextPath
Description copied from interface:ModelResolverGet the path expression that expresses the relationship between thetargetTypeand the givencontextType. For example, in a FHIR model, with context typePatientand targetType Condition, the resulting path issubjectbecause that is the model property on the Condition object that links the Condition to the Patient.- Specified by:
getContextPathin interfaceModelResolver
-
resolveType
Description copied from interface:ModelResolverResolve the Java class that corresponds to the given model type- Specified by:
resolveTypein interfaceModelResolver- Parameters:
typeName- Model type name. In the ELM, model objects are namespaced (e.g. FHIR.Patient), but the namespace is removed prior to calling this method, so the input would just be Patient.- Returns:
- Class object that represents the specified model type
-
resolveType
Description copied from interface:ModelResolverResolve the Java class that corresponds to the given model object instance.- Specified by:
resolveTypein interfaceModelResolver- Parameters:
value- Object instance- Returns:
- Class object that represents the specified value
-
createInstance
Description copied from interface:ModelResolverCreate an instance of the model object that corresponds to the specified type.- Specified by:
createInstancein interfaceModelResolver- Parameters:
typeName- Model type to create- Returns:
- new instance of the specified model type
-
setValue
Description copied from interface:ModelResolverSet the value of a particular property on the given model object.- Specified by:
setValuein interfaceModelResolver- Parameters:
target- model objectpath- path to the property that will be setvalue- value to set to the property indicated by the path expression
-
objectEqual
Description copied from interface:ModelResolverCompare two objects for equality- Specified by:
objectEqualin interfaceModelResolver- Parameters:
left- left hand side of the equality expressionright- right hand side of the equality expression- Returns:
- flag indicating whether the objects are equal
-
objectEquivalent
Description copied from interface:ModelResolverCompare two objects for equivalence- Specified by:
objectEquivalentin interfaceModelResolver- Parameters:
left- left hand side of the equivalence expressionright- right hand side of the equivalence expression- Returns:
- flag indicating whether the objects are equal
-
is
Description copied from interface:ModelResolverCheck whether or not a specified value instance is of the specified type.- Specified by:
isin interfaceModelResolver- Returns:
- true when the value is of the specified type, otherwise false.
-
as
Description copied from interface:ModelResolverCast the specified value to the specified type. When type conversion is not possible, null should be returned unless the isStrict flag is set to true wherein an Exception will be thrown.- Specified by:
asin interfaceModelResolver- Parameters:
value- model object instancetype- type to which the value should be caseisStrict- flag indicating how to handle invalid type conversion- Returns:
- the result of the value conversion or null if conversion is not possible.
-
getInnerResolver
-