public final class NamingConventions
extends java.lang.Object
The behavior of the methods is dependent of several JavaScriptCore options.
The possible options are :
JavaScriptCore.CODEASSIST_FIELD_PREFIXES
: Define the Prefixes for Field Name.JavaScriptCore.CODEASSIST_STATIC_FIELD_PREFIXES
: Define the Prefixes for Static Field Name.JavaScriptCore.CODEASSIST_LOCAL_PREFIXES
: Define the Prefixes for Local Variable Name.JavaScriptCore.CODEASSIST_ARGUMENT_PREFIXES
: Define the Prefixes for Argument Name.JavaScriptCore.CODEASSIST_FIELD_SUFFIXES
: Define the Suffixes for Field Name.JavaScriptCore.CODEASSIST_STATIC_FIELD_SUFFIXES
: Define the Suffixes for Static Field Name.JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES
: Define the Suffixes for Local Variable Name.JavaScriptCore.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 JavaScriptCore#setOptions()
.
This class provides static methods and constants only; it is not intended to be instantiated or subclassed by clients.
JavaScriptCore.setOptions(java.util.Hashtable)
,
Provisional API: This class/interface is part of an interim API that is still under development and expected to
change significantly before reaching stability. It is being made available at this early stage to solicit feedback
from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
(repeatedly) as the API evolves.
Modifier and Type | Method and Description |
---|---|
static char[] |
removePrefixAndSuffixForArgumentName(IJavaScriptProject javaProject,
char[] argumentName)
Remove prefix and suffix from an argument name.
|
static java.lang.String |
removePrefixAndSuffixForArgumentName(IJavaScriptProject javaProject,
java.lang.String argumentName)
Remove prefix and suffix from an argument name.
|
static char[] |
removePrefixAndSuffixForFieldName(IJavaScriptProject javaProject,
char[] fieldName,
int modifiers)
Remove prefix and suffix from a field name.
|
static java.lang.String |
removePrefixAndSuffixForFieldName(IJavaScriptProject javaProject,
java.lang.String fieldName,
int modifiers)
Remove prefix and suffix from a field name.
|
static char[] |
removePrefixAndSuffixForLocalVariableName(IJavaScriptProject javaProject,
char[] localName)
Remove prefix and suffix from a local variable name.
|
static java.lang.String |
removePrefixAndSuffixForLocalVariableName(IJavaScriptProject javaProject,
java.lang.String localName)
Remove prefix and suffix from a local variable name.
|
static char[][] |
suggestArgumentNames(IJavaScriptProject javaProject,
char[] packageName,
char[] qualifiedTypeName,
int dim,
char[][] excludedNames)
Suggest names for an argument.
|
static java.lang.String[] |
suggestArgumentNames(IJavaScriptProject javaProject,
java.lang.String packageName,
java.lang.String qualifiedTypeName,
int dim,
java.lang.String[] excludedNames)
Suggest names for an argument.
|
static char[][] |
suggestFieldNames(IJavaScriptProject javaProject,
char[] packageName,
char[] qualifiedTypeName,
int dim,
int modifiers,
char[][] excludedNames)
Suggest names for a field.
|
static java.lang.String[] |
suggestFieldNames(IJavaScriptProject 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(IJavaScriptProject project,
char[] fieldName,
int modifiers,
boolean isBoolean,
char[][] excludedNames)
Suggest name for a getter method.
|
static java.lang.String |
suggestGetterName(IJavaScriptProject project,
java.lang.String fieldName,
int modifiers,
boolean isBoolean,
java.lang.String[] excludedNames)
Suggest name for a getter method.
|
static char[][] |
suggestLocalVariableNames(IJavaScriptProject javaProject,
char[] packageName,
char[] qualifiedTypeName,
int dim,
char[][] excludedNames)
Suggest names for a local variable.
|
static java.lang.String[] |
suggestLocalVariableNames(IJavaScriptProject javaProject,
java.lang.String packageName,
java.lang.String qualifiedTypeName,
int dim,
java.lang.String[] excludedNames)
Suggest names for a local variable.
|
static char[] |
suggestSetterName(IJavaScriptProject project,
char[] fieldName,
int modifiers,
boolean isBoolean,
char[][] excludedNames)
Suggest name for a setter method.
|
static java.lang.String |
suggestSetterName(IJavaScriptProject project,
java.lang.String fieldName,
int modifiers,
boolean isBoolean,
java.lang.String[] excludedNames)
Suggest name for a setter method.
|
public static char[] removePrefixAndSuffixForArgumentName(IJavaScriptProject 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 JavaScriptCore options the result is the unchanged
name preArgsuf
.
This method is affected by the following JavaScriptCore options : JavaScriptCore.CODEASSIST_ARGUMENT_PREFIXES
and
JavaScriptCore.CODEASSIST_ARGUMENT_SUFFIXES
.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaScriptCore#setOptions()
.
javaProject
- project which contains the argument.argumentName
- argument's name.JavaScriptCore.setOptions(java.util.Hashtable)
,
JavaScriptCore.getDefaultOptions()
public static java.lang.String removePrefixAndSuffixForArgumentName(IJavaScriptProject 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 JavaScriptCore options the result is the unchanged
name preArgsuf
.
This method is affected by the following JavaScriptCore options : JavaScriptCore.CODEASSIST_ARGUMENT_PREFIXES
and
JavaScriptCore.CODEASSIST_ARGUMENT_SUFFIXES
.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaScriptCore#setOptions()
.
javaProject
- project which contains the argument.argumentName
- argument's name.JavaScriptCore.setOptions(java.util.Hashtable)
,
JavaScriptCore.getDefaultOptions()
public static char[] removePrefixAndSuffixForFieldName(IJavaScriptProject 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 JavaScriptCore options the result is the unchanged
name preFieldsuf
.
This method is affected by the following JavaScriptCore options : JavaScriptCore.CODEASSIST_FIELD_PREFIXES
} ,
JavaScriptCore.CODEASSIST_FIELD_SUFFIXES
for instance field and JavaScriptCore.CODEASSIST_STATIC_FIELD_PREFIXES
,
JavaScriptCore.CODEASSIST_STATIC_FIELD_SUFFIXES
for static field.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaScriptCore#setOptions()
.
javaProject
- project which contains the field.fieldName
- field's name.modifiers
- field's modifiers as defined by the class
Flags
.Flags
,
JavaScriptCore.setOptions(java.util.Hashtable)
,
JavaScriptCore.getDefaultOptions()
public static java.lang.String removePrefixAndSuffixForFieldName(IJavaScriptProject 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 JavaScriptCore options the result is the unchanged
name preFieldsuf
.
This method is affected by the following JavaScriptCore options : JavaScriptCore.CODEASSIST_FIELD_PREFIXES
,
JavaScriptCore.CODEASSIST_FIELD_SUFFIXES
for instance field and JavaScriptCore.CODEASSIST_STATIC_FIELD_PREFIXES
,
JavaScriptCore.CODEASSIST_STATIC_FIELD_SUFFIXES
for static field.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaScriptCore#setOptions()
.
javaProject
- project which contains the field.fieldName
- field's name.modifiers
- field's modifiers as defined by the class
Flags
.Flags
,
JavaScriptCore.setOptions(java.util.Hashtable)
,
JavaScriptCore.getDefaultOptions()
public static char[] removePrefixAndSuffixForLocalVariableName(IJavaScriptProject 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 JavaScriptCore options the result is the unchanged
name preLocalsuf
.
This method is affected by the following JavaScriptCore options : JavaScriptCore.CODEASSIST_LOCAL_PREFIXES
and
JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES
.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaScriptCore#setOptions()
.
javaProject
- project which contains the variable.localName
- variable's name.JavaScriptCore.setOptions(java.util.Hashtable)
,
JavaScriptCore.getDefaultOptions()
public static java.lang.String removePrefixAndSuffixForLocalVariableName(IJavaScriptProject 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 JavaScriptCore options the result is the unchanged
name preLocalsuf
.
This method is affected by the following JavaScriptCore options : JavaScriptCore.CODEASSIST_LOCAL_PREFIXES
and
JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES
.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaScriptCore#setOptions()
.
javaProject
- project which contains the variable.localName
- variable's name.JavaScriptCore.setOptions(java.util.Hashtable)
,
JavaScriptCore.getDefaultOptions()
public static char[][] suggestArgumentNames(IJavaScriptProject 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 JavaScriptCore options : JavaScriptCore.CODEASSIST_ARGUMENT_PREFIXES
and
JavaScriptCore.CODEASSIST_ARGUMENT_SUFFIXES
.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaScriptCore#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.JavaScriptCore.setOptions(java.util.Hashtable)
,
JavaScriptCore.getDefaultOptions()
public static java.lang.String[] suggestArgumentNames(IJavaScriptProject 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 JavaScriptCore options : JavaScriptCore.CODEASSIST_ARGUMENT_PREFIXES
and
JavaScriptCore.CODEASSIST_ARGUMENT_SUFFIXES
.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaScriptCore#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.JavaScriptCore.setOptions(java.util.Hashtable)
,
JavaScriptCore.getDefaultOptions()
public static char[][] suggestFieldNames(IJavaScriptProject 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 JavaScriptCore options : JavaScriptCore.CODEASSIST_FIELD_PREFIXES
,
JavaScriptCore.CODEASSIST_FIELD_SUFFIXES
and for instance field and JavaScriptCore.CODEASSIST_STATIC_FIELD_PREFIXES
,
JavaScriptCore.CODEASSIST_STATIC_FIELD_SUFFIXES
for static field.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaScriptCore#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
,
JavaScriptCore.setOptions(java.util.Hashtable)
,
JavaScriptCore.getDefaultOptions()
public static java.lang.String[] suggestFieldNames(IJavaScriptProject 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 JavaScriptCore options : JavaScriptCore.CODEASSIST_FIELD_PREFIXES
,
JavaScriptCore.CODEASSIST_FIELD_SUFFIXES
and for instance field and JavaScriptCore.CODEASSIST_STATIC_FIELD_PREFIXES
,
JavaScriptCore.CODEASSIST_STATIC_FIELD_SUFFIXES
for static field.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaScriptCore#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
,
JavaScriptCore.setOptions(java.util.Hashtable)
,
JavaScriptCore.getDefaultOptions()
public static char[][] suggestLocalVariableNames(IJavaScriptProject 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 JavaScriptCore options : JavaScriptCore.CODEASSIST_LOCAL_PREFIXES
and
JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES
.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaScriptCore#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.JavaScriptCore.setOptions(java.util.Hashtable)
,
JavaScriptCore.getDefaultOptions()
public static java.lang.String[] suggestLocalVariableNames(IJavaScriptProject 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 JavaScriptCore options : JavaScriptCore.CODEASSIST_LOCAL_PREFIXES
and
JavaScriptCore.CODEASSIST_LOCAL_SUFFIXES
.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaScriptCore#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.JavaScriptCore.setOptions(java.util.Hashtable)
,
JavaScriptCore.getDefaultOptions()
public static char[] suggestGetterName(IJavaScriptProject 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 JavaScriptCore options : JavaScriptCore.CODEASSIST_FIELD_PREFIXES
,
JavaScriptCore.CODEASSIST_FIELD_SUFFIXES
for instance field and JavaScriptCore.CODEASSIST_STATIC_FIELD_PREFIXES
,
JavaScriptCore.CODEASSIST_STATIC_FIELD_SUFFIXES
for static field.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaScriptCore#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
,
JavaScriptCore.setOptions(java.util.Hashtable)
,
JavaScriptCore.getDefaultOptions()
public static java.lang.String suggestGetterName(IJavaScriptProject 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 JavaScriptCore options : JavaScriptCore.CODEASSIST_FIELD_PREFIXES
,
JavaScriptCore.CODEASSIST_FIELD_SUFFIXES
for instance field and JavaScriptCore.CODEASSIST_STATIC_FIELD_PREFIXES
,
JavaScriptCore.CODEASSIST_STATIC_FIELD_SUFFIXES
for static field.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaScriptCore#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
,
JavaScriptCore.setOptions(java.util.Hashtable)
,
JavaScriptCore.getDefaultOptions()
public static char[] suggestSetterName(IJavaScriptProject 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 JavaScriptCore options : JavaScriptCore.CODEASSIST_FIELD_PREFIXES
,
JavaScriptCore.CODEASSIST_FIELD_SUFFIXES
for instance field and JavaScriptCore.CODEASSIST_STATIC_FIELD_PREFIXES
,
JavaScriptCore.CODEASSIST_STATIC_FIELD_SUFFIXES
for static field.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaScriptCore#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
,
JavaScriptCore.setOptions(java.util.Hashtable)
,
JavaScriptCore.getDefaultOptions()
public static java.lang.String suggestSetterName(IJavaScriptProject 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 JavaScriptCore options : JavaScriptCore.CODEASSIST_FIELD_PREFIXES
,
JavaScriptCore.CODEASSIST_FIELD_SUFFIXES
for instance field and JavaScriptCore.CODEASSIST_STATIC_FIELD_PREFIXES
,
JavaScriptCore.CODEASSIST_STATIC_FIELD_SUFFIXES
for static field.
For a complete description of these configurable options, see getDefaultOptions
.
For programmaticaly change these options, see JavaScriptCore#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
,
JavaScriptCore.setOptions(java.util.Hashtable)
,
JavaScriptCore.getDefaultOptions()
Copyright (c) IBM Corp. and others 2000, 2016. All Rights Reserved.