Class FormattingJavaFileObject
java.lang.Object
javax.tools.ForwardingFileObject<JavaFileObject>
javax.tools.ForwardingJavaFileObject<JavaFileObject>
com.google.googlejavaformat.java.filer.FormattingJavaFileObject
- All Implemented Interfaces:
FileObject,JavaFileObject
A
JavaFileObject decorator which formats source code.-
Nested Class Summary
Nested classes/interfaces inherited from interface javax.tools.JavaFileObject
JavaFileObject.Kind -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intA rough estimate of the average file size: 80 chars per line, 500 lines.private final Formatterprivate final MessagerFields inherited from class javax.tools.ForwardingFileObject
fileObject -
Constructor Summary
ConstructorsConstructorDescriptionFormattingJavaFileObject(JavaFileObject delegate, Formatter formatter, @Nullable Messager messager) Create a newFormattingJavaFileObject. -
Method Summary
Methods inherited from class javax.tools.ForwardingJavaFileObject
getAccessLevel, getKind, getNestingKind, isNameCompatibleMethods inherited from class javax.tools.ForwardingFileObject
delete, getCharContent, getLastModified, getName, openInputStream, openOutputStream, openReader, toUriMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.tools.FileObject
delete, getCharContent, getLastModified, getName, openInputStream, openOutputStream, openReader, toUri
-
Field Details
-
DEFAULT_FILE_SIZE
private static final int DEFAULT_FILE_SIZEA rough estimate of the average file size: 80 chars per line, 500 lines.- See Also:
-
formatter
-
messager
-
-
Constructor Details
-
FormattingJavaFileObject
FormattingJavaFileObject(JavaFileObject delegate, Formatter formatter, @Nullable Messager messager) Create a newFormattingJavaFileObject.- Parameters:
delegate-JavaFileObjectto decoratemessager- to log messages with.
-
-
Method Details
-
openWriter
- Specified by:
openWriterin interfaceFileObject- Overrides:
openWriterin classForwardingFileObject<JavaFileObject>- Throws:
IOException
-