public class IfFieldPart extends java.lang.Object implements AdvancedMessageFormat.Part
{field,if,Yes,No}
Modifier and Type | Class and Description |
---|---|
static class |
IfFieldPart.Factory
Part factory for "if".
|
Modifier and Type | Field and 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 and Description |
---|
IfFieldPart(java.lang.String fieldName,
java.lang.String values)
Creates a new "if" field part.
|
Modifier and Type | Method and 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-2012 The Apache Software Foundation. All Rights Reserved.