public final class Conventions extends ObjectSE
修飾子と型 | メソッドと説明 |
---|---|
static StringSE | attributeNameToPropertyName(StringSE attributeName) String を属性名形式に変換します(例: |
static StringSE | getQualifiedAttributeName(ClassSE<?> enclosingClass, StringSE attributeName) 指定された Class SE で修飾された属性名を返します。 |
static StringSE | getVariableName(ObjectSE value) 具象型に基づいて、提供された Object の従来の変数名を決定します。 |
static StringSE | getVariableNameForParameter(MethodParameter parameter) ジェネリクスコレクション型がある場合は、それを考慮して、指定されたパラメーターの従来の変数名を決定します。 |
static StringSE | getVariableNameForReturnType(MethodSE method) 指定されたメソッドの戻り値の型の一般的な変数名を、もしあれば一般的なコレクション型を考慮して決定します。 |
static StringSE | getVariableNameForReturnType(MethodSE method, ClassSE<?> resolvedType, ObjectSE value) 指定されたメソッドの戻り値の型の従来の変数名を決定します。もしあれば、ジェネリクスコレクション型を考慮し、メソッド宣言が十分に具体的でない場合、与えられた戻り値にフォールバックします。 |
static StringSE | getVariableNameForReturnType(MethodSE method, ObjectSE value) 指定されたメソッドの戻り値の型の従来の変数名を決定し、もしあれば、一般的なコレクション型を考慮し、メソッド宣言が十分に具体的でない場合、与えられた実際の戻り値にフォールバックします |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public static StringSE getVariableName(ObjectSE value)
Object
の従来の変数名を決定します。使用される規則は、JavaBeans プロパティの命名規則に従って、Class
の大文字ではない短縮名を返すことです。 例:
com.myapp.Product
は "product"
になります
com.myapp.MyProduct
は "myProduct"
になります
com.myapp.UKProduct
は "UKProduct"
になります
配列の場合は、配列コンポーネント型の複数形が使用されます。Collection
の場合、コンポーネント型を決定し、その複数形バージョンを返すために「先読み」が試行されます。
value
- 変数名を生成する値 public static StringSE getVariableNameForParameter(MethodParameter parameter)
5.0 現在、このメソッドはリアクティブ型をサポートしています。
Mono<com.myapp.Product>
は "productMono"
になります
Flux<com.myapp.MyProduct>
は "myProductFlux"
になります
Observable<com.myapp.MyProduct>
は "myProductObservable"
になります
parameter
- メソッドまたはコンストラクターのパラメーター public static StringSE getVariableNameForReturnType(MethodSE method)
method
- 変数名を生成するメソッド public static StringSE getVariableNameForReturnType(MethodSE method, @Nullable ObjectSE value)
Object
戻り値型または型なしコレクション。method
- 変数名を生成するメソッド value
- 戻り値 (利用できない場合は null
である可能性があります)public static StringSE getVariableNameForReturnType(MethodSE method, ClassSE<?> resolvedType, @Nullable ObjectSE value)
Object
戻り値型または型なしコレクション。5.0 現在、このメソッドはリアクティブ型をサポートしています。
Mono<com.myapp.Product>
は "productMono"
になります
Flux<com.myapp.MyProduct>
は "myProductFlux"
になります
Observable<com.myapp.MyProduct>
は "myProductObservable"
になります
method
- 変数名を生成するメソッド resolvedType
- メソッドの解決された戻り値の型 value
- 戻り値 (利用できない場合は null
である可能性があります)public static StringSE attributeNameToPropertyName(StringSE attributeName)
String
をプロパティ名形式(キャメルケース)に変換します。たとえば、transaction-manager
は "transactionManager"
になります。