Package com.vaadin.flow.js.internal
Class JsDefinitionImports
java.lang.Object
com.vaadin.flow.js.internal.JsDefinitionImports
- All Implemented Interfaces:
Serializable
Reads the
JsDefinitionImport annotations of an interface into the
modules its JavaScript imports from, which both the build, generating the
functions, and the server, computing their identifiers, go by.
For internal use only. May be renamed or removed in any release.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA name an expression is given from a module.static final recordA module that an interface imports from, with every name it is given from it, merged from all the annotations that name the module. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringWhat the generated function of a method annotated withJsWithExecutionContextnames the execution context, which an imported name would hide. -
Method Summary
Modifier and TypeMethodDescriptionstatic List<JsDefinitionImports.ModuleImport> Gets the modules the given interface declares imports from, ordered by module, so that the same declarations always give the same function.static List<JsDefinitionImports.Binding> collectBindings(JsDefinitionImport annotation) Gets the names the given annotation declares, in the order of animportstatement: the default export, the named exports and then the whole module.static Stringdescribe(List<JsDefinitionImports.ModuleImport> imports) Describes the given imports as text that is hashed into the identifier of a function, so that two methods declaring the same JavaScript with different imports are different functions.
-
Field Details
-
EXECUTION_CONTEXT
What the generated function of a method annotated withJsWithExecutionContextnames the execution context, which an imported name would hide.- See Also:
-
-
Method Details
-
collect
Gets the modules the given interface declares imports from, ordered by module, so that the same declarations always give the same function. Only the annotations of the type itself count, as annotations on an interface are not inherited.- Parameters:
type- the interface, notnull- Returns:
- the modules, empty when the interface imports nothing
-
collectBindings
Gets the names the given annotation declares, in the order of animportstatement: the default export, the named exports and then the whole module.- Parameters:
annotation- the annotation, notnull- Returns:
- the names, empty when the annotation declares none
-
describe
Describes the given imports as text that is hashed into the identifier of a function, so that two methods declaring the same JavaScript with different imports are different functions.- Parameters:
imports- the imports, ascollect(Class)gets them, notnull- Returns:
- the description, empty when there are no imports
-