A shell (
Shell) is a class that knows provides a convenient runtime representation of the validation and transformation information associated with all properties of a particular class. A shell also knows how to access each of the properties : whether by direct field access, by invoking a setter method, or something else (the architecture is extensible, see
Accessor). There is one shell per class type, and it is created only once (the first time an instance of that class is accessed). Shells are stored in a static cache table, so that they can be easily retrieved.
Whenever an external value needs to be assigned to a property of an instance, the framework retrieves the shell for that class (creating it on the spot if it doesn't exist), and proceeds to apply in order all annotations defined for that property. When the final value comes out, the shell uses the appropriate accessor to assign ("inject") the value to the property. The process can be represented graphically as follows:
