javax.faces.view.facelets
Class TagAttribute

java.lang.Object
  extended by javax.faces.view.facelets.TagAttribute

public abstract class TagAttribute
extends Object

Representation of a Tag's attribute in a Facelet File

Version:
$Id: TagAttribute.java 1187700 2011-10-22 12:19:37Z bommel $
Author:
Jacob Hookom

Constructor Summary
TagAttribute()
           
 
Method Summary
abstract  boolean getBoolean(FaceletContext ctx)
          If literal, return Boolean.getBoolean(java.lang.String) passing our value, otherwise call getObject(FaceletContext, Class).
abstract  int getInt(FaceletContext ctx)
          If literal, call Integer.parseInt(String), otherwise call getObject(FaceletContext, Class).
abstract  String getLocalName()
          Local name of this attribute
abstract  Location getLocation()
          The location of this attribute in the FaceletContext
abstract  javax.el.MethodExpression getMethodExpression(FaceletContext ctx, Class type, Class[] paramTypes)
          Create a MethodExpression, using this attribute's value as the expression String.
abstract  String getNamespace()
          The resolved Namespace for this attribute
abstract  Object getObject(FaceletContext ctx)
          Delegates to getObject with Object.class as a param
abstract  Object getObject(FaceletContext ctx, Class type)
          If literal, simply coerce our String literal value using an ExpressionFactory, otherwise create a ValueExpression and evaluate it.
abstract  String getQName()
          The qualified name for this attribute
abstract  String getValue()
          Return the literal value of this attribute
abstract  String getValue(FaceletContext ctx)
          If literal, then return our value, otherwise delegate to getObject, passing String.class.
abstract  javax.el.ValueExpression getValueExpression(FaceletContext ctx, Class type)
          Create a ValueExpression, using this attribute's literal value and the passed expected type.
abstract  boolean isLiteral()
          If this TagAttribute is literal (not #{..} or ${..})
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TagAttribute

public TagAttribute()
Method Detail

getBoolean

public abstract boolean getBoolean(FaceletContext ctx)
If literal, return Boolean.getBoolean(java.lang.String) passing our value, otherwise call getObject(FaceletContext, Class).

Parameters:
ctx - FaceletContext to use
Returns:
boolean value
See Also:
Boolean.getBoolean(java.lang.String), getObject(FaceletContext, Class)

getInt

public abstract int getInt(FaceletContext ctx)
If literal, call Integer.parseInt(String), otherwise call getObject(FaceletContext, Class).

Parameters:
ctx - FaceletContext to use
Returns:
int value
See Also:
Integer.parseInt(java.lang.String), getObject(FaceletContext, Class)

getLocalName

public abstract String getLocalName()
Local name of this attribute

Returns:
local name of this attribute

getLocation

public abstract Location getLocation()
The location of this attribute in the FaceletContext

Returns:
the TagAttribute's location

getMethodExpression

public abstract javax.el.MethodExpression getMethodExpression(FaceletContext ctx,
                                                              Class type,
                                                              Class[] paramTypes)
Create a MethodExpression, using this attribute's value as the expression String.

Parameters:
ctx - FaceletContext to use
type - expected return type
paramTypes - parameter type
Returns:
a MethodExpression instance
See Also:
ExpressionFactory.createMethodExpression(javax.el.ELContext, java.lang.String, java.lang.Class, java.lang.Class[]), MethodExpression

getNamespace

public abstract String getNamespace()
The resolved Namespace for this attribute

Returns:
resolved Namespace

getObject

public abstract Object getObject(FaceletContext ctx)
Delegates to getObject with Object.class as a param

Parameters:
ctx - FaceletContext to use
Returns:
Object representation of this attribute's value
See Also:
getObject(FaceletContext, Class)

getObject

public abstract Object getObject(FaceletContext ctx,
                                 Class type)
If literal, simply coerce our String literal value using an ExpressionFactory, otherwise create a ValueExpression and evaluate it.

Parameters:
ctx - FaceletContext to use
type - expected return type
Returns:
Object value of this attribute
See Also:
ExpressionFactory.coerceToType(java.lang.Object, java.lang.Class), ExpressionFactory.createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class), ValueExpression

getQName

public abstract String getQName()
The qualified name for this attribute

Returns:
the qualified name for this attribute

getValue

public abstract String getValue()
Return the literal value of this attribute

Returns:
literal value

getValue

public abstract String getValue(FaceletContext ctx)
If literal, then return our value, otherwise delegate to getObject, passing String.class.

Parameters:
ctx - FaceletContext to use
Returns:
String value of this attribute
See Also:
getObject(FaceletContext, Class)

getValueExpression

public abstract javax.el.ValueExpression getValueExpression(FaceletContext ctx,
                                                            Class type)
Create a ValueExpression, using this attribute's literal value and the passed expected type.

Parameters:
ctx - FaceletContext to use
type - expected return type
Returns:
ValueExpression instance
See Also:
ExpressionFactory.createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class), ValueExpression

isLiteral

public abstract boolean isLiteral()
If this TagAttribute is literal (not #{..} or ${..})

Returns:
true if this attribute is literal


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.