Skip to content

Look up a model class from its typeName #711

Closed
@lmsurpre

Description

Is your feature request related to a problem? Please describe.
We have a declarative mapping and I'd like to store just the type name for mapping targets (rather than fully qualified name). To do it, we need a way to lookup the target class from just the type name.

Describe the solution you'd like
Add ModelSupport.getTypeClass(String typeName) which performs the lookup...an exact logical reverse of
ModelSupport.getTypeName(Class<?> clazz)

Describe alternatives you've considered
The alternative would be to use something like this wherever we need it:

Class.forName("com.ibm.fhir.model.type." + name.substring(0, 1).toUpperCase() + name.substring(1));

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions