Interface Method

    • Method Detail

      • matches

        boolean matches​(List<Type> sourceTypes,
                        Type targetType)
        Checks whether the provided sourceType and provided targetType match with the parameter respectively return type of the method. The check also should incorporate wild card and generic type variables
        Parameters:
        sourceTypes - the sourceTypes to match to the parameter
        targetType - the targetType to match to the returnType
        Returns:
        true when match
      • getDeclaringMapper

        Type getDeclaringMapper()
        Returns the mapper type declaring this method if it is not declared by the mapper interface currently processed but by another mapper imported via Mapper#users().
        Returns:
        The declaring mapper type
      • getName

        String getName()
        Returns then name of the method.
        Returns:
        method name
      • getSourceParameters

        List<Parameter> getSourceParameters()
        returns the list of 'true' source parameters excluding the parameter(s) that are designated as target, target type or context parameter.
        Returns:
        list of 'true' source parameters
      • getContextParameters

        List<Parameter> getContextParameters()
        returns the list of mapping context parameters, i.e. those parameters that are annotated with Context.
        Returns:
        list of context parameters
      • getMappingTargetParameter

        Parameter getMappingTargetParameter()
        Returns the parameter designated as mapping target (if present) MappingTarget
        Returns:
        mapping target parameter (when present) null otherwise.
      • isObjectFactory

        boolean isObjectFactory()
        Returns whether the meethod is designated as bean factory for mapping target ObjectFactory
        Returns:
        true if it is a target bean factory.
      • getTargetTypeParameter

        Parameter getTargetTypeParameter()
        Returns the parameter designated as target type (if present) TargetType
        Returns:
        target type parameter (when present) null otherwise.
      • getReturnType

        Type getReturnType()
        Returns the return type of the method
        Returns:
        return type
      • getThrownTypes

        List<Type> getThrownTypes()
        Returns all exceptions thrown by this method
        Returns:
        exceptions thrown
      • getResultType

        Type getResultType()
        Returns the type of the result. The result is defined as the type of the parameter designated with MappingTarget, or in absence the return type.
        Returns:
        result type
      • getParameterNames

        List<String> getParameterNames()
        Returns:
        the names of the parameters of this mapping method
      • overridesMethod

        boolean overridesMethod()
        Whether this method overrides an abstract method.
        Returns:
        true when an abstract method is overridden.
      • isStatic

        boolean isStatic()
        Whether this method is static or an instance method
        Returns:
        true when static.
      • isDefault

        boolean isDefault()
        Whether this method is Java 8 default method
        Returns:
        true when Java 8 default method
      • getDefiningType

        Type getDefiningType()
        Returns:
        the Type (class or interface) that defines this method.
      • isLifecycleCallbackMethod

        boolean isLifecycleCallbackMethod()
        Returns:
        true, if the method represents a mapping lifecycle callback (Before/After mapping method)
      • isUpdateMethod

        boolean isUpdateMethod()
        Returns:
        true, if the method is an update method, i.e. it has a parameter annotated with @MappingTarget.
      • isMappingTargetAssignableToReturnType

        default boolean isMappingTargetAssignableToReturnType()
        Returns:
        true when @MappingTarget annotated parameter is the same type as the return type. The method has to be an update method in order for this to be true.
      • getMappingSourceType

        default Type getMappingSourceType()
        Returns:
        the first source type, intended for mapping methods from single source to target
      • describe

        String describe()
        Returns:
        the short name for error messages when verbose, full name when not
      • getTypeParameters

        List<Type> getTypeParameters()
        Returns the formal type parameters of this method in declaration order.
        Returns:
        the formal type parameters, or an empty list if there are none