Package feign

Class Contract.BaseContract

  • All Implemented Interfaces:
    Contract
    Direct Known Subclasses:
    Contract.Default
    Enclosing interface:
    Contract

    public abstract static class Contract.BaseContract
    extends java.lang.Object
    implements Contract
    • Constructor Detail

      • BaseContract

        public BaseContract()
    • Method Detail

      • parseAndValidatateMetadata

        public java.util.List<MethodMetadata> parseAndValidatateMetadata​(java.lang.Class<?> targetType)
        Description copied from interface: Contract
        Called to parse the methods in the class that are linked to HTTP requests.
        Specified by:
        parseAndValidatateMetadata in interface Contract
        Parameters:
        targetType - type of the Feign interface.
      • processAnnotationOnClass

        protected abstract void processAnnotationOnClass​(MethodMetadata data,
                                                         java.lang.Class<?> clz)
        Called by parseAndValidateMetadata twice, first on the declaring class, then on the target type (unless they are the same).
        Parameters:
        data - metadata collected so far relating to the current java method.
        clz - the class to process
      • processAnnotationOnMethod

        protected abstract void processAnnotationOnMethod​(MethodMetadata data,
                                                          java.lang.annotation.Annotation annotation,
                                                          java.lang.reflect.Method method)
        Parameters:
        data - metadata collected so far relating to the current java method.
        annotation - annotations present on the current method annotation.
        method - method currently being processed.
      • processAnnotationsOnParameter

        protected abstract boolean processAnnotationsOnParameter​(MethodMetadata data,
                                                                 java.lang.annotation.Annotation[] annotations,
                                                                 int paramIndex)
        Parameters:
        data - metadata collected so far relating to the current java method.
        annotations - annotations present on the current parameter annotation.
        paramIndex - if you find a name in annotations, call nameParam(MethodMetadata, String, int) with this as the last parameter.
        Returns:
        true if you called nameParam(MethodMetadata, String, int) after finding an http-relevant annotation.
      • nameParam

        protected void nameParam​(MethodMetadata data,
                                 java.lang.String name,
                                 int i)
        links a parameter name to its index in the method signature.