Class GwtSpecificValidatorClassCreator
java.lang.Object
de.knightsoftnet.validators.annotation.processor.GwtSpecificValidatorClassCreator
-
Constructor Summary
ConstructorsConstructorDescriptionGwtSpecificValidatorClassCreator(ProcessingEnvironment processingEnv, Set<TypeMirror> validGroups, boolean forceUsingGetter, boolean generateReflectionGetter, String[] languages) constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected TypeMirrorgetValidatorForType(TypeElementConstraintDescriptor<?> constraint, TypeMirror targetType) Gets the bestConstraintValidator.writeClass(TypeMirror typeMirror) write validation class for a given type mirror.protected voidwriteClassBody(PrintWriter out, TypeMirror typeMirror) protected voidwriteUnsafeNativeLongIfNeeded(PrintWriter out, TypeMirror typeMirror)
-
Constructor Details
-
GwtSpecificValidatorClassCreator
public GwtSpecificValidatorClassCreator(ProcessingEnvironment processingEnv, Set<TypeMirror> validGroups, boolean forceUsingGetter, boolean generateReflectionGetter, String[] languages) constructor.- Parameters:
processingEnv- processing environmentvalidGroups- set of validation groups
-
-
Method Details
-
writeClass
write validation class for a given type mirror.- Parameters:
typeMirror- type mirror of class to validate- Returns:
- additional interfaces to create
-
writeClassBody
protected void writeClassBody(PrintWriter out, TypeMirror typeMirror) throws javax.validation.UnexpectedTypeException - Throws:
javax.validation.UnexpectedTypeException
-
getValidatorForType
protected TypeMirror getValidatorForType(TypeElementConstraintDescriptor<?> constraint, TypeMirror targetType) throws javax.validation.UnexpectedTypeException Gets the bestConstraintValidator.The ConstraintValidator chosen to validate a declared type
targetTypeis the one where the type supported by the ConstraintValidator is a supertype oftargetTypeand where there is no other ConstraintValidator whose supported type is a supertype oftypeand not a supertype of the chosen ConstraintValidator supported type.- Parameters:
constraint- the constraint to find ConstraintValidators for.targetType- The type to find a ConstraintValidator for.- Returns:
- ConstraintValidator
- Throws:
javax.validation.UnexpectedTypeException- if there is not exactly one maximally specific constraint validator for targetType.
-
writeUnsafeNativeLongIfNeeded
-