Reference: predefined resolvers

BeanResolver

  • Appliable targets: Any object with getXYZ() methods for its attributes.


  • Selector format: Selectors are interpreted as javabeans attributes. This means that, for a selector "anything", a method "getAnything()" will be tried to invoke on the object.


  • Resolution results: The objects this resolver returns at resolution are the same the getXXX() methods at the bean return. Primitive types like int are wrapped into the correspondent object types (e.g. java.lang.Integer).


HttpRequestResolver

  • Appliable targets: javax.servlet.http.HttpServletRequest objects.


  • Selector format: The HTTP request resolver can resolve selectors in four different ways: as request parameters, request parameters selected by pattern, request attributes and session attributes. Selector strings will be the name of a request parameter unless the pattern:, request: or session: prefixes are specified:
    • xyz Gets the request parameter called xyz.
    • pattern:xyz Gets all the request parameters that match with the pattern "xyz" (java.util.regex.Pattern).
    • request:xyz Gets the request attribute called xyz.
    • session:xyz Gets the session attribute called xyz.


    The selection of request parameters, with or without pattern (not appliable to request or session attributes) can be fine-tuned by choosing whether the parameters we are getting are (or can be) multivalued or not:
    • xyz Gets a single-valued parameter named xyz as a String object. If more than one value for this parameter exists in the request, only the first of them is returned.
    • xyz[] Gets a multivalued parameter named xyz, in the form of a String array.


    The array specification can also be used with pattern matching: "pattern:xyz[]".


  • Resolution results: The type of the resolution result will be:
    • Request or session attributes: The attribute itself will be returned, keeping its type.
    • Single valued parameters: Results will be String objects.
    • Multivalued parameters: Results will be String arrays.
    • Single valued parameters (retrieved with patterns): Results will be Map objects with the names of the parameters as keys (String objects) and the values of these parameters as values (also String objects).
    • Multivalued parameters (retrieved with patterns): Results will be Map objects, as with single valued, but this time values will be String arrays instead of simple String objects.


MapEntryResolver

This resolver is mainly used in Map-iterating validations.

  • Appliable targets: Entries in a Map, this is, java.util.Map.Entry objects.


  • Selector format: This resolver only allows two selectors, called "key" and "value", which will respectively return the key and the value of the map entry.


  • Resolution results: The result of calling getKey() or getValue() on the Map.Entry object.


MapResolver

  • Appliable targets: java.util.Map objects.


  • Selector format: Selectors are interpreted as the keys of the Map entries, so that a selector named "anything" will result in calling "get(anything)" on the Map object.


  • Resolution results: The result of resolution is the value of the selected map entry.


ObjectResolver

  • Appliable targets: Any object (java.lang.Object).


  • Selector format: This resolver only allows a selector called "value", which will return the target object itself.


  • Resolution results: The result of resolution is always the target object.


Config parameterTypeRequiredDefault valueDescription
classNamejava.lang.StringNojava.lang.Object Class of the objects that are to be set as targets of the resolver, for validating their type when target is set.

StringResolver

  • Appliable targets: java.lang.String objects.


  • Selector format: This resolver only allows a selector called "value", which will return the target String object itself.


  • Resolution results: The result of resolution is always the target String object.