public class SafeUriAttributeParser extends StrictAttributeParser
SafeUri
literals or
references.
Simple String literals are passed through
UriUtils.fromConstantString(String)
Accepts concatenated string expressions, mainly for compatibility with legacy
<a href="{foo.bar}{baz.bang}">
abuses. Passes such nonsense
through UriUtils.fromString(String)
StrictAttributeParser.FieldReferenceDelegate
logger
Constructor and Description |
---|
SafeUriAttributeParser(StringAttributeParser stringParser,
FieldReferenceConverter converter,
JType safeUriType,
JType stringType,
com.google.gwt.uibinder.rebind.MortalLogger logger)
Constructs an instance for particular use in html contexts, where
{string.references} are acceptible.
|
SafeUriAttributeParser(StringAttributeParser stringParser,
FieldReferenceConverter converter,
JType safeUriType,
com.google.gwt.uibinder.rebind.MortalLogger logger)
Constructs an instance for normal use, where String literals are okay but
{string.references} are not.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
parse(com.google.gwt.uibinder.rebind.XMLElement source,
java.lang.String value)
If the value holds a single field reference "{like.this}", converts it to a
Java Expression.
|
static java.lang.String |
wrapUnsafeStringAndWarn(com.google.gwt.uibinder.rebind.MortalLogger logger,
com.google.gwt.uibinder.rebind.XMLElement source,
java.lang.String expression) |
SafeUriAttributeParser(StringAttributeParser stringParser, FieldReferenceConverter converter, JType safeUriType, JType stringType, com.google.gwt.uibinder.rebind.MortalLogger logger)
SafeUriAttributeParser(StringAttributeParser stringParser, FieldReferenceConverter converter, JType safeUriType, com.google.gwt.uibinder.rebind.MortalLogger logger)
public static java.lang.String wrapUnsafeStringAndWarn(com.google.gwt.uibinder.rebind.MortalLogger logger, com.google.gwt.uibinder.rebind.XMLElement source, java.lang.String expression)
public java.lang.String parse(com.google.gwt.uibinder.rebind.XMLElement source, java.lang.String value) throws UnableToCompleteException
StrictAttributeParser
In any other case (e.g. more than one field reference), an UnableToCompleteException is thrown.
parse
in interface AttributeParser
parse
in class StrictAttributeParser
source
- the source code the value came from, for error reporting purposesvalue
- the attribute value to be parsedUnableToCompleteException
- on parse error