/** * Perform the given {@link Operation} when the conditions set in this {@link Rule} are met. */ public RuleBuilder perform(final Operation operation) { if (this.operation == null) this.operation = operation; else if (operation instanceof OperationBuilder) this.operation = ((OperationBuilder) this.operation).and(operation); else this.operation = Operations.wrap(this.operation).and(operation); return this; }
/** * Perform the given {@link Operation} when the conditions set in this {@link Rule} are met. */ public RuleBuilder perform(final Operation operation) { if (this.operation == null) this.operation = operation; else if (operation instanceof OperationBuilder) this.operation = ((OperationBuilder) this.operation).and(operation); else this.operation = Operations.wrap(this.operation).and(operation); return this; }
@Override public Operation processElement(ParserContext handlerManager, Element element) throws ConfigurationException { OperationBuilder result = Operations.create(); List<Element> children = $(element).children().get(); for (Element child : children) { Operation operation = handlerManager.processElement(child); result = result.and(operation); } return result; } }
@Override public Operation processElement(ParserContext handlerManager, Element element) throws ConfigurationException { OperationBuilder result = Operations.create(); List<Element> children = $(element).children().get(); for (Element child : children) { Operation operation = handlerManager.processElement(child); result = result.and(operation); } return result; } }
@Override public Operation processElement(ParserContext handlerManager, Element element) throws ConfigurationException { OperationBuilder result = Operations.create(); List<Element> children = $(element).children().get(); for (Element child : children) { Operation operation = handlerManager.processElement(child); result = result.and(operation); } return result; } }
@Override public Configuration getConfiguration(GraphContext context) { return ConfigurationBuilder.begin() .addRule() .when(Query.fromType(JavaSourceFileModel.class)) .perform(new ParseSourceOperation() .and(IterationProgress.monitoring("Analyzed Java File: ", 250)) .and(Commit.every(10))); } // @formatter:on
@Override public Configuration getConfiguration(RuleLoaderContext ruleLoaderContext) { return ConfigurationBuilder.begin() .addRule() .when(Query.fromType(JavaSourceFileModel.class)) .perform(new IndexJavaFileIterationOperator() .and(Commit.every(100)) .and(IterationProgress.monitoring("Index Java Source Files", 250))); }
@Override public Configuration getConfiguration(RuleLoaderContext ruleLoaderContext) { return ConfigurationBuilder.begin() .addRule() .when(Query.fromType(FileModel.class)) .perform(new CacheFileModelPrettyPathRuleProvider.GetPrettyPathIterationOperator() .and(Commit.every(5000)) .and(IterationProgress.monitoring("Caching FileModel Path Information", 2000))); }
@Override public Configuration getConfiguration(RuleLoaderContext ruleLoaderContext) { return ConfigurationBuilder.begin() .addRule() .when(Query.fromType(JavaSourceFileModel.class)) .perform(new IndexJavaFileIterationOperator() .and(Commit.every(100)) .and(IterationProgress.monitoring("Index Java Source Files", 250))); }
@Override public Configuration getConfiguration(RuleLoaderContext ruleLoaderContext) { return ConfigurationBuilder.begin() .addRule() .when(Query.fromType(FileModel.class)) .perform(new CacheFileModelPrettyPathRuleProvider.GetPrettyPathIterationOperator() .and(Commit.every(5000)) .and(IterationProgress.monitoring("Caching FileModel Path Information", 2000))); }
public Configuration getConfiguration(ServletContext context) { if (!ContextUtil.getInitParamBoolean(context, DISABLED_PARAM)) { if (log.isDebugEnabled()) log.debug(DISABLED_PARAM + " [false]"); if (config == null) { String contextPath = context.getContextPath(); if (contextPath == null || contextPath.isEmpty()) contextPath = "/"; config = ConfigurationBuilder .begin() .addRule() .perform(Response .addCookie(new Cookie("org.ocpsoft.rewrite.gwt.history.contextPath", contextPath))) .addRule() .when(Method.isHead().and( Query.parameterExists("org.ocpsoft.rewrite.gwt.history.contextPath"))) .perform(Response.setStatus(200).and( Response.addHeader("org.ocpsoft.rewrite.gwt.history.contextPath", contextPath))); } } return config; }
public Configuration getConfiguration(ServletContext context) { if (!ContextUtil.getInitParamBoolean(context, DISABLED_PARAM)) { if (log.isDebugEnabled()) log.debug(DISABLED_PARAM + " [false]"); if (config == null) { String contextPath = context.getContextPath(); if (contextPath == null || contextPath.isEmpty()) contextPath = "/"; config = ConfigurationBuilder .begin() .addRule() .perform(Response .addCookie(new Cookie("org.ocpsoft.rewrite.gwt.history.contextPath", contextPath))) .addRule() .when(Method.isHead().and( Query.parameterExists("org.ocpsoft.rewrite.gwt.history.contextPath"))) .perform(Response.setStatus(200).and( Response.addHeader("org.ocpsoft.rewrite.gwt.history.contextPath", contextPath))); } } return config; }
@Override public Configuration getConfiguration(GraphContext context) { return ConfigurationBuilder.begin() .addRule() .when(Query.fromType(JavaClassFileModel.class)) .perform( new AddClassFileMetadata() .and(Commit.every(10)) .and(IterationProgress.monitoring("Indexed class file: ", 1000)) ); } // @formatter:on
@Override public Configuration getConfiguration(GraphContext context) { return ConfigurationBuilder.begin().addRule() .when(Query.fromType(ArchiveModel.class).excludingType(IgnoredArchiveModel.class)) .perform(UnzipArchiveToOutputFolder.unzip() .and(IterationProgress.monitoring("Unzipped archive: ", 1)) .and(Commit.every(1)) ); } }
@Override public Configuration getConfiguration(GraphContext context) { QueryGremlinCriterion shouldDecompileCriterion = new ShouldDecompileCriterion(); return ConfigurationBuilder.begin() .addRule() .when(Query.fromType(ArchiveModel.class).piped(shouldDecompileCriterion)) .perform( new ProcyonDecompilerOperation() .and(IterationProgress.monitoring("Decompiled archive: ", 1)) .and(Commit.every(1)) ) .otherwise(Log.message(Level.WARN, "No archives to decompile.")); } // @formatter:on