Implementations produce a fully formatted string via get(), which is
then written to a PrintStream by the render methods. All built-in
components — such as Frame and Tree — implement this interface.
Example:
Component component = new Frame().nest("Hello");
component.render(); // prints to System.out
component.render(System.err); // prints to a specific stream
String raw = component.get(); // retrieve without printing
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: the rendered content; nevernullBuilds and returns the fully formatted string representation of this component. |
| public default void | |
| public default void | render(PrintStream
the stream to print to; must not be stream)nullPrints the rendered component to the given |
| get | back to summary |
|---|---|
| public String get() Builds and returns the fully formatted string representation of this component. Each call performs a full render — no caching is implied by this interface. Implementations may document their own caching behavior if applicable.
| |
| render | back to summary |
|---|---|
| public default void render() Prints the rendered component to Equivalent to | |
| render | back to summary |
|---|---|
| public default void render(PrintStream stream) Prints the rendered component to the given
| |