Interface UseShapeWriterObserver<T extends CodegenWriter<T,​?>>

  • Type Parameters:
    T - Type of CodegenWriter being used.
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface UseShapeWriterObserver<T extends CodegenWriter<T,​?>>
    An observer invoked when a shape CodegenWriter is used.

    The following example defines a UseShapeWriterObserver that writes a comment before a shape is written:

    
     public final class MyObserver implements UseShapeWriterObserver<MyWriter> {
         \@Override
         public void observe(Shape shape, Symbol symbol, SymbolProvider symbolProvider, MyWriter writer) {
             writer.write("/// Writing $L", shape.getId());
         }
     }