You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by "Colm O hEigeartaigh (Jira)" <ji...@apache.org> on 2021/11/12 09:35:00 UTC

[jira] [Closed] (SANTUARIO-554) Use Class parameter instead of Object when defining OutputProcessor's "before" and "after"

     [ https://issues.apache.org/jira/browse/SANTUARIO-554?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Colm O hEigeartaigh closed SANTUARIO-554.
-----------------------------------------

> Use Class parameter instead of Object when defining OutputProcessor's "before" and "after"
> ------------------------------------------------------------------------------------------
>
>                 Key: SANTUARIO-554
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-554
>             Project: Santuario
>          Issue Type: Improvement
>          Components: Java
>    Affects Versions: Java 2.2.0
>            Reporter: Peter De Maeyer
>            Assignee: Colm O hEigeartaigh
>            Priority: Major
>             Fix For: Java 2.3.0
>
>
> 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.
> # Referring to other output processor _classes_ makes sense, that is why the only usages in practice use {{Strings}} denoting class names.
> # 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.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)