Class TypeQualifierNullnessAnnotationDatabase

  • All Implemented Interfaces:
    INullnessAnnotationDatabase

    public class TypeQualifierNullnessAnnotationDatabase
    extends java.lang.Object
    implements INullnessAnnotationDatabase
    Implementation of INullnessAnnotationDatabase that is based on JSR-305 type qualifiers.
    Author:
    David Hovemeyer
    • Field Detail

      • nonnullTypeQualifierValue

        public final TypeQualifierValue<javax.annotation.Nonnull> nonnullTypeQualifierValue
    • Constructor Detail

      • TypeQualifierNullnessAnnotationDatabase

        public TypeQualifierNullnessAnnotationDatabase()
    • Method Detail

      • getResolvedAnnotation

        public NullnessAnnotation getResolvedAnnotation​(java.lang.Object o,
                                                        boolean getMinimal)
        Description copied from interface: INullnessAnnotationDatabase
        Get a resolved NullnessAnnotation on given XMethod, XField, or XMethodParameter.
        Specified by:
        getResolvedAnnotation in interface INullnessAnnotationDatabase
        Parameters:
        o - an XMethod, XField, or XMethodParameter
        getMinimal - TODO: what does this mean?
        Returns:
        resolved NullnessAnnotation
      • getDirectAnnotation

        @CheckForNull
        public NullnessAnnotation getDirectAnnotation​(java.lang.Object o)
      • assertsFirstParameterIsNonnull

        public static boolean assertsFirstParameterIsNonnull​(XMethod m)
      • parameterMustBeNonNull

        public boolean parameterMustBeNonNull​(XMethod m,
                                              int param)
        Description copied from interface: INullnessAnnotationDatabase
        Determine whether given parameter must be non-null.
        Specified by:
        parameterMustBeNonNull in interface INullnessAnnotationDatabase
        Parameters:
        m - a method
        param - parameter (0 == first parameter)
        Returns:
        true if the parameter must be non-null, false otherwise
      • addFieldAnnotation

        public void addFieldAnnotation​(java.lang.String cName,
                                       java.lang.String mName,
                                       java.lang.String mSig,
                                       boolean isStatic,
                                       NullnessAnnotation annotation)
        Description copied from interface: INullnessAnnotationDatabase
        Add a field annotation to the database.
        Specified by:
        addFieldAnnotation in interface INullnessAnnotationDatabase
        Parameters:
        cName - dotted class name
        mName - field name
        mSig - field signature
        isStatic - true if field is static, false otherwise
        annotation - NullnessAnnotation to add
      • getXMethod

        @CheckForNull
        public XMethod getXMethod​(java.lang.String cName,
                                  java.lang.String mName,
                                  java.lang.String sig,
                                  boolean isStatic)
      • addMethodAnnotation

        public void addMethodAnnotation​(java.lang.String cName,
                                        java.lang.String mName,
                                        java.lang.String sig,
                                        boolean isStatic,
                                        NullnessAnnotation annotation)
        Description copied from interface: INullnessAnnotationDatabase
        Add a method annotation to the database.
        Specified by:
        addMethodAnnotation in interface INullnessAnnotationDatabase
        Parameters:
        cName - dotted class name
        mName - method name
        sig - method signature
        isStatic - true if method is static, false otherwise
        annotation - NullnessAnnotation to add
      • addMethodParameterAnnotation

        public void addMethodParameterAnnotation​(@DottedClassName
                                                 java.lang.String cName,
                                                 java.lang.String mName,
                                                 java.lang.String sig,
                                                 boolean isStatic,
                                                 int param,
                                                 NullnessAnnotation annotation)
        Description copied from interface: INullnessAnnotationDatabase
        Add a method parameter annotation to the database.
        Specified by:
        addMethodParameterAnnotation in interface INullnessAnnotationDatabase
        Parameters:
        cName - dotted class name
        mName - method name
        sig - method signature
        isStatic - true if method is static, false otherwise
        param - parameter (0 == first parameter)
        annotation - the NullnessAnnotation to add