Package org.praxislive.ide.code.api
Interface ClassBodyWrapper.Filter
- Enclosing class:
ClassBodyWrapper
public static interface ClassBodyWrapper.Filter
A filter implementation can be used to override the default textual
output of the various sections of the class. All methods have a default
implementation that can be overridden or wrapped.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidwriteClassDeclaration(StringBuilder sb, String className, String extendedType, List<String> implementedTypes) Write the class declaration.default voidWrite the class ending (eg. closing brace).default voidwriteDefaultImports(StringBuilder sb, List<String> imports) Write the default imports.default voidwritePackage(StringBuilder sb, String packageName) Write the package declaration.default voidwriteSourceBody(StringBuilder sb, List<String> body) Write the actual source body.default voidwriteSourceImports(StringBuilder sb, List<String> imports) Write the import lines included in the source body.
-
Method Details
-
writePackage
Write the package declaration.- Parameters:
sb- StringBuilder to append to.packageName- package name to declare
-
writeDefaultImports
Write the default imports. These are the imports provided by the wrapper as opposed to those declared in the source body.Each import String does not include the keyword
importor the ending semicolon. It might contain the keywordstatic.- Parameters:
sb- StringBuilder to append to.imports- list of imports.
-
writeSourceImports
Write the import lines included in the source body. Each line is included as written, withimportand semicolon.- Parameters:
sb- StringBuilder to append to.imports- import lines
-
writeClassDeclaration
default void writeClassDeclaration(StringBuilder sb, String className, String extendedType, List<String> implementedTypes) Write the class declaration.- Parameters:
sb- StringBuilder to append to.className- name of the class.extendedType- name of the super class (may be null).implementedTypes- list of implemented interfaces.
-
writeSourceBody
Write the actual source body. Each line is as written, with anyimportandextendslines removed.- Parameters:
sb- StringBuilder to append to.body- lines of the source body.
-
writeClassEnding
Write the class ending (eg. closing brace).- Parameters:
sb- StringBuilder to append to.
-