Class PropertyValidator


  • class PropertyValidator
    extends java.lang.Object
    Validates property annotations on methods.

    Valid property annotations are:

    • Field Detail

      • VALIDATING_ANNOTATIONS

        private static final java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> VALIDATING_ANNOTATIONS
      • elements

        private final javax.lang.model.util.Elements elements
      • types

        private final javax.lang.model.util.Types types
      • resultType

        private final javax.lang.model.type.TypeMirror resultType
    • Constructor Detail

      • PropertyValidator

        private PropertyValidator​(javax.annotation.processing.ProcessingEnvironment processingEnv,
                                  MessageMethod method,
                                  javax.lang.model.type.TypeMirror resultType,
                                  java.util.Collection<ValidationMessage> messages)
    • Method Detail

      • validate

        static java.util.Collection<ValidationMessage> validate​(javax.annotation.processing.ProcessingEnvironment processingEnv,
                                                                MessageMethod messageMethod)
        Validates the message method property annotations.
        Parameters:
        processingEnv - the annotation processing environment
        messageMethod - the method to validate
        Returns:
        a collection of validation messages
      • validate

        private void validate()
      • validateCommonAnnotation

        private void validateCommonAnnotation​(Parameter parameter,
                                              java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
      • validateAnnotation

        private void validateAnnotation​(javax.lang.model.element.AnnotationMirror annotationMirror,
                                        java.util.Map<java.lang.String,​java.util.Set<javax.lang.model.type.TypeMirror>> properties)
      • assignablePropertyFound

        private boolean assignablePropertyFound​(javax.lang.model.type.TypeMirror valueType,
                                                java.util.Set<javax.lang.model.type.TypeMirror> propertyTypes)
      • resolveFieldName

        private java.lang.String resolveFieldName​(Parameter parameter)
      • resolveSetterName

        private java.lang.String resolveSetterName​(Parameter parameter)