@Override public boolean matches(ClassNode classNode) { return AstUtils.hasAtLeastOneAnnotation(classNode, "EnableIntegration") || AstUtils.hasAtLeastOneAnnotation(classNode, "MessageEndpoint"); }
/** * Extract a top-level <code>beans{}</code> closure from inside this block if * there is one. Removes it from the block at the same time. * @param block a block statement (class definition) * @return a beans Closure if one can be found, null otherwise */ private ClosureExpression beans(BlockStatement block) { return AstUtils.getClosure(block, BEANS, true); }
@Override public boolean matches(ClassNode classNode) { return AstUtils.hasAtLeastOneFieldOrMethod(classNode, "JdbcTemplate", "NamedParameterJdbcTemplate", "DataSource"); }
@Override public boolean matches(ClassNode classNode) { return AstUtils.hasAtLeastOneInterface(classNode, SOURCE_INTERFACE) || AstUtils.hasAtLeastOneAnnotation(classNode, "EnableRatpack"); }
/** * Extract a top-level {@code name} closure from inside this block if there is one, * optionally removing it from the block at the same time. * @param block a block statement (class definition) * @param name the name to look for * @param remove whether or not the extracted closure should be removed * @return a beans Closure if one can be found, null otherwise */ public static ClosureExpression getClosure(BlockStatement block, String name, boolean remove) { for (ExpressionStatement statement : getExpressionStatements(block)) { Expression expression = statement.getExpression(); if (expression instanceof MethodCallExpression) { ClosureExpression closure = getClosure(name, (MethodCallExpression) expression); if (closure != null) { if (remove) { block.getStatements().remove(statement); } return closure; } } } return null; }
@Override public boolean matches(ClassNode classNode) { return AstUtils.hasAtLeastOneAnnotation(classNode, "EnableJms") || AstUtils.hasAtLeastOneAnnotation(classNode, "EnableJmsMessaging"); }
/** * Extract a top-level <code>ratpack{}</code> closure from inside this block if * there is one. Removes it from the block at the same time. * @param block a block statement (class definition) * @return a beans Closure if one can be found, null otherwise */ private ClosureExpression ratpack(BlockStatement block) { return AstUtils.getClosure(block, RATPACK, true); } }
@Override public boolean matches(ClassNode classNode) { return AstUtils.hasAtLeastOneAnnotation(classNode, "EnableWebSocket", "EnableWebSocketMessageBroker"); }
public static ClosureExpression getClosure(BlockStatement block, String name) { return getClosure(block, name, false); }
@Override public boolean matches(ClassNode classNode) { return AstUtils.hasAtLeastOneAnnotation(classNode, "EnableRetry", "Retryable", "Recover"); }
@Override public boolean matches(ClassNode classNode) { return AstUtils.hasAtLeastOneAnnotation(classNode, "Controller", "RestController", "EnableWebMvc"); }
@Override public boolean matches(ClassNode classNode) { return AstUtils.hasAtLeastOneAnnotation(classNode, "EnableRabbit") || AstUtils.hasAtLeastOneAnnotation(classNode, "EnableRabbitMessaging"); }
@Override public boolean matches(ClassNode classNode) { return AstUtils.hasAtLeastOneAnnotation(classNode, "EnableWebSecurity", "EnableGlobalMethodSecurity"); }
@Override public boolean matches(ClassNode classNode) { return AstUtils.hasAtLeastOneAnnotation(classNode, "EnableGroovyTemplates"); }
@Override public boolean matches(ClassNode classNode) { return AstUtils.hasAtLeastOneAnnotation(classNode, "EnableTransactionManagement"); }
@Override public boolean matches(ClassNode classNode) { return AstUtils.hasAtLeastOneAnnotation(classNode, "RibbonClient"); }
@Override public boolean matches(ClassNode classNode) { return AstUtils.hasAtLeastOneAnnotation(classNode, "EnableDiscoveryClient"); }
@Override public boolean matches(ClassNode classNode) { return AstUtils.hasAtLeastOneAnnotation(classNode, "EnableCaching"); }
@Override public boolean matches(ClassNode classNode) { return AstUtils.hasAtLeastOneAnnotation(classNode, "EnableBatchProcessing"); }
@Override public boolean matches(ClassNode classNode) { return AstUtils.hasAtLeastOneAnnotation(classNode, "SpringBootTest"); }