.getAnnotationFor(getClass(), VaadinServletConfiguration.class);
if (configAnnotation != null) {
Method[] methods = VaadinServletConfiguration.class
.getDeclaredMethods();
for (Method method : methods) {
InitParameterName name = method
.getAnnotation(InitParameterName.class);
assert name != null : "All methods declared in VaadinServletConfiguration should have a @InitParameterName annotation";
try {
Object value = method.invoke(configAnnotation);
String stringValue;
if (value instanceof Class<?>) {
stringValue = ((Class<?>) value).getName();
} else {
stringValue = value.toString();
}
initParameters.setProperty(name.value(), stringValue);
} catch (Exception e) {
// This should never happen
throw new ServletException(
"Could not read @VaadinServletConfiguration value "
+ method.getName(), e);