Class EndpointModelPlugin
- All Implemented Interfaces:
Plugin
The model is assembled from the Java signatures the walk carries, so it keeps the type each value comes from. Whether a value can be absent is the one thing taken from what the other plugins say about it, since resolving it from the annotations, the Kotlin metadata and the defaults of the project is their work.
That is why the plugin belongs first in the chain, although it reads what the others write: a composite plugin enters its plugins in order and exits them in the opposite one, so the first plugin is the last to see a node it is done with. Anywhere else, the nullability of a value would be read before the plugins which decide it have run, and an annotated value would be written as one which can be absent.
The plugin only collects: every other plugin sees the walk as it would without it.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled on the way into a node, before the nodes below it are walked, which is where a plugin says what it knows about the node before anything below it is known.voidCalled on the way out of a node, once the nodes below it have been walked, which is where a plugin settles what depends on them.The endpoints built by the last run of the parser.The types the endpoints of the last run refer to, in the order the walk reached them.Everything the last run of the parser found, which is what one generation of TypeScript is written from.The polymorphic types of the last run, each with the subtypes a value of it can be.Methods inherited from class com.vaadin.hilla.parser.core.AbstractPlugin
getConfiguration, getParserConfig, setConfiguration, setParserConfigMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.hilla.parser.core.Plugin
getRequiredPlugins, resolve, scan
-
Constructor Details
-
EndpointModelPlugin
public EndpointModelPlugin()
-
-
Method Details
-
getGeneration
Everything the last run of the parser found, which is what one generation of TypeScript is written from. -
getEndpoints
The endpoints built by the last run of the parser. -
getEntities
The types the endpoints of the last run refer to, in the order the walk reached them. -
getUnions
The polymorphic types of the last run, each with the subtypes a value of it can be.A subtype accepting the discriminator of the subtypes below it is narrowed to its own value here, since a value of it would otherwise be a value of any of them as far as TypeScript is concerned. That is why the unions are built once the walk is over rather than while it runs: it is the subtypes which say what they accept.
-
enter
Description copied from interface:PluginCalled on the way into a node, before the nodes below it are walked, which is where a plugin says what it knows about the node before anything below it is known. A plugin which only says which nodes there are to walk has nothing to do here. -
exit
Description copied from interface:PluginCalled on the way out of a node, once the nodes below it have been walked, which is where a plugin settles what depends on them. A composite plugin exits its plugins in the opposite order to the one it enters them in.
-