formatter package

The formatter package contains different formatting classes:

  • BinaryDiffFormatter: This class formats the difference of two contents.
  • HexFormatter: This class formats data as hex representation.
  • SQLFileFormatter: The SQLFileFormatter formats a SQL content.
  • JavaFileFormatter: The JavaFileFormatter formats a Java content.

JavaFileFormatterConfig

The following table shows the JavaFileFormatter configuration:

Key

Default value

Description

javaFormatter.fileheader

see

Defines the file header

javaFormatter.fileheaderLicense

see

Defines the file license

javaFormatter.filetrailer

see

Defines the file trailer

javaFormatter.overwriteFile

false

Flag to overwrite an existing file

javaFormatter.updateFile

true

Flag to update an existing file

javaFormatter.newline

\r\n

Defines the newline characters

javaFormatter.indentSymbol

\

Defines the indention symbol

javaFormatter.numberOfIndentSymbols

4

The number of indent symbols for an indention step

javaFormatter.maxLineLenght

80

Defines the line max. length

javaFormatter.forceLineBreaksForTooLongLines

true

Flag to force line breaks

javaFormatter.newlinesAfterPackage

2

Defines the newlines after a package

javaFormatter.newlinesAfterImport

2

Defines the newlines after an import

javaFormatter.newlinesAfterStaticImport

2

Defines the newlines after a static import

javaFormatter.newlineAfterStaticBlock

2

Defines the newlines after a static block

javaFormatter.newlineBewteenStaticBlock

2

Defines the newlines between static blocks

javaFormatter.newlinesAfterEnumType

2

Defines the newlines after an enum type

javaFormatter.newlinesBetweenEnumType

1

Defines the newlines betwwn enum types

javaFormatter.newlinesAfterEnumBlock

2

Defines the newlines after an enumeration block

javaFormatter.newlinesBetweenEnumBlock

1

Defines the newlines between enumeration blocks

javaFormatter.newlinesAfterAnnotationDeclaration

2

Defines the newlines after a annotation declaration

javaFormatter.newlinesBetweenAnnotationDeclaration

2

Defines the newlines between annotation declarations

javaFormatter.newlinesBetweenAnnotationMethods

2

Defines the newlines between annotation methods

javaFormatter.newlinesAfterMethod

2

Defines the newlines after a method

javaFormatter.newlinesBetweenMethods

2

Defines the newlines between methods

javaFormatter.newlinesBeforeAttributComment

1

Defines the newlines before an attribute comment

javaFormatter.newlinesBetweenAttributs

0

Defines the newlines between attributes

javaFormatter.newlinesAfterAttribut

2

Defines the newlines after the attribute definitions

javaFormatter.newlineBeforeBrace

1

Defines the newlines before a brace

javaFormatter.newlinesBeforeFooterComment

2

Defines the newlines before the footer comment

javaFormatter.forceNewlineBeforeThrowsDefinition

true

Flag to force a new line before throws defintion

javaFormatter.spacesAssignLeft

1

Defines the spaces left of a assign statement

javaFormatter.spacesAssignRight

1

Defines the spaces right of a assign statement

javaFormatter.spacesBetweenStringConstants

1

Defines the spaces between string constants

javaFormatter.keepStringConcatFormat

false

Flag to keep concat string format

javaFormatter.spacesAroundTypesOnCasting

1

Defines the spaces around a type casting

javaFormatter.spacesAfterAndBeforeParenthesisInParameterList

1

Defines the spaces in parameterlist

javaFormatter.spaceAfterCommaInparameterList

1

Defines the spaces after a comma in the parameter list

javaFormatter.spacesAfterCommaInThrowsDefinition

1

Defines the spaces after comma in throws definion

javaFormatter.spacesAfterAndBeforeParenthesisInCatchBlock

1

Defines the spaces in catch block

javaFormatter.spacesAfterAndBeforeParenthesisInForLoop

1

Defines the spaces in for loop

javaFormatter.spacesAfterAndBeforeParenthesisInWhileLoop

1

Defines the spaces in while loop

javaFormatter.spacesAfterAndBeforeParenthesisInIfBlock

1

Defines the spaces in if block

javaFormatter.indentAttributeLengthByInitialisation

true

Flag to indent attribute length by attribute initialisation

javaFormatter.javaFormatter.attributesAreAtEndOfFile

false

True means attributes are placed at the end of a class, otherwise false

javaFormatter.sortAttributesAlphabetical

false

Flag to enable the alphabetical sort order for attributes.

javaFormatter.sortMethodAlphabetical

false

Flag to enable the alphabetical sort order for methods.

javaFormatter.users.xxx

Defines a mapping of a system user identification and a name.

Example:
javaFormatter.users.t1 = Tester1
javaFormatter.users.t2 = Tester2

javaFormatter.pathMap.xxx

Defines a mapping between a package/class and the output path. The package/class represent the key which supports a regular expression!

Example:
javaFormatter.pathMap1.jptools.*.tests.* = src-tests
javaFormatter.pathMap2.jptools.demo.* = src-demo

The first entry defines the rule to paste all tests subpackages into the src-tests directory. The second rule moves everything from the jptools.demo subpackage into the src-demo directory.

IMPORTANT: The sort order of the entries are defined with the number before the packagename. The sort order corresponds to the rules and is important!

javaFormatter.javadocVersion

$Revision :$

Defines the javadoc version tag



file header:

/****************************************************************************
 * File        : @FILENAME@ 
 * Author      : @AUTHOR@ 
 * Date        : @CREATION_DATE@
 * Last change : @LAST_CHANGE@ 
 * Version     : @VERSION@

file license:

 *
 * Copyright (C) @YEAR@ by @AUTHOR@ 
 *
 ****************************************************************************
 *  This file is part of the jpTools library
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 ****************************************************************************
 * @ID@ 
 ****************************************************************************
 */

file footer:



/****************************************************************************/
/* EOF                                                                      */
/****************************************************************************/