AdvancedMessageFormat.Part
EqualsFieldPart
public class IfFieldPart extends java.lang.Object implements AdvancedMessageFormat.Part
{field,if,Yes,No}
Modifier and Type | Class | Description |
---|---|---|
static class |
IfFieldPart.Factory |
Part factory for "if".
|
Modifier and Type | Field | Description |
---|---|---|
protected java.lang.String |
elseValue |
the value being returned if the field is false
|
protected java.lang.String |
fieldName |
the field name for the part
|
protected java.lang.String |
ifValue |
the value being returned if the field is true
|
Constructor | Description |
---|---|
IfFieldPart(java.lang.String fieldName,
java.lang.String values) |
Creates a new "if" field part.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
isGenerated(java.util.Map params) |
Indicates whether there is any content that is generated by this message part.
|
protected boolean |
isTrue(java.util.Map params) |
Indicates whether the field's value is true.
|
protected void |
parseValues(java.lang.String values) |
Parses the parameter values
|
java.lang.String |
toString() |
|
void |
write(java.lang.StringBuffer sb,
java.util.Map params) |
Writes the formatted part to a string buffer.
|
protected java.lang.String fieldName
protected java.lang.String ifValue
protected java.lang.String elseValue
public IfFieldPart(java.lang.String fieldName, java.lang.String values)
fieldName
- the field namevalues
- the unparsed parameter valuesprotected void parseValues(java.lang.String values)
values
- the unparsed parameter valuespublic void write(java.lang.StringBuffer sb, java.util.Map params)
write
in interface AdvancedMessageFormat.Part
sb
- the target string bufferparams
- the parameters to work withprotected boolean isTrue(java.util.Map params)
params
- the message parameterspublic boolean isGenerated(java.util.Map params)
isGenerated
in interface AdvancedMessageFormat.Part
params
- the parameters to work withpublic java.lang.String toString()
toString
in class java.lang.Object
Copyright 1999-2016 The Apache Software Foundation. All Rights Reserved.