|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jdt.core.NamingConventions
public final class NamingConventions
Provides methods for computing Java-specific names.
The behavior of the methods is dependent of several JavaCore options.
The possible options are :
JavaCore.CODEASSIST_FIELD_PREFIXES
: Define the Prefixes for Field Name.JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES
: Define the Prefixes for Static Field Name.JavaCore.CODEASSIST_LOCAL_PREFIXES
: Define the Prefixes for Local Variable Name.JavaCore.CODEASSIST_ARGUMENT_PREFIXES
: Define the Prefixes for Argument Name.JavaCore.CODEASSIST_FIELD_SUFFIXES
: Define the Suffixes for Field Name.JavaCore.CODEASSIST_STATIC_FIELD_SUFFIXES
: Define the Suffixes for Static Field Name.JavaCore.CODEASSIST_LOCAL_SUFFIXES
: Define the Suffixes for Local Variable Name.JavaCore.CODEASSIST_ARGUMENT_SUFFIXES
: Define the Suffixes for Argument Name.
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.
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 java.lang.String |
removePrefixAndSuffixForArgumentName(IJavaProject javaProject,
java.lang.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 java.lang.String |
removePrefixAndSuffixForFieldName(IJavaProject javaProject,
java.lang.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 java.lang.String |
removePrefixAndSuffixForLocalVariableName(IJavaProject javaProject,
java.lang.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 java.lang.String[] |
suggestArgumentNames(IJavaProject javaProject,
java.lang.String packageName,
java.lang.String qualifiedTypeName,
int dim,
java.lang.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 java.lang.String[] |
suggestFieldNames(IJavaProject javaProject,
java.lang.String packageName,
java.lang.String qualifiedTypeName,
int dim,
int modifiers,
java.lang.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 java.lang.String |
suggestGetterName(IJavaProject project,
java.lang.String fieldName,
int modifiers,
boolean isBoolean,
java.lang.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 java.lang.String[] |
suggestLocalVariableNames(IJavaProject javaProject,
java.lang.String packageName,
java.lang.String qualifiedTypeName,
int dim,
java.lang.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 java.lang.String |
suggestSetterName(IJavaProject project,
java.lang.String fieldName,
int modifiers,
boolean isBoolean,
java.lang.String[] excludedNames)
Suggest name for a setter method. |
Methods inherited from class java.lang.Object |
---|
equals, 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 : JavaCore.CODEASSIST_ARGUMENT_PREFIXES
and
JavaCore.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 java.lang.String removePrefixAndSuffixForArgumentName(IJavaProject javaProject, java.lang.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 : JavaCore.CODEASSIST_ARGUMENT_PREFIXES
and
JavaCore.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 : JavaCore.CODEASSIST_FIELD_PREFIXES
} ,
JavaCore.CODEASSIST_FIELD_SUFFIXES
for instance field and JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES
,
JavaCore.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 java.lang.String removePrefixAndSuffixForFieldName(IJavaProject javaProject, java.lang.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 : JavaCore.CODEASSIST_FIELD_PREFIXES
,
JavaCore.CODEASSIST_FIELD_SUFFIXES
for instance field and JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES
,
JavaCore.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 : JavaCore.CODEASSIST_LOCAL_PREFIXES
and
JavaCore.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 java.lang.String removePrefixAndSuffixForLocalVariableName(IJavaProject javaProject, java.lang.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 : JavaCore.CODEASSIST_LOCAL_PREFIXES
and
JavaCore.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 : JavaCore.CODEASSIST_ARGUMENT_PREFIXES
and
JavaCore.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 java.lang.String[] suggestArgumentNames(IJavaProject javaProject, java.lang.String packageName, java.lang.String qualifiedTypeName, int dim, java.lang.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 : JavaCore.CODEASSIST_ARGUMENT_PREFIXES
and
JavaCore.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 : JavaCore.CODEASSIST_FIELD_PREFIXES
,
JavaCore.CODEASSIST_FIELD_SUFFIXES
and for instance field and JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES
,
JavaCore.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 java.lang.String[] suggestFieldNames(IJavaProject javaProject, java.lang.String packageName, java.lang.String qualifiedTypeName, int dim, int modifiers, java.lang.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 : JavaCore.CODEASSIST_FIELD_PREFIXES
,
JavaCore.CODEASSIST_FIELD_SUFFIXES
and for instance field and JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES
,
JavaCore.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 : JavaCore.CODEASSIST_LOCAL_PREFIXES
and
JavaCore.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 java.lang.String[] suggestLocalVariableNames(IJavaProject javaProject, java.lang.String packageName, java.lang.String qualifiedTypeName, int dim, java.lang.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 : JavaCore.CODEASSIST_LOCAL_PREFIXES
and
JavaCore.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 : JavaCore.CODEASSIST_FIELD_PREFIXES
,
JavaCore.CODEASSIST_FIELD_SUFFIXES
for instance field and JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES
,
JavaCore.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 java.lang.String suggestGetterName(IJavaProject project, java.lang.String fieldName, int modifiers, boolean isBoolean, java.lang.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 : JavaCore.CODEASSIST_FIELD_PREFIXES
,
JavaCore.CODEASSIST_FIELD_SUFFIXES
for instance field and JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES
,
JavaCore.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 : JavaCore.CODEASSIST_FIELD_PREFIXES
,
JavaCore.CODEASSIST_FIELD_SUFFIXES
for instance field and JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES
,
JavaCore.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 java.lang.String suggestSetterName(IJavaProject project, java.lang.String fieldName, int modifiers, boolean isBoolean, java.lang.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 : JavaCore.CODEASSIST_FIELD_PREFIXES
,
JavaCore.CODEASSIST_FIELD_SUFFIXES
for instance field and JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES
,
JavaCore.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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |