Annotation Type TargetClass


@Documented
@Retention(RUNTIME)
@Target({FIELD,METHOD})
public @interface TargetClass
Specifies a concrete target class to apply to or retrieve from a field or method. This is typically used for converting a JSONArray of JSONObjects, or to specify a mapping of a specific JSON key to a JSONObject/Class mapping. This also supports allowing Fields to be assigned to an Interface or Abstract Class while defining the concrete class.

IMPORTANT NOTES

The concrete class must include a default, zero-parameter Constructor. Otherwise, a JSONConversionException will be thrown. If you wish to convert to a class that doesn't include a default constructor, then use a JSONValueConverter annotation instead.

Do not use with either a JSONValueConverter or ClassValueConverter

Author:
Jim Earley (jim.earley@fdiinc.com)
  • Required Element Summary

    Required Elements
    Modifier and Type Required Element Description
    Class<?> value
    Specifes the concrete target class to use
  • Element Details

    • value

      Class<?> value
      Specifes the concrete target class to use
      Returns:
      the Class