Reputation: 133
I'm trying to create a custom validation wherein I have defined the annotation to accept an array of Strings for example:
public @interface Enum {
String message() default "{}";
Class<?>[] groups() default {};
Class<? extends Payload>[] payload() default {};
String[] value();
}
where value is an array of Strings. In the annotation i can use it as @Enum(value={"ABC", "PQR"}) & i can also retrieve this information at runtime. But when i represent the same information in the xml format as.
<constraint annotation="com.customvalidation.Enum">
<element name="value">ABC</element>
<element name="value">PQR</element>
</constraint>
it doesn't work, does any body have idea on how to represent the array in XML..?
Upvotes: 0
Views: 981