...
MainResorceController handles the request, determines which resource the request is for (PatientResource), and calls that resource's
retrieve()
function.DelegatingCrudResource (which is the superclass of most *Resource.java files) provides the retrieve function, which calls
asRepresentation()
to that reads the <rep> parameterasRepresentation()
attempts to convert the <rep> to a list of Patient properties (fields) to be retrieved using a combination of different strategies:PatientResource.getRepresentationDescription()
is first called. This function (usually) lists out the properties that should be retrieved for the "standard" representations commons to most resources (default
,full
andref
).if the above function returns
null
, thefindAnnotatedMethodForRepresentation
function is called to find the method in the *Resource.java class that is annotated with@RepHandler
to handle the specified<rep>
.If the above fails, it assumes that the <rep> is a customer representation (ex:
custom:(uuid)
), and callsgetCustomRepresentationDescription
to retrieve the list of properties.
The The BaseDelegatingConverter.'s
convertDelegateToRepresentation()
function gets called to loop through each property name and converts it to actual values by callingDelegatingResourceDescription.Property.evaluate()
The
evaluate()
function tries a combination strategy of reflection and annotated methods to retrieve the value of the property. This process can be recursive as the property can itself be another Resource.The evaluated object gets returned by
MainResourceController.retrieve()
to be serialized into the appropriate data format (xml or json)
...