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

Robert Muir commented on LUCENE-4896:
-------------------------------------

As i mentioned earlier i think PassageFormatter should be an abstract class 
(not an interface) with just that one method currently:

{code}
public String format(Passage passages[], String content);
{code}

But it might need a more complex API later, e.g. to support LUCENE-4906. So i 
think an abstract class is the right way to go (in addition to the reasons i 
mentioned in my first comment)

opening up the DefaultPassageFormatter looks good in the patch. i think making 
append protected is fine. In general though its just useful if someone wants to 
tweak the default implementation. if their impl is radically different they 
should just be extending PassageFormatter (the abstract one).

                
> PostingsHighlighter should use a interface of PassageFormatter instead of a 
> class
> ---------------------------------------------------------------------------------
>
>                 Key: LUCENE-4896
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4896
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/highlighter
>    Affects Versions: 4.2
>         Environment: NA
>            Reporter: Sebastien Dionne
>              Labels: newdev
>         Attachments: LUCENE-4896.patch
>
>
> In my project I need a custom PassageFormatter to use with 
> PostingsHighlighter.  I extended PassageFormatter  to override format(...)
> but if I do that, I don't have access to the private variables.  So instead 
> of changing the scope to protected, it should be more usefull to use a 
> interface for PassageFormatter.
> like public DefaultPassageFormatter implements PassageFormatter.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to