// @formatter:off @Override public Configuration getConfiguration(GraphContext context) { AbstractIterationOperation<FileLocationModel> addTypeRefToList = new AbstractIterationOperation<FileLocationModel>() { @Override public void perform( GraphRewrite event, EvaluationContext context, FileLocationModel payload) { xmlFiles.add(payload); } }; return ConfigurationBuilder.begin() .addRule() .when( XmlFile.matchesXpath("/abc:beans") .namespace("abc", "http://www.springframework.org/schema/beans") .as("first")) .perform( Classification.as("Spring File") .and( Iteration.over("first") .when( XmlFile.from(Iteration.singleVariableIterationName("first")) .matchesXpath("//windupv1:file-gate") .namespace("windupv1", "http://www.jboss.org/schema/windup")) .perform(addTypeRefToList) .endIteration())); }
// @formatter:off @Override public Configuration getConfiguration(GraphContext context) { return ConfigurationBuilder.begin() .addRule() .when(Query.find(FileModel.class).withProperty(FileModel.IS_DIRECTORY, true)) .perform( Iteration.over(FileModel.class) .perform(new RecurseDirectoryAndAddFiles()) .endIteration()) .addRule() .when( Query.find(FileModel.class) .withProperty(FileModel.IS_DIRECTORY, false) .withProperty( FileModel.FILE_PATH, QueryPropertyComparisonType.REGEX, ZipUtil.getEndsWithZipRegularExpression())) .perform(Iteration.over().perform(new AddArchiveReferenceInformation()).endIteration()); }
@Override public Configuration getConfiguration(GraphContext arg0) { ConditionBuilder allProjects = Query.find(MavenProjectModel.class).as("projectModels"); AbstractIterationOperation<MavenProjectModel> setupParentModule = new AbstractIterationOperation<MavenProjectModel>(MavenProjectModel.class, "projectModel") { @Override public void perform( GraphRewrite event, EvaluationContext context, MavenProjectModel payload) { setMavenParentProject(payload); } }; return ConfigurationBuilder.begin() .addRule() .when(allProjects) .perform( Iteration.over("projectModels") .as("projectModel") .perform(setupParentModule) .endIteration()); }