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

Examples of org.apache.myfaces.extensions.cdi.message.api.MessageInterpolator


        if (messageResolver != null)
        {
            message = resolveMessage(messageResolver, baseMessage);
        }

        MessageInterpolator messageInterpolator = this.messageContext.config().getMessageInterpolator();

        if (messageInterpolator != null && message != null)
        {
            return checkedResult(
                    interpolateMessage(messageInterpolator,
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

        if (messageResolver != null)
        {
            message = resolveMessage(messageResolver, baseMessage);
        }

        MessageInterpolator messageInterpolator = this.messageContext.config().getMessageInterpolator();

        if (messageInterpolator != null && message != null)
        {
            return checkedResult(
                    interpolateMessage(messageInterpolator,
View Full Code Here

TOP

Related Classes of org.apache.myfaces.extensions.cdi.message.api.MessageInterpolator

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.