public sealed interface Gizmo
A simplified class file writer.
-
Method Summary
Modifier and TypeMethodDescriptionclass_(ClassDesc desc, Consumer<ClassCreator> builder) Add a new class.default ClassDescclass_(String name, Consumer<ClassCreator> builder) Add a new class.static Gizmocreate(ClassOutput outputHandler) Returns a new Gizmo which outputs to the given handler by default.interface_(ClassDesc desc, Consumer<InterfaceCreator> builder) Add a new interface.default ClassDescinterface_(String name, Consumer<InterfaceCreator> builder) Add a new interface.withDefaultModifiers(Consumer<ModifierConfigurator> builder) Returns a Gizmo instance which uses the default modifiers configured by the given configurator.withOutput(ClassOutput outputHandler) Returns a Gizmo instance which uses the given output handler.
-
Method Details
-
create
Returns a new Gizmo which outputs to the given handler by default.- Parameters:
outputHandler- the output handler (must not benull)- Returns:
- a new Gizmo which outputs to the given handler by default
-
withOutput
Returns a Gizmo instance which uses the given output handler.- Parameters:
outputHandler- the output handler (must not benull)- Returns:
- a Gizmo instance which uses the given output handler
-
withDefaultModifiers
Returns a Gizmo instance which uses the default modifiers configured by the given configurator.- Parameters:
builder- the builder for the defaults (must not benull)- Returns:
- a Gizmo instance which uses the default modifiers configured by the given configurator
-
class_
Add a new class.- Parameters:
name- the fully qualified (dot-separated) binary class name (must not benull)builder- the builder for the class (must not benull)- Returns:
- the descriptor of the created class (not
null)
-
class_
Add a new class.- Parameters:
desc- the class descriptor (must not benull)builder- the builder for the class (must not benull)- Returns:
- the descriptor given for
desc
-
interface_
Add a new interface.- Parameters:
name- the fully qualified (dot-separated) binary class namebuilder- the builder for the interface (must not benull)- Returns:
- the descriptor of the created interface (not
null)
-
interface_
Add a new interface.- Parameters:
desc- the class descriptor (must not benull)builder- the builder for the class (must not benull)- Returns:
- the descriptor given for
desc
-