public interface MessageInterfaceVisitor
The general calling sequence of methods on this visitor and sub-visitors should be, for example, for the following interface:
interface Foo extends Messages { @DefaultMessage("0") @AlternateMessage({ "one|MALE", "2", "one|FEMALE", "1", "one|other", "3", "other|FEMALE", "4", "other|MALE", "5", }) String foo(@PluralCount int count, String where, Gender gender); }the following sequence of calls would be generated:
MessageInterfaceVisitor miv; miv.visitMessageInterface(msgInf, locale); MessageVisitor mv = miv.visitMessage(msg, msgTrans); mv.visitTranslation(["one", "FEMALE"], false, msgStyle, "1"); mv.visitTranslation(["one", "MALE"], false, msgStyle, "2");} mv.visitTranslation(["one", "other"], false, msgStyle, "3"); mv.visitTranslation(["other", "FEMALE"], false, msgStyle, "4"); mv.visitTranslation(["other", "MALE"], false, msgStyle, "5"); mv.visitTranslation(["other", "other"], true, msgStyle, "0"); mv.endMessage(msg); miv.endMessageInterface(msgIntf);Visitors that are interested in knowing when particular selectors and their form values begin/end should see
FormVisitorDriver
.Modifier and Type | Method and Description |
---|---|
void |
endMessageInterface(MessageInterface msgIntf)
Called after processing a message interface is complete.
|
MessageVisitor |
visitMessage(Message msg,
MessageTranslation trans)
Visit a single message in the current
MessageInterface . |
void |
visitMessageInterface(MessageInterface msgIntf,
GwtLocale sourceLocale)
Called at the start of processing a new message interface.
|
void endMessageInterface(MessageInterface msgIntf) throws MessageProcessingException
msgIntf
- MessageProcessingException
MessageVisitor visitMessage(Message msg, MessageTranslation trans) throws MessageProcessingException
MessageInterface
.MessageVisitor
instance which will be used to visit the
supplied message, or null if no visit is requiredMessageProcessingException
void visitMessageInterface(MessageInterface msgIntf, GwtLocale sourceLocale) throws MessageProcessingException
msgIntf
- sourceLocale
- the locale of source messages in this classMessageProcessingException
Copyright © 2018. All rights reserved.