Interface EmitterContext
public interface EmitterContext
What an emitter is given to write one contract's classes.
-
Method Summary
Modifier and TypeMethodDescriptionRecords that a generated method cannot represent a construct, and returns the statement its body consists of instead: one that throwsUnsupportedOperationExceptionwith the reason and, where there is one, the remedy.model()The contract.names()The core classes, whose names an emitter's companions follow.settings()How the project has asked for the classes to be generated.voidWrites one Java source file, replacing any file already written for that class in this run.
-
Method Details
-
model
ContractModel model()The contract.- Returns:
- the model
-
settings
Settings settings()How the project has asked for the classes to be generated.- Returns:
- the settings
-
names
ClassNames names()The core classes, whose names an emitter's companions follow.- Returns:
- the class names
-
writeJava
Writes one Java source file, replacing any file already written for that class in this run.- Parameters:
packageName- the packagesimpleName- the class's simple namesource- the whole compilation unit
-
degraded
Records that a generated method cannot represent a construct, and returns the statement its body consists of instead: one that throwsUnsupportedOperationExceptionwith the reason and, where there is one, the remedy. Every degraded method is reported at the end of generation.- Parameters:
className- the simple name of the class the method is inmethod- the method, as a reader would name it, such asbody(String)finding- the construct it cannot represent- Returns:
- a Java statement, without indentation
-