Class GwtSpecificValidatorClassCreator

java.lang.Object
de.knightsoftnet.validators.annotation.processor.GwtSpecificValidatorClassCreator

public class GwtSpecificValidatorClassCreator extends Object
  • Constructor Details

    • GwtSpecificValidatorClassCreator

      public GwtSpecificValidatorClassCreator(ProcessingEnvironment processingEnv, Set<TypeMirror> validGroups, boolean forceUsingGetter, boolean generateReflectionGetter, String[] languages)
      constructor.
      Parameters:
      processingEnv - processing environment
      validGroups - set of validation groups
  • Method Details

    • 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 jakarta.validation.UnexpectedTypeException
      Throws:
      jakarta.validation.UnexpectedTypeException
    • getValidatorForType

      protected TypeMirror getValidatorForType(TypeElementConstraintDescriptor<?> constraint, TypeMirror targetType) throws jakarta.validation.UnexpectedTypeException
      Gets the best ConstraintValidator.

      The ConstraintValidator chosen to validate a declared type targetType is the one where the type supported by the ConstraintValidator is a supertype of targetType and where there is no other ConstraintValidator whose supported type is a supertype of type and 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:
      jakarta.validation.UnexpectedTypeException - if there is not exactly one maximally specific constraint validator for targetType.
    • writeUnsafeNativeLongIfNeeded

      protected void writeUnsafeNativeLongIfNeeded(PrintWriter out, TypeMirror typeMirror)