Package software.amazon.smithy.utils
Interface CodeInterceptor.Prepender<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.Prepender<S extends CodeSection,W extends AbstractCodeWriter<W>> extends CodeInterceptor<S,W>
A code section interceptor that adds text before the intercepted section.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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidprepend(W writer, S section)Writes text before previously written content in the section.default voidwrite(W writer, java.lang.String previousText, S section)Intercepts anAbstractCodeWritersection.- 
Methods inherited from interface software.amazon.smithy.utils.CodeInterceptor
isIntercepted, sectionType 
 - 
 
 - 
 
- 
- 
Method Detail
- 
write
default void write(W writer, java.lang.String previousText, S section)
Description copied from interface:CodeInterceptorIntercepts anAbstractCodeWritersection.- Specified by:
 writein 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.
 
 - 
 
 -