You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Simone Tripodi (JIRA)" <ji...@apache.org> on 2011/06/27 02:51:47 UTC

[jira] [Commented] (DIGESTER-95) [digester][PATCH] Support for evaluating a predicate when determining if a rule is valid for a given element

    [ https://issues.apache.org/jira/browse/DIGESTER-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055254#comment-13055254 ] 

Simone Tripodi commented on DIGESTER-95:
----------------------------------------

Very interesting idea indeed!
In Digester3 I modified the {{Rules}} interface in order to get in the {{match()}} method as input also the current element {{name}} and the {{attributes}}, so instead of modifying the Digester core code, like in the provided patch, that feature could be provided in a custom {{Rules}} implementation.
See [r1139976|http://svn.apache.org/viewvc?view=revision&revision=1139976]

> [digester][PATCH] Support for evaluating a predicate when determining if a rule is valid for a given element
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: DIGESTER-95
>                 URL: https://issues.apache.org/jira/browse/DIGESTER-95
>             Project: Commons Digester
>          Issue Type: Improvement
>         Environment: Operating System: All
> Platform: All
>            Reporter: Marcus Crafter
>            Priority: Minor
>         Attachments: digester.patch, digester.patch, example.java
>
>
> Hi There,
> Hope all is going well.
> Attached is a patch that adds support for evaluating a Commons Collections
> Predicate object when matching rules to elements, rather than relying on string
> comparison of the elements path.
> This lets one write an arbitrary Predicate implementation (associated with a
> rule) that can check details from the elements name, namespace and attributes
> before notifying digester that the particular rule matches the element node
> being tested.
> I've tested this enhancement to perform attribute value matching, etc, but it
> should open up the rule evaluation section of digester to allow any arbitrary
> comparison (given enough context information).
> I'm definitely a digester novice, but I couldn't see this functionality
> beforehand - I'm happy to change any/all of the patch if there's a better way.
> Looking forward to your comments.
> Cheers,
> Marcus

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira