public class PropertyUtilBase
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
PropertyUtilBase.GetterFlavour |
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
GET_PREFIX |
protected static java.lang.String |
IS_PREFIX |
protected static java.lang.String |
SET_PREFIX |
Constructor and Description |
---|
PropertyUtilBase() |
Modifier and Type | Method and Description |
---|---|
static PsiMethod |
findGetterForField(PsiField field) |
static PsiField |
findPropertyField(PsiClass aClass,
java.lang.String propertyName,
boolean isStatic) |
static PsiField |
findPropertyFieldByMember(PsiMember psiMember) |
static PsiMethod |
findPropertyGetter(PsiClass aClass,
java.lang.String propertyName,
boolean isStatic,
boolean checkSuperClasses) |
static PsiMethod |
findPropertyGetterWithType(java.lang.String propertyName,
boolean isStatic,
PsiType type,
java.util.Collection<? extends PsiMethod> methods) |
static PsiMethod |
findPropertySetter(PsiClass aClass,
java.lang.String propertyName,
boolean isStatic,
boolean checkSuperClasses) |
static PsiMethod |
findPropertySetterWithType(java.lang.String propertyName,
boolean isStatic,
PsiType type,
java.util.Collection<? extends PsiMethod> methods) |
static PsiMethod |
findSetterForField(PsiField field) |
static PsiMethod |
generateGetterPrototype(PsiField field)
Consider using
GenerateMembersUtil.generateGetterPrototype(PsiField) or
GenerateMembersUtil.generateSimpleGetterPrototype(PsiField)
to add @Override annotation |
static PsiMethod |
generateSetterPrototype(PsiField field)
Consider using
GenerateMembersUtil.generateSetterPrototype(PsiField)
or GenerateMembersUtil.generateSimpleSetterPrototype(PsiField)
to add @Override annotation |
static PsiMethod |
generateSetterPrototype(PsiField field,
PsiClass containingClass)
Consider using
GenerateMembersUtil.generateSetterPrototype(PsiField)
or GenerateMembersUtil.generateSimpleSetterPrototype(PsiField)
to add @Override annotation |
static PsiMethod |
generateSetterPrototype(PsiField field,
PsiClass containingClass,
boolean returnSelf)
Consider using
GenerateMembersUtil.generateSetterPrototype(PsiField)
or GenerateMembersUtil.generateSimpleSetterPrototype(PsiField)
to add @Override annotation |
static java.lang.String |
getAccessorName(java.lang.String propertyName,
PropertyKind kind) |
static java.util.List<PsiMethod> |
getAccessors(PsiClass psiClass,
java.lang.String propertyName) |
static java.util.Map<java.lang.String,PsiMethod> |
getAllProperties(boolean acceptSetters,
boolean acceptGetters,
PsiMethod[] methods) |
static java.util.Map<java.lang.String,PsiMethod> |
getAllProperties(PsiClass psiClass,
boolean acceptSetters,
boolean acceptGetters) |
static java.util.Map<java.lang.String,PsiMethod> |
getAllProperties(PsiClass psiClass,
boolean acceptSetters,
boolean acceptGetters,
boolean includeSuperClass) |
static PsiExpression |
getGetterReturnExpression(PsiMethod method)
If the name of the method looks like a getter and the body consists of a single return statement,
returns the returned expression.
|
static java.util.List<PsiMethod> |
getGetters(PsiClass psiClass,
java.lang.String propertyName) |
static PropertyUtilBase.GetterFlavour |
getMethodNameGetterFlavour(java.lang.String methodName) |
static PropertyKind |
getPropertyKind(java.lang.String accessorName) |
static java.lang.String |
getPropertyName(PsiMember member) |
static java.lang.String |
getPropertyName(PsiMethod method) |
static java.lang.String |
getPropertyName(java.lang.String methodName) |
static Pair<java.lang.String,PropertyKind> |
getPropertyNameAndKind(java.lang.String accessorName) |
static java.lang.String |
getPropertyNameByGetter(PsiMethod getterMethod) |
static java.lang.String |
getPropertyNameBySetter(PsiMethod setterMethod) |
static PsiIdentifier |
getPropertyNameIdentifier(PsiMember member) |
static PsiType |
getPropertyType(PsiMember member) |
static PsiTypeElement |
getPropertyTypeElement(PsiMember member) |
static java.lang.String [] |
getReadableProperties(PsiClass aClass,
boolean includeSuperClass) |
static java.util.List<PsiMethod> |
getSetters(PsiClass psiClass,
java.lang.String propertyName) |
static PsiExpression |
getSingleReturnValue(PsiMethod method) |
static java.lang.String [] |
getWritableProperties(PsiClass aClass,
boolean includeSuperClass) |
static boolean |
hasGetterName(PsiMethod method) |
static boolean |
isSetterName(java.lang.String methodName) |
static boolean |
isSimplePropertyAccessor(PsiMethod method) |
static boolean |
isSimplePropertyGetter(PsiMethod method) |
static boolean |
isSimplePropertySetter(PsiMethod method) |
static java.lang.String |
suggestGetterName(PsiField field) |
static java.lang.String |
suggestGetterName(java.lang.String propertyName,
PsiType propertyType) |
static java.lang.String |
suggestGetterName(java.lang.String propertyName,
PsiType propertyType,
java.lang.String existingGetterName) |
static java.lang.String [] |
suggestGetterNames(java.lang.String propertyName) |
static java.lang.String |
suggestPropertyName(PsiField field) |
static java.lang.String |
suggestPropertyName(PsiField field,
java.lang.String fieldName) |
static java.lang.String |
suggestSetterName(PsiField field) |
static java.lang.String |
suggestSetterName(java.lang.String propertyName) |
static java.lang.String |
suggestSetterName(java.lang.String propertyName,
java.lang.String setterPrefix) |
protected static final java.lang.String GET_PREFIX
protected static final java.lang.String IS_PREFIX
protected static final java.lang.String SET_PREFIX
public static java.lang.String getPropertyName(java.lang.String methodName)
public static java.util.Map<java.lang.String,PsiMethod> getAllProperties(PsiClass psiClass, boolean acceptSetters, boolean acceptGetters)
public static java.util.Map<java.lang.String,PsiMethod> getAllProperties(PsiClass psiClass, boolean acceptSetters, boolean acceptGetters, boolean includeSuperClass)
public static java.util.Map<java.lang.String,PsiMethod> getAllProperties(boolean acceptSetters, boolean acceptGetters, PsiMethod[] methods)
public static java.util.List<PsiMethod> getSetters(PsiClass psiClass, java.lang.String propertyName)
public static java.util.List<PsiMethod> getGetters(PsiClass psiClass, java.lang.String propertyName)
public static java.util.List<PsiMethod> getAccessors(PsiClass psiClass, java.lang.String propertyName)
public static java.lang.String [] getReadableProperties(PsiClass aClass, boolean includeSuperClass)
public static java.lang.String [] getWritableProperties(PsiClass aClass, boolean includeSuperClass)
public static PsiMethod findPropertySetter(PsiClass aClass, java.lang.String propertyName, boolean isStatic, boolean checkSuperClasses)
public static PsiField findPropertyField(PsiClass aClass, java.lang.String propertyName, boolean isStatic)
public static PsiMethod findPropertyGetter(PsiClass aClass, java.lang.String propertyName, boolean isStatic, boolean checkSuperClasses)
public static PsiMethod findPropertyGetterWithType(java.lang.String propertyName, boolean isStatic, PsiType type, java.util.Collection<? extends PsiMethod> methods)
public static boolean isSimplePropertyAccessor(PsiMethod method)
public static PsiMethod findPropertySetterWithType(java.lang.String propertyName, boolean isStatic, PsiType type, java.util.Collection<? extends PsiMethod> methods)
public static PropertyUtilBase.GetterFlavour getMethodNameGetterFlavour(java.lang.String methodName)
public static boolean isSimplePropertyGetter(PsiMethod method)
public static boolean hasGetterName(PsiMethod method)
public static java.lang.String suggestPropertyName(PsiField field)
public static java.lang.String suggestPropertyName(PsiField field, java.lang.String fieldName)
public static java.lang.String suggestGetterName(PsiField field)
public static java.lang.String suggestSetterName(PsiField field)
public static java.lang.String getPropertyName(PsiMember member)
public static boolean isSimplePropertySetter(PsiMethod method)
public static boolean isSetterName(java.lang.String methodName)
public static java.lang.String getPropertyName(PsiMethod method)
public static java.lang.String getPropertyNameByGetter(PsiMethod getterMethod)
public static java.lang.String getPropertyNameBySetter(PsiMethod setterMethod)
public static java.lang.String [] suggestGetterNames(java.lang.String propertyName)
public static java.lang.String suggestGetterName(java.lang.String propertyName, PsiType propertyType)
public static java.lang.String suggestGetterName(java.lang.String propertyName, PsiType propertyType, java.lang.String existingGetterName)
public static java.lang.String suggestSetterName(java.lang.String propertyName)
public static java.lang.String suggestSetterName(java.lang.String propertyName, java.lang.String setterPrefix)
public static PsiMethod generateGetterPrototype(PsiField field)
GenerateMembersUtil.generateGetterPrototype(PsiField)
or
GenerateMembersUtil.generateSimpleGetterPrototype(PsiField)
to add @Override annotationpublic static PsiMethod generateSetterPrototype(PsiField field)
GenerateMembersUtil.generateSetterPrototype(PsiField)
or GenerateMembersUtil.generateSimpleSetterPrototype(PsiField)
to add @Override annotationpublic static PsiMethod generateSetterPrototype(PsiField field, PsiClass containingClass)
GenerateMembersUtil.generateSetterPrototype(PsiField)
or GenerateMembersUtil.generateSimpleSetterPrototype(PsiField)
to add @Override annotationpublic static PsiMethod generateSetterPrototype(PsiField field, PsiClass containingClass, boolean returnSelf)
GenerateMembersUtil.generateSetterPrototype(PsiField)
or GenerateMembersUtil.generateSimpleSetterPrototype(PsiField)
to add @Override annotationpublic static PsiTypeElement getPropertyTypeElement(PsiMember member)
public static PsiIdentifier getPropertyNameIdentifier(PsiMember member)
public static PsiExpression getGetterReturnExpression(PsiMethod method)
method
- the method to checkpublic static PsiExpression getSingleReturnValue(PsiMethod method)
public static PropertyKind getPropertyKind(java.lang.String accessorName)
public static Pair<java.lang.String,PropertyKind> getPropertyNameAndKind(java.lang.String accessorName)
StringUtil.getPropertyName(String)
,
Introspector
public static java.lang.String getAccessorName(java.lang.String propertyName, PropertyKind kind)