Package org.apache.myfaces.extensions.cdi.message.impl

Examples of org.apache.myfaces.extensions.cdi.message.impl.CompositeMessageInterpolator


    FacesMessageInterpolator(ELProvider elProvider, ArgumentFilter argumentFilter)
    {
        if(elProvider != null)
        {
            this.messageInterpolator = new CompositeMessageInterpolator(
                    new ELAwareMessageInterpolator(elProvider, argumentFilter),
                    new NumberedArgumentAwareMessageInterpolator());
        }
        else
        {
            this.messageInterpolator = new CompositeMessageInterpolator(
                    new NamedArgumentMessageInterpolator(),
                    new NumberedArgumentAwareMessageInterpolator());
        }
    }
View Full Code Here


    FacesMessageInterpolator(ELProvider elProvider, ArgumentFilter argumentFilter)
    {
        if(elProvider != null)
        {
            this.messageInterpolator = new CompositeMessageInterpolator(
                    new ELAwareMessageInterpolator(elProvider, argumentFilter),
                    new NumberedArgumentAwareMessageInterpolator());
        }
        else
        {
            this.messageInterpolator = new CompositeMessageInterpolator(
                    new NamedArgumentMessageInterpolator(),
                    new NumberedArgumentAwareMessageInterpolator());
        }
    }
View Full Code Here

    }

    @Test
    public void createNumberedArgumentAwareMessageTest()
    {
        MessageInterpolator messageInterpolator = new CompositeMessageInterpolator(createELAwareInterpolator(), new NumberedArgumentAwareMessageInterpolator());
        String messageText = this.messageContext.config().change().messageInterpolator(messageInterpolator).create()
                .message().text("\\{0} greets {1}")
                .argument("Gerhard", "Manfred").argument(new TestPerson()).toText();

        assertEquals("Gerhard greets Manfred", messageText);
View Full Code Here

    }

    @Test
    public void createMixedArgumentAwareMessageTest()
    {
        MessageInterpolator messageInterpolator = new CompositeMessageInterpolator(createELAwareInterpolator(), new NumberedArgumentAwareMessageInterpolator());
        String messageText = this.messageContext.config().change().messageInterpolator(messageInterpolator).create()
                .message().text("[hello] {0} and {firstName} ({1} and {lastName}) greet {person.name}")
                .argument("Gerhard", "Petracek")
                .namedArgument("person", new TestPerson())
                .namedArgument("lastName", "Geiler").namedArgument("firstName", "Manfred").toText();
View Full Code Here

    }

    @Test
    public void createMixedArgumentAwareMessageWithSimpleNamedArgumentMessageInterpolatorTest()
    {
        MessageInterpolator messageInterpolator = new CompositeMessageInterpolator(new NamedArgumentMessageInterpolator(), new NumberedArgumentAwareMessageInterpolator());
        String messageText = this.messageContext.config().change().messageInterpolator(messageInterpolator).create()
                .message().text("[hello] {0} and {firstName} ({1} and {lastName})")
                .argument("Gerhard", "Petracek")
                .namedArgument("person", new TestPerson())
                .namedArgument("firstName", "Manfred")
View Full Code Here

TOP

Related Classes of org.apache.myfaces.extensions.cdi.message.impl.CompositeMessageInterpolator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.