Package software.amazon.smithy.utils
Interface CodeInterceptor.Appender<S extends CodeSection,W extends AbstractCodeWriter<W>>
- Type Parameters:
S
- The type of section to intercept.W
- The type of code writer.
- All Superinterfaces:
CodeInterceptor<S,
W>
- Enclosing interface:
- CodeInterceptor<S extends CodeSection,
W extends AbstractCodeWriter<W>>
public static interface CodeInterceptor.Appender<S extends CodeSection,W extends AbstractCodeWriter<W>>
extends CodeInterceptor<S,W>
A code section interceptor that adds text after the intercepted section.
The previously written text is written before append(AbstractCodeWriter, CodeSection)
is called. The previously written text is only included if it's a non-empty string.
-
Nested Class Summary
Nested classes/interfaces inherited from interface software.amazon.smithy.utils.CodeInterceptor
CodeInterceptor.Appender<S extends CodeSection,
W extends AbstractCodeWriter<W>>, CodeInterceptor.Prepender<S extends CodeSection, W extends AbstractCodeWriter<W>> -
Method Summary
Methods inherited from interface software.amazon.smithy.utils.CodeInterceptor
isIntercepted, sectionType
-
Method Details
-
write
Description copied from interface:CodeInterceptor
Intercepts anAbstractCodeWriter
section.- Specified by:
write
in interfaceCodeInterceptor<S extends CodeSection,
W extends AbstractCodeWriter<W>> - Parameters:
writer
- Writer used to write content. If no write calls are made, any intercepted text is lost.previousText
- The previous text that was written. This text needs to be written again in order for it to be kept in the section.section
- The strongly typed section value.
-
append
Writes text after previous content in the section.- Parameters:
writer
- The code writer to write to.section
- The section being intercepted.
-