|
Eclipse JDT Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jdt.core.NamingConventions
Provides methods for computing Java-specific names.
The behavior of the methods is dependent of several JavaCore options.
The possible options are :
For a complete description of the configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaCore#setOptions()
.
This class provides static methods and constants only; it is not intended to be instantiated or subclassed by clients.
JavaCore.setOptions(java.util.Hashtable)
,
JavaCore.getDefaultOptions()
Method Summary | |
static char[] |
removePrefixAndSuffixForArgumentName(IJavaProject javaProject,
char[] argumentName)
Remove prefix and suffix from an argument name. |
static String |
removePrefixAndSuffixForArgumentName(IJavaProject javaProject,
String argumentName)
Remove prefix and suffix from an argument name. |
static char[] |
removePrefixAndSuffixForFieldName(IJavaProject javaProject,
char[] fieldName,
int modifiers)
Remove prefix and suffix from a field name. |
static String |
removePrefixAndSuffixForFieldName(IJavaProject javaProject,
String fieldName,
int modifiers)
Remove prefix and suffix from a field name. |
static char[] |
removePrefixAndSuffixForLocalVariableName(IJavaProject javaProject,
char[] localName)
Remove prefix and suffix from a local variable name. |
static String |
removePrefixAndSuffixForLocalVariableName(IJavaProject javaProject,
String localName)
Remove prefix and suffix from a local variable name. |
static char[][] |
suggestArgumentNames(IJavaProject javaProject,
char[] packageName,
char[] qualifiedTypeName,
int dim,
char[][] excludedNames)
Suggest names for an argument. |
static String[] |
suggestArgumentNames(IJavaProject javaProject,
String packageName,
String qualifiedTypeName,
int dim,
String[] excludedNames)
Suggest names for an argument. |
static char[][] |
suggestFieldNames(IJavaProject javaProject,
char[] packageName,
char[] qualifiedTypeName,
int dim,
int modifiers,
char[][] excludedNames)
Suggest names for a field. |
static String[] |
suggestFieldNames(IJavaProject javaProject,
String packageName,
String qualifiedTypeName,
int dim,
int modifiers,
String[] excludedNames)
Suggest names for a field. |
static char[] |
suggestGetterName(IJavaProject project,
char[] fieldName,
int modifiers,
boolean isBoolean,
char[][] excludedNames)
Suggest name for a getter method. |
static String |
suggestGetterName(IJavaProject project,
String fieldName,
int modifiers,
boolean isBoolean,
String[] excludedNames)
Suggest name for a getter method. |
static char[][] |
suggestLocalVariableNames(IJavaProject javaProject,
char[] packageName,
char[] qualifiedTypeName,
int dim,
char[][] excludedNames)
Suggest names for a local variable. |
static String[] |
suggestLocalVariableNames(IJavaProject javaProject,
String packageName,
String qualifiedTypeName,
int dim,
String[] excludedNames)
Suggest names for a local variable. |
static char[] |
suggestSetterName(IJavaProject project,
char[] fieldName,
int modifiers,
boolean isBoolean,
char[][] excludedNames)
Suggest name for a setter method. |
static String |
suggestSetterName(IJavaProject project,
String fieldName,
int modifiers,
boolean isBoolean,
String[] excludedNames)
Suggest name for a setter method. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static char[] removePrefixAndSuffixForArgumentName(IJavaProject javaProject, char[] argumentName)
If argument name prefix is pre
and argument name suffix is suf
then for an argument named preArgsuf
the result of this method is arg
.
If there is no prefix or suffix defined in JavaCore options the result is the unchanged
name preArgsuf
.
This method is affected by the following JavaCore options : CODEASSIST_ARGUMENT_PREFIXES and CODEASSIST_ARGUMENT_SUFFIXES.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaCore#setOptions()
.
javaProject
- project which contains the argument.argumentName
- argument's name.
JavaCore.setOptions(java.util.Hashtable)
,
JavaCore.getDefaultOptions()
public static String removePrefixAndSuffixForArgumentName(IJavaProject javaProject, String argumentName)
If argument name prefix is pre
and argument name suffix is suf
then for an argument named preArgsuf
the result of this method is arg
.
If there is no prefix or suffix defined in JavaCore options the result is the unchanged
name preArgsuf
.
This method is affected by the following JavaCore options : CODEASSIST_ARGUMENT_PREFIXES and CODEASSIST_ARGUMENT_SUFFIXES.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaCore#setOptions()
.
javaProject
- project which contains the argument.argumentName
- argument's name.
JavaCore.setOptions(java.util.Hashtable)
,
JavaCore.getDefaultOptions()
public static char[] removePrefixAndSuffixForFieldName(IJavaProject javaProject, char[] fieldName, int modifiers)
If field name prefix is pre
and field name suffix is suf
then for a field named preFieldsuf
the result of this method is field
.
If there is no prefix or suffix defined in JavaCore options the result is the unchanged
name preFieldsuf
.
This method is affected by the following JavaCore options : CODEASSIST_FIELD_PREFIXES, CODEASSIST_FIELD_SUFFIXES for instance field and CODEASSIST_STATIC_FIELD_PREFIXES, CODEASSIST_STATIC_FIELD_SUFFIXES for static field.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaCore#setOptions()
.
javaProject
- project which contains the field.fieldName
- field's name.modifiers
- field's modifiers as defined by the class
Flags
.
Flags
,
JavaCore.setOptions(java.util.Hashtable)
,
JavaCore.getDefaultOptions()
public static String removePrefixAndSuffixForFieldName(IJavaProject javaProject, String fieldName, int modifiers)
If field name prefix is pre
and field name suffix is suf
then for a field named preFieldsuf
the result of this method is field
.
If there is no prefix or suffix defined in JavaCore options the result is the unchanged
name preFieldsuf
.
This method is affected by the following JavaCore options : CODEASSIST_FIELD_PREFIXES, CODEASSIST_FIELD_SUFFIXES for instance field and CODEASSIST_STATIC_FIELD_PREFIXES, CODEASSIST_STATIC_FIELD_SUFFIXES for static field.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaCore#setOptions()
.
javaProject
- project which contains the field.fieldName
- field's name.modifiers
- field's modifiers as defined by the class
Flags
.
Flags
,
JavaCore.setOptions(java.util.Hashtable)
,
JavaCore.getDefaultOptions()
public static char[] removePrefixAndSuffixForLocalVariableName(IJavaProject javaProject, char[] localName)
If local variable name prefix is pre
and local variable name suffix is suf
then for a local variable named preLocalsuf
the result of this method is local
.
If there is no prefix or suffix defined in JavaCore options the result is the unchanged
name preLocalsuf
.
This method is affected by the following JavaCore options : CODEASSIST_LOCAL_PREFIXES and CODEASSIST_LOCAL_SUFFIXES.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaCore#setOptions()
.
javaProject
- project which contains the variable.localName
- variable's name.
JavaCore.setOptions(java.util.Hashtable)
,
JavaCore.getDefaultOptions()
public static String removePrefixAndSuffixForLocalVariableName(IJavaProject javaProject, String localName)
If local variable name prefix is pre
and local variable name suffix is suf
then for a local variable named preLocalsuf
the result of this method is local
.
If there is no prefix or suffix defined in JavaCore options the result is the unchanged
name preLocalsuf
.
This method is affected by the following JavaCore options : CODEASSIST_LOCAL_PREFIXES and CODEASSIST_LOCAL_SUFFIXES.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaCore#setOptions()
.
javaProject
- project which contains the variable.localName
- variable's name.
JavaCore.setOptions(java.util.Hashtable)
,
JavaCore.getDefaultOptions()
public static char[][] suggestArgumentNames(IJavaProject javaProject, char[] packageName, char[] qualifiedTypeName, int dim, char[][] excludedNames)
If the type of the argument is TypeName
, the prefix for argument is pre
and the suffix for argument is suf
then the proposed names are preTypeNamesuf
and preNamesuf
. If there is no prefix or suffix the proposals are typeName
and name
.
This method is affected by the following JavaCore options : CODEASSIST_ARGUMENT_PREFIXES and CODEASSIST_ARGUMENT_SUFFIXES.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaCore#setOptions()
.
javaProject
- project which contains the argument.packageName
- package of the argument's type.qualifiedTypeName
- argument's type.dim
- argument's dimension (0 if the argument is not an array).excludedNames
- a list of names which cannot be suggested (already used names).
Can be null
if there is no excluded names.
JavaCore.setOptions(java.util.Hashtable)
,
JavaCore.getDefaultOptions()
public static String[] suggestArgumentNames(IJavaProject javaProject, String packageName, String qualifiedTypeName, int dim, String[] excludedNames)
If the type of the argument is TypeName
, the prefix for argument is pre
and the suffix for argument is suf
then the proposed names are preTypeNamesuf
and preNamesuf
. If there is no prefix or suffix the proposals are typeName
and name
.
This method is affected by the following JavaCore options : CODEASSIST_ARGUMENT_PREFIXES and CODEASSIST_ARGUMENT_SUFFIXES.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaCore#setOptions()
.
javaProject
- project which contains the argument.packageName
- package of the argument's type.qualifiedTypeName
- argument's type.dim
- argument's dimension (0 if the argument is not an array).excludedNames
- a list of names which cannot be suggested (already used names).
Can be null
if there is no excluded names.
JavaCore.setOptions(java.util.Hashtable)
,
JavaCore.getDefaultOptions()
public static char[][] suggestFieldNames(IJavaProject javaProject, char[] packageName, char[] qualifiedTypeName, int dim, int modifiers, char[][] excludedNames)
If the type of the field is TypeName
, the prefix for field is pre
and the suffix for field is suf
then the proposed names are preTypeNamesuf
and preNamesuf
. If there is no prefix or suffix the proposals are typeName
and name
.
This method is affected by the following JavaCore options : CODEASSIST_FIELD_PREFIXES, CODEASSIST_FIELD_SUFFIXES and for instance field and CODEASSIST_STATIC_FIELD_PREFIXES, CODEASSIST_STATIC_FIELD_SUFFIXES for static field.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaCore#setOptions()
.
javaProject
- project which contains the field.packageName
- package of the field's type.qualifiedTypeName
- field's type.dim
- field's dimension (0 if the field is not an array).modifiers
- field's modifiers as defined by the class
Flags
.excludedNames
- a list of names which cannot be suggested (already used names).
Can be null
if there is no excluded names.
Flags
,
JavaCore.setOptions(java.util.Hashtable)
,
JavaCore.getDefaultOptions()
public static String[] suggestFieldNames(IJavaProject javaProject, String packageName, String qualifiedTypeName, int dim, int modifiers, String[] excludedNames)
If the type of the field is TypeName
, the prefix for field is pre
and the suffix for field is suf
then the proposed names are preTypeNamesuf
and preNamesuf
. If there is no prefix or suffix the proposals are typeName
and name
.
This method is affected by the following JavaCore options : CODEASSIST_FIELD_PREFIXES, CODEASSIST_FIELD_SUFFIXES and for instance field and CODEASSIST_STATIC_FIELD_PREFIXES, CODEASSIST_STATIC_FIELD_SUFFIXES for static field.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaCore#setOptions()
.
javaProject
- project which contains the field.packageName
- package of the field's type.qualifiedTypeName
- field's type.dim
- field's dimension (0 if the field is not an array).modifiers
- field's modifiers as defined by the class
Flags
.excludedNames
- a list of names which cannot be suggested (already used names).
Can be null
if there is no excluded names.
Flags
,
JavaCore.setOptions(java.util.Hashtable)
,
JavaCore.getDefaultOptions()
public static char[][] suggestLocalVariableNames(IJavaProject javaProject, char[] packageName, char[] qualifiedTypeName, int dim, char[][] excludedNames)
If the type of the local variable is TypeName
, the prefix for local variable is pre
and the suffix for local variable is suf
then the proposed names are preTypeNamesuf
and preNamesuf
. If there is no prefix or suffix the proposals are typeName
and name
.
This method is affected by the following JavaCore options : CODEASSIST_LOCAL_PREFIXES and CODEASSIST_LOCAL_SUFFIXES.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaCore#setOptions()
.
javaProject
- project which contains the variable.packageName
- package of the variable's type.qualifiedTypeName
- variable's type.dim
- variable's dimension (0 if the variable is not an array).excludedNames
- a list of names which cannot be suggested (already used names).
Can be null
if there is no excluded names.
JavaCore.setOptions(java.util.Hashtable)
,
JavaCore.getDefaultOptions()
public static String[] suggestLocalVariableNames(IJavaProject javaProject, String packageName, String qualifiedTypeName, int dim, String[] excludedNames)
If the type of the local variable is TypeName
, the prefix for local variable is pre
and the suffix for local variable is suf
then the proposed names are preTypeNamesuf
and preNamesuf
. If there is no prefix or suffix the proposals are typeName
and name
.
This method is affected by the following JavaCore options : CODEASSIST_LOCAL_PREFIXES and CODEASSIST_LOCAL_SUFFIXES.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaCore#setOptions()
.
javaProject
- project which contains the variable.packageName
- package of the variable's type.qualifiedTypeName
- variable's type.dim
- variable's dimension (0 if the variable is not an array).excludedNames
- a list of names which cannot be suggested (already used names).
Can be null
if there is no excluded names.
JavaCore.setOptions(java.util.Hashtable)
,
JavaCore.getDefaultOptions()
public static char[] suggestGetterName(IJavaProject project, char[] fieldName, int modifiers, boolean isBoolean, char[][] excludedNames)
If the field name is preFieldNamesuf
and the prefix for field is pre
and
the suffix for field is suf
then the prosposed name is isFieldName
for boolean field or
getFieldName
for others. If there is no prefix and suffix the proposal is isPreFieldNamesuf
for boolean field or getPreFieldNamesuf
for others.
This method is affected by the following JavaCore options : CODEASSIST_FIELD_PREFIXES, CODEASSIST_FIELD_SUFFIXES for instance field and CODEASSIST_STATIC_FIELD_PREFIXES, CODEASSIST_STATIC_FIELD_SUFFIXES for static field.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaCore#setOptions()
.
project
- project which contains the field.fieldName
- field's name's.modifiers
- field's modifiers as defined by the class
Flags
.isBoolean
- true
if the field's type is booleanexcludedNames
- a list of names which cannot be suggested (already used names).
Can be null
if there is no excluded names.
Flags
,
JavaCore.setOptions(java.util.Hashtable)
,
JavaCore.getDefaultOptions()
public static String suggestGetterName(IJavaProject project, String fieldName, int modifiers, boolean isBoolean, String[] excludedNames)
If the field name is preFieldNamesuf
and the prefix for field is pre
and
the suffix for field is suf
then the prosposed name is isFieldName
for boolean field or
getFieldName
for others. If there is no prefix and suffix the proposal is isPreFieldNamesuf
for boolean field or getPreFieldNamesuf
for others.
This method is affected by the following JavaCore options : CODEASSIST_FIELD_PREFIXES, CODEASSIST_FIELD_SUFFIXES for instance field and CODEASSIST_STATIC_FIELD_PREFIXES, CODEASSIST_STATIC_FIELD_SUFFIXES for static field.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaCore#setOptions()
.
project
- project which contains the field.fieldName
- field's name's.modifiers
- field's modifiers as defined by the class
Flags
.isBoolean
- true
if the field's type is booleanexcludedNames
- a list of names which cannot be suggested (already used names).
Can be null
if there is no excluded names.
Flags
,
JavaCore.setOptions(java.util.Hashtable)
,
JavaCore.getDefaultOptions()
public static char[] suggestSetterName(IJavaProject project, char[] fieldName, int modifiers, boolean isBoolean, char[][] excludedNames)
If the field name is preFieldNamesuf
and the prefix for field is pre
and
the suffix for field is suf
then the proposed name is setFieldName
.
If there is no prefix and suffix the proposal is setPreFieldNamesuf
.
This method is affected by the following JavaCore options : CODEASSIST_FIELD_PREFIXES, CODEASSIST_FIELD_SUFFIXES for instance field and CODEASSIST_STATIC_FIELD_PREFIXES, CODEASSIST_STATIC_FIELD_SUFFIXES for static field.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaCore#setOptions()
.
project
- project which contains the field.fieldName
- field's name's.modifiers
- field's modifiers as defined by the class
Flags
.isBoolean
- true
if the field's type is booleanexcludedNames
- a list of names which cannot be suggested (already used names).
Can be null
if there is no excluded names.
Flags
,
JavaCore.setOptions(java.util.Hashtable)
,
JavaCore.getDefaultOptions()
public static String suggestSetterName(IJavaProject project, String fieldName, int modifiers, boolean isBoolean, String[] excludedNames)
If the field name is preFieldNamesuf
and the prefix for field is pre
and
the suffix for field is suf
then the proposed name is setFieldName
.
If there is no prefix and suffix the proposal is setPreFieldNamesuf
.
This method is affected by the following JavaCore options : CODEASSIST_FIELD_PREFIXES, CODEASSIST_FIELD_SUFFIXES for instance field and CODEASSIST_STATIC_FIELD_PREFIXES, CODEASSIST_STATIC_FIELD_SUFFIXES for static field.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaCore#setOptions()
.
project
- project which contains the field.fieldName
- field's name's.modifiers
- field's modifiers as defined by the class
Flags
.isBoolean
- true
if the field's type is booleanexcludedNames
- a list of names which cannot be suggested (already used names).
Can be null
if there is no excluded names.
Flags
,
JavaCore.setOptions(java.util.Hashtable)
,
JavaCore.getDefaultOptions()
|
Eclipse JDT Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |