com.vaadin.flow.server.frontend.
Class FrontendWebComponentGenerator
- java.lang.Object
-
- com.vaadin.flow.server.frontend.FrontendWebComponentGenerator
-
All Implemented Interfaces:
public class FrontendWebComponentGenerator extends Object implements Serializable
Generates embeddable web component files in npm mode, hiding the complexity caused by using a different class loader. Uses
WebComponentModulesWriter
to generate web component modules files fromWebComponentExporter
orWebComponentExporterFactory
implementations found byClassFinder
.Since:
2.0
Author:
Vaadin Ltd.
See Also:
-
-
Constructor Summary
Constructors Constructor and Description FrontendWebComponentGenerator(ClassFinder finder)
Creates a new instances and stores the
finder
to be used for locatingWebComponentModulesWriter
andWebComponentExporter
/WebComponentExporterFactory
classes.
-
Method Summary
All Methods Modifier and Type Method and Description Set<File>
generateWebComponents(File outputDirectory)
Collects
WebComponentModulesWriter
class and classes that extendWebComponentExporter
/WebComponentExporterFactory
usingfinder
.
-
-
-
Constructor Detail
-
FrontendWebComponentGenerator
public FrontendWebComponentGenerator(ClassFinder finder)
Creates a new instances and stores the
finder
to be used for locatingWebComponentModulesWriter
andWebComponentExporter
/WebComponentExporterFactory
classes.Parameters:
finder
-ClassFinder
implementation
-
-
Method Detail
-
generateWebComponents
public Set<File> generateWebComponents(File outputDirectory)
Collects
WebComponentModulesWriter
class and classes that extendWebComponentExporter
/WebComponentExporterFactory
usingfinder
. Generates web component modules and places the into theoutputDirectory
.Parameters:
outputDirectory
- target directory for the web component module filesReturns:
generated files
Throws:
IllegalStateException
- iffinder
cannot locate required classes
-
-