Commons Digester
  1. Commons Digester
  2. DIGESTER-132

Add a CompoundSubstitutor to support more than one Substitutors at a time

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0
    • Labels:
      None

      Description

      At the moment only one Substitutor at a time is allowed to be set. If different classes configure the same Digester - for example due to subclassing - the set Substitutor may be overridden accidently. This can be easily avoided by using a CompoundSubstitutor which simply chains two Substitutors together - any input will be first handled by Substitutor A and then by Substitutor B.

      1. CompoundSubstitutorTest.java
        3 kB
        Tobias Demuth
      2. CompoundSubstitutor.java
        2 kB
        Tobias Demuth

        Activity

        Hide
        Tobias Demuth added a comment -

        A prototyp of CompoundSubstitutor and the related JUnit3-testcase.

        Show
        Tobias Demuth added a comment - A prototyp of CompoundSubstitutor and the related JUnit3-testcase.
        Hide
        Simone Tripodi added a comment -

        The idea of CompoundSubstitutor is really nice, I've just added it in the Digester3, see CompoundSubstitutor r1139046.
        The only thing I modified is that both Substitutors have to be not null, having the switch could be a subject of misunderstanding
        Thanks for your contribution!

        Show
        Simone Tripodi added a comment - The idea of CompoundSubstitutor is really nice, I've just added it in the Digester3, see CompoundSubstitutor r1139046 . The only thing I modified is that both Substitutors have to be not null, having the switch could be a subject of misunderstanding Thanks for your contribution!
        Hide
        Simone Tripodi added a comment -

        included in Apache Commons Digester 3.0 release

        Show
        Simone Tripodi added a comment - included in Apache Commons Digester 3.0 release

          People

          • Assignee:
            Simone Tripodi
            Reporter:
            Tobias Demuth
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development