org.springframework.beans.factory

## 类 InjectionPoint

- java.lang.Object
- - org.springframework.beans.factory.InjectionPoint

- 直接已知子类:
    DependencyDescriptor

      public class InjectionPoint
      extends Object

  A simple descriptor for an injection point, pointing to a method/constructor parameter or a field. Exposed by `UnsatisfiedDependencyException`. Also available as an argument for factory methods, reacting to the requesting injection point for building a customized bean instance.
  从以下版本开始:
    4.3
  作者:
    Juergen Hoeller
  另请参阅:
    `UnsatisfiedDependencyException.getInjectionPoint()`, `DependencyDescriptor`

- - ### 字段概要

    字段
    限定符和类型 | 字段和说明
    --- | ---
    `protected Field` | `field`
    `protected org.springframework.core.MethodParameter` | `methodParameter`

  - ### 构造器概要

    构造器
    限定符 | 构造器和说明
    --- | ---
    `protected` | `InjectionPoint()` Just available for serialization purposes in subclasses.
    `` | `InjectionPoint(Field field)` Create an injection point descriptor for a field.
    `protected` | `InjectionPoint(InjectionPoint original)` Copy constructor.
    `` | `InjectionPoint(org.springframework.core.MethodParameter methodParameter)` Create an injection point descriptor for a method or constructor parameter.

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `boolean` | `equals(Object other)`
    `AnnotatedElement` | `getAnnotatedElement()` Return the wrapped annotated element.
    `<A extends Annotation> A` | `getAnnotation(Class<A> annotationType)` Retrieve a field/parameter annotation of the given type, if any.
    `Annotation[]` | `getAnnotations()` Obtain the annotations associated with the wrapped field or method/constructor parameter.
    `Class<?>` | `getDeclaredType()` Return the type declared by the underlying field or method/constructor parameter, indicating the injection type.
    `Field` | `getField()` Return the wrapped Field, if any.
    `Member` | `getMember()` Returns the wrapped member, containing the injection point.
    `org.springframework.core.MethodParameter` | `getMethodParameter()` Return the wrapped MethodParameter, if any.
    `int` | `hashCode()`
    `protected org.springframework.core.MethodParameter` | `obtainMethodParameter()` Return the wrapped MethodParameter, assuming it is present.
    `String` | `toString()`

    - ### 从类继承的方法 java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### 字段详细资料

    - #### methodParameter

          @Nullable
          protected org.springframework.core.MethodParameter methodParameter

    - #### field

          @Nullable
          protected Field field

  - ### 构造器详细资料

    - #### InjectionPoint

          public InjectionPoint(org.springframework.core.MethodParameter methodParameter)

      Create an injection point descriptor for a method or constructor parameter.
      参数:
        `methodParameter` - the MethodParameter to wrap

    - #### InjectionPoint

          public InjectionPoint(Field field)

      Create an injection point descriptor for a field.
      参数:
        `field` - the field to wrap

    - #### InjectionPoint

          protected InjectionPoint(InjectionPoint original)

      Copy constructor.
      参数:
        `original` - the original descriptor to create a copy from

    - #### InjectionPoint

          protected InjectionPoint()

      Just available for serialization purposes in subclasses.

  - ### 方法详细资料

    - #### getMethodParameter

          @Nullable
          public org.springframework.core.MethodParameter getMethodParameter()

      Return the wrapped MethodParameter, if any.

      Note: Either MethodParameter or Field is available.

      返回:
        the MethodParameter, or `null` if none

    - #### getField

          @Nullable
          public Field getField()

      Return the wrapped Field, if any.

      Note: Either MethodParameter or Field is available.

      返回:
        the Field, or `null` if none

    - #### obtainMethodParameter

          protected final org.springframework.core.MethodParameter obtainMethodParameter()

      Return the wrapped MethodParameter, assuming it is present.
      返回:
        the MethodParameter (never `null`)
      抛出:
        `IllegalStateException` - if no MethodParameter is available
      从以下版本开始:
        5.0

    - #### getAnnotations

          public Annotation[] getAnnotations()

      Obtain the annotations associated with the wrapped field or method/constructor parameter.

    - #### getAnnotation

          @Nullable
          public <A extends Annotation> A getAnnotation(Class<A> annotationType)

      Retrieve a field/parameter annotation of the given type, if any.
      参数:
        `annotationType` - the annotation type to retrieve
      返回:
        the annotation instance, or `null` if none found
      从以下版本开始:
        4.3.9

    - #### getDeclaredType

          public Class<?> getDeclaredType()

      Return the type declared by the underlying field or method/constructor parameter, indicating the injection type.

    - #### getMember

          public Member getMember()

      Returns the wrapped member, containing the injection point.
      返回:
        the Field / Method / Constructor as Member

    - #### getAnnotatedElement

          public AnnotatedElement getAnnotatedElement()

      Return the wrapped annotated element.

      Note: In case of a method/constructor parameter, this exposes the annotations declared on the method or constructor itself (i.e. at the method/constructor level, not at the parameter level). Use `getAnnotations()` to obtain parameter-level annotations in such a scenario, transparently with corresponding field annotations.

      返回:
        the Field / Method / Constructor as AnnotatedElement

    - #### equals

          public boolean equals(Object other)

      覆盖:
        `equals` 在类中 `Object`

    - #### hashCode

          public int hashCode()

      覆盖:
        `hashCode` 在类中 `Object`

    - #### toString

          public String toString()

      覆盖:
        `toString` 在类中 `Object`