com.vaadin.flow.server.startup.
Class WebComponentExporterAwareValidator
- java.lang.Object
-
- com.vaadin.flow.server.startup.AbstractAnnotationValidator
-
- com.vaadin.flow.server.startup.WebComponentExporterAwareValidator
-
All Implemented Interfaces:
public class WebComponentExporterAwareValidator extends AbstractAnnotationValidator implements ClassLoaderAwareServletContainerInitializer
Checks that specific annotations are not configured wrong.
The validation is run during servlet container initialization.
Since:
2.0
Author:
Vaadin Ltd.
See Also:
-
-
Field Summary
-
Fields inherited from class com.vaadin.flow.server.startup.AbstractAnnotationValidator
ERROR_MESSAGE_BEGINNING, MIDDLE_ROUTER_LAYOUT, NON_PARENT, NON_PARENT_ALIAS, NON_ROUTER_LAYOUT
-
-
Constructor Summary
Constructors Constructor and Description WebComponentExporterAwareValidator()
-
Method Summary
All Methods Modifier and Type Method and Description List<Class<?>>
getAnnotations()
Gets the annotations that are subject to validate.
protected String
getErrorHint()
Returns a hint for the discovered validation errors.
protected Optional<String>
handleNonRouterLayout(Class<?> clazz)
Handles the
clazz
which is not a top level route and not a router layout.void
process(Set<Class<?>> classSet, ServletContext servletContext)
Implement this method instead of
ClassLoaderAwareServletContainerInitializer.onStartup(Set, ServletContext)
to handle classes accessible by different classloaders.-
Methods inherited from class com.vaadin.flow.server.startup.AbstractAnnotationValidator
getClassAnnotations, getClassAnnotations, validateClasses
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.flow.server.startup.ClassLoaderAwareServletContainerInitializer
onStartup
-
-
-
-
Method Detail
-
process
public void process(Set<Class<?>> classSet, ServletContext servletContext) throws ServletException
Description copied from interface:
ClassLoaderAwareServletContainerInitializer
Implement this method instead of
ClassLoaderAwareServletContainerInitializer.onStartup(Set, ServletContext)
to handle classes accessible by different classloaders.Specified by:
process
in interfaceClassLoaderAwareServletContainerInitializer
Parameters:
classSet
- the Set of application classes that extend, implement, or have been annotated with the class types specified by theHandlesTypes
annotation, or null if there are no matches, or this ServletContainerInitializer has not been annotated with HandlesTypesservletContext
- the ServletContext of the web application that is being started and in which the classes contained in c were foundThrows:
ServletException
- if an error has occurredSee Also:
ClassLoaderAwareServletContainerInitializer.onStartup(Set, ServletContext)
-
handleNonRouterLayout
protected Optional<String> handleNonRouterLayout(Class<?> clazz)
Description copied from class:
AbstractAnnotationValidator
Handles the
clazz
which is not a top level route and not a router layout. Returns an optional message which describes the error having an annotation for the class.Overrides:
handleNonRouterLayout
in classAbstractAnnotationValidator
Parameters:
clazz
- class to validate annotationsReturns:
an optional error message or empty if there is no error
-
getErrorHint
protected String getErrorHint()
Description copied from class:
AbstractAnnotationValidator
Returns a hint for the discovered validation errors.
Overrides:
getErrorHint
in classAbstractAnnotationValidator
Returns:
the error hint
-
getAnnotations
public List<Class<?>> getAnnotations()
Description copied from class:
AbstractAnnotationValidator
Gets the annotations that are subject to validate.
Specified by:
getAnnotations
in classAbstractAnnotationValidator
Returns:
a list of target annotations
-
-