[windup-dev] Shortening of iteration
Lincoln Baxter, III
lincolnbaxter at gmail.com
Wed Jan 28 12:30:15 EST 2015
There's already no need to use Iteration.over() anymore. It's implicit if
the operation passed in is an AbstractIterationOperation. We improved this
a few months ago :)
For example:
https://github.com/windup/windup/blob/master/rules-java/src/main/java/org/jboss/windup/rules/apps/java/scan/provider/IndexClassFilesRuleProvider.java#L47
public Configuration getConfiguration(GraphContext context) { return
ConfigurationBuilder.begin() .addRule() .when(Query.fromType(FileModel.
class) .withProperty(FileModel.IS_DIRECTORY, false) .withProperty(FileModel.
FILE_PATH, QueryPropertyComparisonType.REGEX, ".*\\.class") ) .perform( new
AddClassFileMetadata() .and(Commit.every(10)) .and(IterationProgress.
monitoring("Indexed class file: ", 1000)) ); }
On Tue, Jan 27, 2015 at 8:18 PM, Ondrej Zizka <ozizka at redhat.com> wrote:
> Hi all,
>
> could this
>
> .addRule()
> .when(Query.fromType(ArchiveModel.class))
> .perform(Iteration.over(ArchiveModel.class)
> .perform(new AbstractIterationOperation<ArchiveModel>()
> {
> @Override
> public void perform(GraphRewrite event,
> EvaluationContext evCtx, ArchiveModel arch)
> {
>
> be just
>
> .addRule()
> .perform(new IterationOver(ArchiveModel.class) {
> @Override
> public void perform(GraphRewrite event,
> EvaluationContext evCtx, ArchiveModel arch)
> {
>
> ?
> If it can ( a. principially, b. nobody objects), I could try coding it.
>
>
> Thanks,
> Ondra
> _______________________________________________
> windup-dev mailing list
> windup-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/windup-dev
>
--
Lincoln Baxter, III
http://ocpsoft.org
"Simpler is better."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/windup-dev/attachments/20150128/095224de/attachment-0001.html
More information about the windup-dev
mailing list