Class AbstractVarTEI
java.lang.Object
javax.servlet.jsp.tagext.TagExtraInfo
org.apache.sling.scripting.jsp.taglib.tei.AbstractVarTEI
- Direct Known Subclasses:
AdaptToTEI
,GetPropertyTEI
,ResourceIteratorVariableTEI
,ResourceVariableTEI
,StringVariableTEI
public abstract class AbstractVarTEI
extends javax.servlet.jsp.tagext.TagExtraInfo
Abstract TEI that that provides the type for a single
variable named in the tag's "var" attribute.
The name of the attribute can be overwritten via a custom default
constructor or by overwriting getVariableName(javax.servlet.jsp.tagext.TagData)
.
All implementations need to overwrite getClassName(javax.servlet.jsp.tagext.TagData)
in order to provide the type (class name) of the variable.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractVarTEI
(String variableNameAttribute) Constructor that takes the name of the attribute that defines the variable name and the name of the attribute that defines the class name. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract String
getClassName
(javax.servlet.jsp.tagext.TagData data) Provides the fully qualified class name of the variable injected into thepageContext
.javax.servlet.jsp.tagext.VariableInfo[]
getVariableInfo
(javax.servlet.jsp.tagext.TagData data) protected String
getVariableName
(javax.servlet.jsp.tagext.TagData data) Provides the name of the variable injected into thepageContext
.Methods inherited from class javax.servlet.jsp.tagext.TagExtraInfo
getTagInfo, isValid, setTagInfo, validate
-
Field Details
-
ATTR_VAR
- See Also:
-
-
Constructor Details
-
AbstractVarTEI
public AbstractVarTEI() -
AbstractVarTEI
Constructor that takes the name of the attribute that defines the variable name and the name of the attribute that defines the class name.- Parameters:
variableNameAttribute
- Name of the attribute that defines the variable name.
-
-
Method Details
-
getVariableName
Provides the name of the variable injected into thepageContext
.- Parameters:
data
- The TagData.- Returns:
- The variable name.
-
getClassName
Provides the fully qualified class name of the variable injected into thepageContext
.- Parameters:
data
- The TagData.- Returns:
- The class name of the variable's type.
-
getVariableInfo
public javax.servlet.jsp.tagext.VariableInfo[] getVariableInfo(javax.servlet.jsp.tagext.TagData data) - Overrides:
getVariableInfo
in classjavax.servlet.jsp.tagext.TagExtraInfo
-