com.sun.faces.facelets.tag
Class TagAttributeImpl

java.lang.Object
  extended by javax.faces.view.facelets.TagAttribute
      extended by com.sun.faces.facelets.tag.TagAttributeImpl

public final class TagAttributeImpl
extends javax.faces.view.facelets.TagAttribute

Representation of a Tag's attribute in a Facelet File

Version:
$Id: TagAttributeImpl.java 8697 2010-11-02 22:10:18Z edburns $
Author:
Jacob Hookom

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

Constructor Detail

TagAttributeImpl

public TagAttributeImpl(javax.faces.view.Location location,
                        java.lang.String ns,
                        java.lang.String localName,
                        java.lang.String qName,
                        java.lang.String value)
Method Detail

getBoolean

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

Specified by:
getBoolean in class javax.faces.view.facelets.TagAttribute
Parameters:
ctx - FaceletContext to use
Returns:
boolean value
See Also:
Boolean.getBoolean(java.lang.String), getObject(FaceletContext, Class)

getInt

public int getInt(javax.faces.view.facelets.FaceletContext ctx)
If literal, call Integer.parseInt(String), otherwise call getObject(FaceletContext, Class).

Specified by:
getInt in class javax.faces.view.facelets.TagAttribute
Parameters:
ctx - FaceletContext to use
Returns:
int value
See Also:
Integer.parseInt(java.lang.String), getObject(FaceletContext, Class)

getLocalName

public java.lang.String getLocalName()
Local name of this attribute

Specified by:
getLocalName in class javax.faces.view.facelets.TagAttribute
Returns:
local name of this attribute

getLocation

public javax.faces.view.Location getLocation()
The location of this attribute in the FaceletContext

Specified by:
getLocation in class javax.faces.view.facelets.TagAttribute
Returns:
the TagAttributeImpl's location

getMethodExpression

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

Specified by:
getMethodExpression in class javax.faces.view.facelets.TagAttribute
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 java.lang.String getNamespace()
The resolved Namespace for this attribute

Specified by:
getNamespace in class javax.faces.view.facelets.TagAttribute
Returns:
resolved Namespace

getObject

public java.lang.Object getObject(javax.faces.view.facelets.FaceletContext ctx)
Delegates to getObject with Object.class as a param

Specified by:
getObject in class javax.faces.view.facelets.TagAttribute
Parameters:
ctx - FaceletContext to use
Returns:
Object representation of this attribute's value
See Also:
getObject(FaceletContext, Class)

getQName

public java.lang.String getQName()
The qualified name for this attribute

Specified by:
getQName in class javax.faces.view.facelets.TagAttribute
Returns:
the qualified name for this attribute

getValue

public java.lang.String getValue()
Return the literal value of this attribute

Specified by:
getValue in class javax.faces.view.facelets.TagAttribute
Returns:
literal value

getValue

public java.lang.String getValue(javax.faces.view.facelets.FaceletContext ctx)
If literal, then return our value, otherwise delegate to getObject, passing String.class.

Specified by:
getValue in class javax.faces.view.facelets.TagAttribute
Parameters:
ctx - FaceletContext to use
Returns:
String value of this attribute
See Also:
getObject(FaceletContext, Class)

getObject

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

Specified by:
getObject in class javax.faces.view.facelets.TagAttribute
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

getValueExpression

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

Specified by:
getValueExpression in class javax.faces.view.facelets.TagAttribute
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 boolean isLiteral()
If this TagAttributeImpl is literal (not #{..} or ${..})

Specified by:
isLiteral in class javax.faces.view.facelets.TagAttribute
Returns:
true if this attribute is literal

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getValueExpression

public javax.el.ValueExpression getValueExpression(javax.faces.view.facelets.FaceletContext ctx,
                                                   java.lang.String expr,
                                                   java.lang.Class type)


Copyright © 2011 Oracle America, Inc. All Rights Reserved.