Class GwtSpecificValidatorClassCreator
- java.lang.Object
-
- de.knightsoftnet.validators.annotation.processor.GwtSpecificValidatorClassCreator
-
public class GwtSpecificValidatorClassCreator extends Object
-
-
Constructor Summary
Constructors Constructor Description GwtSpecificValidatorClassCreator(ProcessingEnvironment processingEnv, Set<TypeMirror> validGroups)constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringasGetter(TypeElementPropertyDescriptor propertyDescriptor)protected TypeMirrorgetValidatorForType(TypeElementConstraintDescriptor<?> constraint, TypeMirror targetType)Gets the bestConstraintValidator.Set<TypeMirror>writeClass(TypeMirror typeMirror)write validation class for a given type mirror.protected voidwriteClassBody(PrintWriter out, TypeMirror typeMirror)protected voidwriteUnsafeNativeLongIfNeeded(PrintWriter out, TypeMirror typeMirror)
-
-
-
Constructor Detail
-
GwtSpecificValidatorClassCreator
public GwtSpecificValidatorClassCreator(ProcessingEnvironment processingEnv, Set<TypeMirror> validGroups)
constructor.- Parameters:
processingEnv- processing environmentvalidGroups- set of validation groups
-
-
Method Detail
-
writeClass
public Set<TypeMirror> writeClass(TypeMirror typeMirror)
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 com.google.gwt.core.ext.UnableToCompleteException
- Throws:
com.google.gwt.core.ext.UnableToCompleteException
-
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.
-
asGetter
public static String asGetter(TypeElementPropertyDescriptor propertyDescriptor)
-
writeUnsafeNativeLongIfNeeded
protected void writeUnsafeNativeLongIfNeeded(PrintWriter out, TypeMirror typeMirror)
-
-