Class TagAttributeImpl
- java.lang.Object
-
- javax.faces.view.facelets.TagAttribute
-
- org.apache.myfaces.view.facelets.tag.TagAttributeImpl
-
public final class TagAttributeImpl extends TagAttribute
Representation of a Tag's attribute in a Facelet File- Version:
- $Id$
- Author:
- Jacob Hookom
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetBoolean(FaceletContext ctx)If literal, returnBoolean.getBoolean(java.lang.String)passing our value, otherwise callgetObject(FaceletContext, Class).intgetInt(FaceletContext ctx)If literal, callInteger.parseInt(String), otherwise callgetObject(FaceletContext, Class).StringgetLocalName()Local name of this attributeLocationgetLocation()The location of this attribute in the FaceletContextjavax.el.MethodExpressiongetMethodExpression(FaceletContext ctx, Class type, Class[] paramTypes)Create a MethodExpression, using this attribute's value as the expression String.StringgetNamespace()The resolved Namespace for this attributeObjectgetObject(FaceletContext ctx)Delegates to getObject with Object.class as a param See #getObject(FaceletContext, Class)ObjectgetObject(FaceletContext ctx, Class type)If literal, simply coerce our String literal value using an ExpressionFactory, otherwise create a ValueExpression and evaluate it.StringgetQName()The qualified name for this attributeStringgetValue()Return the literal value of this attributeStringgetValue(FaceletContext ctx)If literal, then return our value, otherwise delegate to getObject, passing String.class.javax.el.ValueExpressiongetValueExpression(FaceletContext ctx, Class type)Create a ValueExpression, using this attribute's literal value and the passed expected type.booleanisLiteral()If this TagAttribute is literal (not #{..} or ${..})StringtoString()-
Methods inherited from class javax.faces.view.facelets.TagAttribute
getTag, setTag
-
-
-
-
Method Detail
-
getBoolean
public boolean getBoolean(FaceletContext ctx)
If literal, returnBoolean.getBoolean(java.lang.String)passing our value, otherwise callgetObject(FaceletContext, Class). See Boolean#getBoolean(java.lang.String) See #getObject(FaceletContext, Class)- Specified by:
getBooleanin classTagAttribute- Parameters:
ctx- FaceletContext to use- Returns:
- boolean value
-
getInt
public int getInt(FaceletContext ctx)
If literal, callInteger.parseInt(String), otherwise callgetObject(FaceletContext, Class). See Integer#parseInt(java.lang.String) See #getObject(FaceletContext, Class)- Specified by:
getIntin classTagAttribute- Parameters:
ctx- FaceletContext to use- Returns:
- int value
-
getLocalName
public String getLocalName()
Local name of this attribute- Specified by:
getLocalNamein classTagAttribute- Returns:
- local name of this attribute
-
getLocation
public Location getLocation()
The location of this attribute in the FaceletContext- Specified by:
getLocationin classTagAttribute- Returns:
- the TagAttribute's location
-
getMethodExpression
public javax.el.MethodExpression getMethodExpression(FaceletContext ctx, Class type, Class[] paramTypes)
Create a MethodExpression, using this attribute's value as the expression String. See ExpressionFactory#createMethodExpression(javax.el.ELContext, java.lang.String, java.lang.Class, java.lang.Class[]) See MethodExpression- Specified by:
getMethodExpressionin classTagAttribute- Parameters:
ctx- FaceletContext to usetype- expected return typeparamTypes- parameter type- Returns:
- a MethodExpression instance
-
getNamespace
public String getNamespace()
The resolved Namespace for this attribute- Specified by:
getNamespacein classTagAttribute- Returns:
- resolved Namespace
-
getObject
public Object getObject(FaceletContext ctx)
Delegates to getObject with Object.class as a param See #getObject(FaceletContext, Class)- Specified by:
getObjectin classTagAttribute- Parameters:
ctx- FaceletContext to use- Returns:
- Object representation of this attribute's value
-
getQName
public String getQName()
The qualified name for this attribute- Specified by:
getQNamein classTagAttribute- Returns:
- the qualified name for this attribute
-
getValue
public String getValue()
Return the literal value of this attribute- Specified by:
getValuein classTagAttribute- Returns:
- literal value
-
getValue
public String getValue(FaceletContext ctx)
If literal, then return our value, otherwise delegate to getObject, passing String.class. See #getObject(FaceletContext, Class)- Specified by:
getValuein classTagAttribute- Parameters:
ctx- FaceletContext to use- Returns:
- String value of this attribute
-
getObject
public Object getObject(FaceletContext ctx, Class type)
If literal, simply coerce our String literal value using an ExpressionFactory, otherwise create a ValueExpression and evaluate it. See ExpressionFactory#coerceToType(java.lang.Object, java.lang.Class) See ExpressionFactory#createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class) See ValueExpression- Specified by:
getObjectin classTagAttribute- Parameters:
ctx- FaceletContext to usetype- expected return type- Returns:
- Object value of this attribute
-
getValueExpression
public javax.el.ValueExpression getValueExpression(FaceletContext ctx, Class type)
Create a ValueExpression, using this attribute's literal value and the passed expected type. See ExpressionFactory#createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class) See ValueExpression- Specified by:
getValueExpressionin classTagAttribute- Parameters:
ctx- FaceletContext to usetype- expected return type- Returns:
- ValueExpression instance
-
isLiteral
public boolean isLiteral()
If this TagAttribute is literal (not #{..} or ${..})- Specified by:
isLiteralin classTagAttribute- Returns:
- true if this attribute is literal
-
-