org.springframework.core

## 类 Conventions

- java.lang.Object
- - org.springframework.core.Conventions

-     public abstract class Conventions
      extends Object

  Provides methods to support various naming and other conventions used throughout the framework. Mainly for internal use within the framework.
  从以下版本开始:
    2.0
  作者:
    Rob Harrop, Juergen Hoeller, Rossen Stoyanchev

- - ### 构造器概要

    构造器
    构造器和说明
    `Conventions()`

  - ### 方法概要

    所有方法 静态方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `static String` | `attributeNameToPropertyName(String attributeName)` Convert `String`s in attribute name format (e.g. lowercase, hyphens separating words) into property name format (camel-case).
    `static String` | `getQualifiedAttributeName(Class<?> enclosingClass, String attributeName)` Return an attribute name qualified by the given enclosing `Class`.
    `static String` | `getVariableName(Object value)` Determine the conventional variable name for the supplied `Object` based on its concrete type.
    `static String` | `getVariableNameForParameter(MethodParameter parameter)` Determine the conventional variable name for the given parameter taking the generic collection type, if any, into account.
    `static String` | `getVariableNameForReturnType(Method method)` Determine the conventional variable name for the return type of the given method, taking the generic collection type, if any, into account.
    `static String` | `getVariableNameForReturnType(Method method, Class<?> resolvedType, Object value)` Determine the conventional variable name for the return type of the given method, taking the generic collection type, if any, into account, falling back on the given return value if the method declaration is not specific enough, e.g.
    `static String` | `getVariableNameForReturnType(Method method, Object value)` Determine the conventional variable name for the return type of the given method, taking the generic collection type, if any, into account, falling back on the given actual return value if the method declaration is not specific enough, e.g.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 构造器详细资料

    - #### Conventions

          public Conventions()

  - ### 方法详细资料

    - #### getVariableName

          public static String getVariableName(Object value)

      Determine the conventional variable name for the supplied `Object` based on its concrete type. The convention used is to return the un-capitalized short name of the `Class`, according to JavaBeans property naming rules.

      For example:
      `com.myapp.Product` becomes `"product"`
      `com.myapp.MyProduct` becomes `"myProduct"`
      `com.myapp.UKProduct` becomes `"UKProduct"`

      For arrays the pluralized version of the array component type is used. For `Collection`s an attempt is made to 'peek ahead' to determine the component type and return its pluralized version.

      参数:
        `value` - the value to generate a variable name for
      返回:
        the generated variable name

    - #### getVariableNameForParameter

          public static String getVariableNameForParameter(MethodParameter parameter)

      Determine the conventional variable name for the given parameter taking the generic collection type, if any, into account.

      As of 5.0 this method supports reactive types:
      `Mono<com.myapp.Product>` becomes `"productMono"`
      `Flux<com.myapp.MyProduct>` becomes `"myProductFlux"`
      `Observable<com.myapp.MyProduct>` becomes `"myProductObservable"`

      参数:
        `parameter` - the method or constructor parameter
      返回:
        the generated variable name

    - #### getVariableNameForReturnType

          public static String getVariableNameForReturnType(Method method)

      Determine the conventional variable name for the return type of the given method, taking the generic collection type, if any, into account.
      参数:
        `method` - the method to generate a variable name for
      返回:
        the generated variable name

    - #### getVariableNameForReturnType

          public static String getVariableNameForReturnType(Method method,
                                                            @Nullable
                                                            Object value)

      Determine the conventional variable name for the return type of the given method, taking the generic collection type, if any, into account, falling back on the given actual return value if the method declaration is not specific enough, e.g. `Object` return type or untyped collection.
      参数:
        `method` - the method to generate a variable name for
        `value` - the return value (may be `null` if not available)
      返回:
        the generated variable name

    - #### getVariableNameForReturnType

          public static String getVariableNameForReturnType(Method method,
                                                            Class<?> resolvedType,
                                                            @Nullable
                                                            Object value)

      Determine the conventional variable name for the return type of the given method, taking the generic collection type, if any, into account, falling back on the given return value if the method declaration is not specific enough, e.g. `Object` return type or untyped collection.

      As of 5.0 this method supports reactive types:
      `Mono<com.myapp.Product>` becomes `"productMono"`
      `Flux<com.myapp.MyProduct>` becomes `"myProductFlux"`
      `Observable<com.myapp.MyProduct>` becomes `"myProductObservable"`

      参数:
        `method` - the method to generate a variable name for
        `resolvedType` - the resolved return type of the method
        `value` - the return value (may be `null` if not available)
      返回:
        the generated variable name

    - #### attributeNameToPropertyName

          public static String attributeNameToPropertyName(String attributeName)

      Convert `String`s in attribute name format (e.g. lowercase, hyphens separating words) into property name format (camel-case). For example `transaction-manager` becomes `"transactionManager"`.

    - #### getQualifiedAttributeName

          public static String getQualifiedAttributeName(Class<?> enclosingClass,
                                                         String attributeName)

      Return an attribute name qualified by the given enclosing `Class`. For example the attribute name '`foo`' qualified by `Class` '`com.myapp.SomeClass`' would be '`com.myapp.SomeClass.foo`'