public class MessagesWriter extends Object
Constructor and Description |
---|
MessagesWriter(com.google.gwt.core.ext.typeinfo.TypeOracle oracle,
String nameSpaceUri,
MortalLogger mortalLogger,
String generatedFrom,
String packageName,
String uiBinderImplClassName) |
Modifier and Type | Method and Description |
---|---|
void |
consumeAndStoreMessageAttributesFor(XMLElement elem)
Call
consumeAttributeMessages(com.google.gwt.uibinder.rebind.XMLElement) , but instead of returning the
results store them for retrieval by a later call to
retrieveMessageAttributesFor(com.google.gwt.uibinder.rebind.XMLElement) . |
Collection<AttributeMessage> |
consumeAttributeMessages(XMLElement elem)
Examine the children of the given element.
|
String |
consumeMessageAttribute(String attName,
XMLElement elem)
Consume an m:blah attribute on a non-message element, e.g.
|
String |
consumeMessageAttribute(String attName,
XMLElement elem,
String defaultValue)
Consume an m:blah attribute on a non-message element, e.g.
|
String |
declareMessage(MessageWriter newMessage)
Declares a message created by a previous call to
newMessage(com.google.gwt.uibinder.rebind.XMLElement) , and
returns its invocation expression to be stitched into an innerHTML block. |
void |
findMessagesConfig(XMLElement elem)
Expected to be called with the root element, to allow configuration from
various messages related attributes.
|
String |
getDeclaration()
Returns the expression that will instantiate the Messages interface.
|
String |
getMessagesClassName() |
String |
getMessagesPrefix()
Returns the namespace prefix (not including :) declared by the template for
message elements and attributes.
|
boolean |
hasMessageAttribute(String attName,
XMLElement elem)
Confirm existence of an m:blah attribute on a non-message element, e.g.
|
boolean |
hasMessages()
Returns true iff any messages have been declared.
|
boolean |
isMessage(XMLElement elem) |
MessageWriter |
newMessage(XMLElement elem)
Creates a new MessageWriter instance with description, key and meaning
values consumed from the given XMLElement.
|
Collection<AttributeMessage> |
retrieveMessageAttributesFor(XMLElement elem)
Returns the set of AttributeMessages that were found in elem and stored by a
previous call to
consumeAndStoreMessageAttributesFor(com.google.gwt.uibinder.rebind.XMLElement) . |
void |
write(PrintWriter printWriter) |
public static final String ATTRIBUTE
public MessagesWriter(com.google.gwt.core.ext.typeinfo.TypeOracle oracle, String nameSpaceUri, MortalLogger mortalLogger, String generatedFrom, String packageName, String uiBinderImplClassName)
public void consumeAndStoreMessageAttributesFor(XMLElement elem) throws com.google.gwt.core.ext.UnableToCompleteException
consumeAttributeMessages(com.google.gwt.uibinder.rebind.XMLElement)
, but instead of returning the
results store them for retrieval by a later call to
retrieveMessageAttributesFor(com.google.gwt.uibinder.rebind.XMLElement)
.com.google.gwt.core.ext.UnableToCompleteException
- on errorpublic Collection<AttributeMessage> consumeAttributeMessages(XMLElement elem) throws com.google.gwt.core.ext.UnableToCompleteException
AttributeMessage
instances. E.g.:
<img src="blueSky.jpg" alt="A blue sky"> <ui:attribute name="alt" description="blue sky image alt text"/> </img>
com.google.gwt.core.ext.UnableToCompleteException
public String consumeMessageAttribute(String attName, XMLElement elem)
<span m:ph="fnord"/>
attName
- name of the attribute (to be prefixed with "msgprefix:")elem
- element to searchpublic String consumeMessageAttribute(String attName, XMLElement elem, String defaultValue)
<span m:ph="fnord"/>
attName
- name of the attribute (to be prefixed with "msgprefix:")elem
- element to searchdefaultValue
- default value to return if the attribute is not presentdefaultValue
if not foundpublic String declareMessage(MessageWriter newMessage)
newMessage(com.google.gwt.uibinder.rebind.XMLElement)
, and
returns its invocation expression to be stitched into an innerHTML block.public void findMessagesConfig(XMLElement elem) throws com.google.gwt.core.ext.UnableToCompleteException
com.google.gwt.core.ext.UnableToCompleteException
public String getDeclaration()
public String getMessagesClassName()
public String getMessagesPrefix()
public boolean hasMessageAttribute(String attName, XMLElement elem)
<span ui:ph="fnord"/>
public boolean hasMessages()
public boolean isMessage(XMLElement elem)
public MessageWriter newMessage(XMLElement elem)
declareMessage(MessageWriter)
public Collection<AttributeMessage> retrieveMessageAttributesFor(XMLElement elem)
consumeAndStoreMessageAttributesFor(com.google.gwt.uibinder.rebind.XMLElement)
.public void write(PrintWriter printWriter)
Copyright © 2016. All rights reserved.