|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.bridge.jsp.taglib.util.Attribute
public class Attribute
MMBase Taglib attributes can contain $-variables. Parsing of these $-variables is cached. Evaluation of these vars must be postponed until doStartTag because servlet containers can decide not to call the set-function of the attribute (in case of tag-instance-reuse).
| Nested Class Summary | |
|---|---|
(package private) static class |
Attribute.ExpressionPart
A ${+ } part containing an 'expression'. |
(package private) static class |
Attribute.Part
A Part represents one part of an Attribute. |
(package private) static class |
Attribute.StringPart
A simple 'string' part, wich does not need any evaluating or parsing any more. |
(package private) static class |
Attribute.VariablePart
A part containing a $-variable. |
| Field Summary | |
|---|---|
static Attribute |
NULL
|
| Constructor Summary | |
|---|---|
protected |
Attribute()
|
protected |
Attribute(String at)
The constructor is protected, construction is done by the cache. |
| Method Summary | |
|---|---|
void |
appendValue(ContextReferrerTag tag,
StringBuilder buffer)
Appends the evaluated Attribute to StringBuilder |
(package private) boolean |
containsVars()
|
static Attribute |
getAttribute(String at)
|
static Attribute |
getAttribute(String at,
boolean interpretEmptyAsAbsent)
This is the function for public use. |
boolean |
getBoolean(ContextReferrerTag tag,
boolean def)
Returns the evaluated Attribute as a boolean (depending on if getValue returns one of the strings 'true' or 'false' (case insensitive)). |
int |
getInt(ContextReferrerTag tag,
int def)
Returns the evaluated Attribute as a int |
List<String> |
getList(ContextReferrerTag tag)
Returns the evaluated Attribute as a List (evaluated to comma-separated String, which is 'split'). |
long |
getLong(ContextReferrerTag tag,
long def)
|
String |
getString(ContextReferrerTag tag)
Returns the evaluated Attribute as a String. |
Object |
getValue(ContextReferrerTag tag)
Returns the evaluated Attribute as an Object. |
protected void |
parse()
Parses this attribute into list of 'attributeparts'. |
String |
toString()
String representation of this Attribute object (for debugging) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Attribute NULL
| Constructor Detail |
|---|
protected Attribute(String at)
throws JspTagException
at - unparsed attribute
JspTagException - when parsing of attributes failsprotected Attribute()
| Method Detail |
|---|
public static final Attribute getAttribute(String at,
boolean interpretEmptyAsAbsent)
throws JspTagException
at - unparsed attributeinterpretEmptyAsAbsent - whether the empty attribute should be interpreted as no
attribute at all (default to false).
JspTagException - when parsing of attributes fails
public static final Attribute getAttribute(String at)
throws JspTagException
JspTagExceptionfinal boolean containsVars()
public void appendValue(ContextReferrerTag tag,
StringBuilder buffer)
throws JspTagException
tag - The tag relative to which the variable evaluations must be done
(normally 'this' in a Tag implementation)buffer - buffer to write attribute value to
JspTagException - when parsing of attributes fails
public Object getValue(ContextReferrerTag tag)
throws JspTagException
tag - tag with the attribute
JspTagException - when parsing of attributes fails
public String getString(ContextReferrerTag tag)
throws JspTagException
tag - tag with the attribute
JspTagException - when parsing of attributes fails
public int getInt(ContextReferrerTag tag,
int def)
throws JspTagException
tag - tag with the attributedef - default value
JspTagException - when parsing of attributes fails
public long getLong(ContextReferrerTag tag,
long def)
throws JspTagException
JspTagException
public List<String> getList(ContextReferrerTag tag)
throws JspTagException
tag - tag with the attribute
JspTagException - when parsing of attributes fails
public boolean getBoolean(ContextReferrerTag tag,
boolean def)
throws JspTagException
def - If the string is not "true" or "false', then this value is returned.tag - tag with the attribute
JspTagException - when parsing of attributes failspublic String toString()
toString in class ObjectObject.toString()
protected void parse()
throws JspTagException
getValue(org.mmbase.bridge.jsp.taglib.ContextReferrerTag)
will concatenate them together again (after evaluation).
JspTagException - when parsing of attributes fails
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||