int modifiers = method.getModifiers();
if (method.getParameterTypes().length != 0
|| !Modifier.isStatic(modifiers)
|| !Modifier.isPublic(modifiers)) {
throw new InitializationError(
String.format("@ModuleDef method %s must be public static and accept no arguments",
method.getName()));
}
if (!org.apache.tapestry5.ioc.def.ModuleDef.class.isAssignableFrom(method.getReturnType())) {
throw new InitializationError(
String.format("@ModuleDef method %s return type %s is not valid",
method.getName(), method.getReturnType().getName()));
}
}