public final class CodeStyle extends Object
Modifier and Type | Class and Description |
---|---|
static class |
CodeStyle.BracePlacement |
static class |
CodeStyle.BracesGenerationStyle |
static class |
CodeStyle.ImportGroups
Provides an information about the desired grouping of import statements,
including group order.
|
static class |
CodeStyle.InsertionPoint |
static class |
CodeStyle.MemberGroups
Provides an information about the desired grouping of class members,
including group order.
|
static class |
CodeStyle.WrapStyle |
@Deprecated public static CodeStyle getDefault(Project project)
CodeStyle.getDefault(javax.swing.text.Document)
or CodeStyle.getDefault(org.openide.filesystems.FileObject)
respectively.CodeStyle
for files in the given project.
Please see the other two getDefault
methods as they are
the preferred way of getting CodeStyle
.
project
- The project to get the CodeStyle
for.project
.public static CodeStyle getDefault(FileObject file)
CodeStyle
for the given file. If you have a document
instance you should use the CodeStyle.getDefault(javax.swing.text.Document)
method.file
- The file to get the CodeStyle
for.file
were opened in the editor.public static CodeStyle getDefault(Document doc)
CodeStyle
for the given document. This is the preferred
method of getting CodeStyle
. If you don't have a document
you can use CodeStyle.getDefault(org.openide.filesystems.FileObject)
method instead.doc
- The document to get the CodeStyle
for.public boolean expandTabToSpaces()
public int getTabSize()
public int getIndentSize()
public int getContinuationIndentSize()
public int getLabelIndent()
public boolean absoluteLabelIndent()
public boolean indentTopLevelClassMembers()
public boolean indentCasesFromSwitch()
public int getRightMargin()
public boolean addLeadingStarInComment()
public boolean preferLongerNames()
public String getFieldNamePrefix()
public String getFieldNameSuffix()
public String getStaticFieldNamePrefix()
public String getStaticFieldNameSuffix()
public String getParameterNamePrefix()
public String getParameterNameSuffix()
public String getLocalVarNamePrefix()
public String getLocalVarNameSuffix()
public boolean qualifyFieldAccess()
public boolean useIsForBooleanGetters()
public boolean addOverrideAnnotation()
public boolean makeLocalVarsFinal()
public boolean makeParametersFinal()
public CodeStyle.MemberGroups getClassMemberGroups()
public boolean keepGettersAndSettersTogether()
public boolean sortMembersInGroupsAlphabetically()
public boolean computeMemberDependencies()
Changing member order without looking for dependencies may result in incorrect code. A field must be declared textually first, and only then it can be referenced by simple name from field initializers and class/instance initializers - see defect #249199.
public CodeStyle.InsertionPoint getClassMemberInsertionPoint()
public CodeStyle.BracePlacement getModuleDeclBracePlacement()
public CodeStyle.BracePlacement getClassDeclBracePlacement()
public CodeStyle.BracePlacement getMethodDeclBracePlacement()
public CodeStyle.BracePlacement getOtherBracePlacement()
public boolean specialElseIf()
public CodeStyle.BracesGenerationStyle redundantIfBraces()
public CodeStyle.BracesGenerationStyle redundantForBraces()
public CodeStyle.BracesGenerationStyle redundantWhileBraces()
public CodeStyle.BracesGenerationStyle redundantDoWhileBraces()
public boolean alignMultilineExports()
public boolean alignMultilineOpens()
public boolean alignMultilineProvides()
public boolean alignMultilineMethodParams()
public boolean alignMultilineLambdaParams()
public boolean alignMultilineCallArgs()
public boolean alignMultilineAnnotationArgs()
public boolean alignMultilineImplements()
public boolean alignMultilineThrows()
public boolean alignMultilineParenthesized()
public boolean alignMultilineBinaryOp()
public boolean alignMultilineTernaryOp()
public boolean alignMultilineAssignment()
public boolean alignMultilineTryResources()
public boolean alignMultilineDisjunctiveCatchTypes()
public boolean alignMultilineFor()
public boolean alignMultilineArrayInit()
public boolean placeElseOnNewLine()
public boolean placeWhileOnNewLine()
public boolean placeCatchOnNewLine()
public boolean placeFinallyOnNewLine()
public boolean placeNewLineAfterModifiers()
public CodeStyle.WrapStyle wrapProvidesWithKeyword()
public CodeStyle.WrapStyle wrapProvidesWithList()
public CodeStyle.WrapStyle wrapExportsToKeyword()
public CodeStyle.WrapStyle wrapExportsToList()
public CodeStyle.WrapStyle wrapOpensToKeyword()
public CodeStyle.WrapStyle wrapOpensToList()
public CodeStyle.WrapStyle wrapExtendsImplementsKeyword()
public CodeStyle.WrapStyle wrapExtendsImplementsList()
public CodeStyle.WrapStyle wrapMethodParams()
public CodeStyle.WrapStyle wrapLambdaParams()
public CodeStyle.WrapStyle wrapLambdaArrow()
public boolean wrapAfterLambdaArrow()
public CodeStyle.WrapStyle wrapThrowsKeyword()
public CodeStyle.WrapStyle wrapThrowsList()
public CodeStyle.WrapStyle wrapMethodCallArgs()
public CodeStyle.WrapStyle wrapAnnotationArgs()
public CodeStyle.WrapStyle wrapChainedMethodCalls()
public boolean wrapAfterDotInChainedMethodCalls()
public CodeStyle.WrapStyle wrapArrayInit()
public CodeStyle.WrapStyle wrapTryResources()
public CodeStyle.WrapStyle wrapDisjunctiveCatchTypes()
public boolean wrapAfterDisjunctiveCatchBar()
public CodeStyle.WrapStyle wrapFor()
public CodeStyle.WrapStyle wrapForStatement()
public CodeStyle.WrapStyle wrapIfStatement()
public CodeStyle.WrapStyle wrapWhileStatement()
public CodeStyle.WrapStyle wrapDoWhileStatement()
public CodeStyle.WrapStyle wrapCaseStatements()
public CodeStyle.WrapStyle wrapAssert()
public CodeStyle.WrapStyle wrapEnumConstants()
public CodeStyle.WrapStyle wrapAnnotations()
public CodeStyle.WrapStyle wrapBinaryOps()
public boolean wrapAfterBinaryOps()
public CodeStyle.WrapStyle wrapTernaryOps()
public boolean wrapAfterTernaryOps()
public CodeStyle.WrapStyle wrapAssignOps()
public boolean wrapAfterAssignOps()
public int getMaximumBlankLinesInDeclarations()
public int getMaximumBlankLinesInCode()
public int getBlankLinesAfterModuleHeader()
public int getBlankLinesBeforeModuleClosingBrace()
public int getBlankLinesBeforeModuleDirectives()
public int getBlankLinesAfterModuleDirectives()
public int getBlankLinesBeforePackage()
public int getBlankLinesAfterPackage()
public int getBlankLinesBeforeImports()
public int getBlankLinesAfterImports()
public int getBlankLinesBeforeClass()
public int getBlankLinesAfterClass()
public int getBlankLinesAfterClassHeader()
public int getBlankLinesAfterAnonymousClassHeader()
public int getBlankLinesAfterEnumHeader()
public int getBlankLinesBeforeClassClosingBrace()
public int getBlankLinesBeforeAnonymousClassClosingBrace()
public int getBlankLinesBeforeEnumClosingBrace()
public int getBlankLinesBeforeFields()
public int getBlankLinesAfterFields()
public int getBlankLinesBeforeMethods()
public int getBlankLinesAfterMethods()
public boolean spaceBeforeWhile()
public boolean spaceBeforeElse()
public boolean spaceBeforeCatch()
public boolean spaceBeforeFinally()
public boolean spaceBeforeMethodDeclParen()
public boolean spaceBeforeMethodCallParen()
public boolean spaceBeforeIfParen()
public boolean spaceBeforeForParen()
public boolean spaceBeforeWhileParen()
public boolean spaceBeforeTryParen()
public boolean spaceBeforeCatchParen()
public boolean spaceBeforeSwitchParen()
public boolean spaceBeforeSynchronizedParen()
public boolean spaceBeforeAnnotationParen()
public boolean spaceAroundUnaryOps()
public boolean spaceAroundBinaryOps()
public boolean spaceAroundTernaryOps()
public boolean spaceAroundAssignOps()
public boolean spaceAroundAnnotationValueAssignOps()
public boolean spaceAroundLambdaArrow()
public boolean spaceAroundMethodReferenceDoubleColon()
public boolean spaceBeforeModuleDeclLeftBrace()
public boolean spaceBeforeClassDeclLeftBrace()
public boolean spaceBeforeMethodDeclLeftBrace()
public boolean spaceBeforeIfLeftBrace()
public boolean spaceBeforeElseLeftBrace()
public boolean spaceBeforeWhileLeftBrace()
public boolean spaceBeforeForLeftBrace()
public boolean spaceBeforeDoLeftBrace()
public boolean spaceBeforeSwitchLeftBrace()
public boolean spaceBeforeTryLeftBrace()
public boolean spaceBeforeCatchLeftBrace()
public boolean spaceBeforeFinallyLeftBrace()
public boolean spaceBeforeSynchronizedLeftBrace()
public boolean spaceBeforeStaticInitLeftBrace()
public boolean spaceBeforeArrayInitLeftBrace()
public boolean spaceWithinParens()
public boolean spaceWithinMethodDeclParens()
public boolean spaceWithinLambdaParens()
public boolean parensAroundSingularLambdaParam()
public boolean spaceWithinMethodCallParens()
public boolean spaceWithinIfParens()
public boolean spaceWithinForParens()
public boolean spaceWithinWhileParens()
public boolean spaceWithinSwitchParens()
public boolean spaceWithinTryParens()
public boolean spaceWithinCatchParens()
public boolean spaceWithinSynchronizedParens()
public boolean spaceWithinTypeCastParens()
public boolean spaceWithinAnnotationParens()
public boolean spaceWithinBraces()
public boolean spaceWithinArrayInitBrackets()
public boolean spaceWithinArrayIndexBrackets()
public boolean spaceBeforeComma()
public boolean spaceAfterComma()
public boolean spaceBeforeSemi()
public boolean spaceAfterSemi()
public boolean spaceBeforeColon()
public boolean spaceAfterColon()
public boolean spaceAfterTypeCast()
public boolean useSingleClassImport()
true
if the single class imports should be added,
false
if the 'star' import of the entire package should be addedpublic boolean useFQNs()
true
if the fully qualified class name should be generated
every time the class is used, false
if the import statement
and the simple class name should be used instead.public boolean importInnerClasses()
public boolean preferStaticImports()
public int countForUsingStarImport()
public int countForUsingStaticStarImport()
public String[] getPackagesForStarImport()
public CodeStyle.ImportGroups getImportGroups()
public boolean separateImportGroups()
public boolean enableBlockCommentFormatting()
public boolean enableJavadocFormatting()
public boolean wrapCommentText()
public boolean wrapOneLineComments()
public boolean preserveNewLinesInComments()
public boolean blankLineAfterJavadocDescription()
public boolean blankLineAfterJavadocParameterDescriptions()
public boolean blankLineAfterJavadocReturnTag()
public boolean generateParagraphTagOnBlankLines()
public boolean alignJavadocParameterDescriptions()
public boolean alignJavadocReturnDescription()
public boolean alignJavadocExceptionDescriptions()