Annotation Interface StringCtor
By default, ClassMeta.newInstanceFromString(Object,String) looks for a static method matching one of a
fixed set of conventional names (String argument and returns an
instance of the class, falling back to a single-String-arg constructor if none is found.
This annotation lets you opt out of that name-based guessing and explicitly name the static factory method to use,
which is useful for classes whose factory method doesn't match any of the conventional names (e.g.
The annotated method must be String argument.
Example:
See Also:
- Since:
- 9.2.0
-
Required Element Summary
Required Elements
-
Element Details
-
value
The name of the static factory method to use for string-convertibility.The named method must be
static , return an instance of the annotated class, and take exactly oneStringargument.- Returns:
- The annotation value.
-