Uploaded image for project: 'Santuario'
  1. Santuario
  2. SANTUARIO-554

Use Class parameter instead of Object when defining OutputProcessor's "before" and "after"

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Java 2.2.0
    • Java 2.3.0
    • Java
    • None

    Description

      As a developer, I want to pass a Class parameter to OutputProcessor.addBefore/AfterProcessor, so that I don't have to guess the semantics of the parameter (currently Object).

      OutputProcessor.addBeforeProcessor and OutputProcessor.addAfterProcessor take an Object argument.
      One has to guess/know the implementation of OutputProcessorChainImpl.addProcessor to use it correctly: the Object must either be an OutputProcessor (instance) or a String denoting an output processor's class name.

      1. Referring to other output processor classes makes sense, that is why the only usages in practice use Strings denoting class names.
      2. Referring to other instances of output processors does not make much sense in practice. It would mean that when defining an output processor, you would need access to all other output processor instances in order to be able to define your own

      It would more intuitive and explicit for users to use Class<? extends OutputProcessor> as parameter.
      That would also eliminate the need to chain a getName() call to every getClass() call.

      Attachments

        Issue Links

          Activity

            People

              coheigea Colm O hEigeartaigh
              peterdm Peter De Maeyer
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: