You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by "Gerhard Petracek (JIRA)" <ji...@apache.org> on 2013/12/10 09:41:07 UTC

[jira] [Commented] (DELTASPIKE-465) provide DefaultViewConfigInheritanceStrategy#addViewMetaData as protected method

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

Gerhard Petracek commented on DELTASPIKE-465:
---------------------------------------------

DefaultViewConfigInheritanceStrategy is an implementation detail, however, changes aren't expected -> if we provide
  protected void addViewMetaData(List<Annotation> result, Annotation annotation, Class<? extends Annotation> annotationClass)
users can use the following on their own risk:

{code}
    public class CustomViewConfigInheritanceStrategy extends DefaultViewConfigInheritanceStrategy
    {
        @Override
        protected void addViewMetaData(List<Annotation> result, Annotation annotation, Class<? extends Annotation> annotationClass)
        {
            if (annotationClass.isAnnotationPresent(ViewMetaData.class) &&
                !annotationClass.isAnnotationPresent(Stereotype.class))  //customized
            {
                result.add(annotation);
            }
            else if (annotationClass.isAnnotationPresent(Stereotype.class))
            {
                for (Annotation inheritedViaStereotype : annotationClass.getAnnotations())
                {
                    if (inheritedViaStereotype.annotationType().isAnnotationPresent(ViewMetaData.class))
                    {
                        result.add(inheritedViaStereotype);
                    }
                }
                result.add(annotation); //customized
            }
        }
    }
{code}

> provide DefaultViewConfigInheritanceStrategy#addViewMetaData as protected method
> --------------------------------------------------------------------------------
>
>                 Key: DELTASPIKE-465
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-465
>             Project: DeltaSpike
>          Issue Type: Improvement
>          Components: JSF-Module
>    Affects Versions: 0.5
>            Reporter: John Schneider
>            Assignee: Gerhard Petracek
>            Priority: Minor
>             Fix For: 0.6
>
>
> overriding DefaultViewConfigInheritanceStrategy#addViewMetaData allows to customize the default handling of stereotypes easily



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)