public class JavaSourceCodeFormatter extends SourceCodeFormatter
By default, the formatter uses an indentation of 4 spaces for Java code, in line with common Java coding conventions. However, this can be customized if needed.
SourceCodeFormatter| Constructor and Description |
|---|
JavaSourceCodeFormatter()
Constructs a new Java source code formatter with the default indentation level.
|
JavaSourceCodeFormatter(AtomicInteger indent)
Constructs a new Java source code formatter with a provided AtomicInteger to manage the indentation level.
|
JavaSourceCodeFormatter(int indent)
Constructs a new Java source code formatter with a specified initial indentation level.
|
| Modifier and Type | Method and Description |
|---|---|
SourceCodeFormatter |
append(long i)
Appends the provided long value to the formatted string.
|
append, append, append, append, append, append, charAt, contains, length, setLength, subSequence, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitchars, codePointspublic JavaSourceCodeFormatter()
public JavaSourceCodeFormatter(int indent)
indent - Initial indentation level.public JavaSourceCodeFormatter(AtomicInteger indent)
This can be useful in scenarios where the indentation needs to be managed or adjusted externally.
indent - AtomicInteger managing the indentation level.public SourceCodeFormatter append(long i)
SourceCodeFormatterappend in class SourceCodeFormatteri - The long value to append.Copyright © 2024. All rights reserved.