Top Description Inners Fields Constructors Methods
com.sun.faces.facelets.tag

public Class TagAttributeImpl

extends TagAttribute
Class Inheritance
Imports
com.sun.faces.el.ELUtils, com.sun.faces.facelets.el.ContextualCompositeMethodExpression, .ELText, .TagMethodExpression, .TagValueExpression, .ContextualCompositeValueExpression, com.sun.faces.util.MessageUtils, .Util, javax.el.ELException, .ExpressionFactory, .MethodExpression, .ValueExpression, .MethodInfo, .ELContext, javax.faces.view.Location, javax.faces.view.facelets.FaceletContext, .Tag, .TagAttribute, .TagAttributeException, javax.faces.FacesException

Representation of a Tag's attribute in a Facelet File
Author
Jacob Hookom
Version
$Id$

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final boolean
private final String
private final Location
private final String
private final String
private String
private Tag
private final String

Constructor Summary

AccessConstructor and Description
public
public
TagAttributeImpl(Location location, String ns, String localName, String qName, String value)

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

boolean value
getBoolean
(FaceletContext
FaceletContext to use
ctx
)

Implements abstract javax.faces.view.facelets.TagAttribute.getBoolean.

If literal,return Boolean.valueOf(java.lang.String) passing our value, otherwise call getObject(FaceletContext, Class).

public int

Returns:

int value
getInt
(FaceletContext
FaceletContext to use
ctx
)

Implements abstract javax.faces.view.facelets.TagAttribute.getInt.

If literal, call Integer.parseInt(String), otherwise call getObject(FaceletContext, Class).
public String

Returns:

local name of this attribute
getLocalName
()

Implements abstract javax.faces.view.facelets.TagAttribute.getLocalName.

Local name of this attribute
public Location

Returns:

the TagAttributeImpl's location
getLocation
()

Implements abstract javax.faces.view.facelets.TagAttribute.getLocation.

The location of this attribute in the FaceletContext
public MethodExpression

Returns:

a MethodExpression instance
getMethodExpression
(FaceletContext
FaceletContext to use
ctx
,
Class<T>
expected return type
type
,
Class<T>[]
parameter type
paramTypes
)

Implements abstract javax.faces.view.facelets.TagAttribute.getMethodExpression.

Create a MethodExpression, using this attribute's value as the expression String.
public String

Returns:

resolved Namespace
getNamespace
()

Implements abstract javax.faces.view.facelets.TagAttribute.getNamespace.

The resolved Namespace for this attribute
public Object

Returns:

Object representation of this attribute's value
getObject
(FaceletContext
FaceletContext to use
ctx
)

Implements abstract javax.faces.view.facelets.TagAttribute.getObject.

Delegates to getObject with Object.class as a param
public Object

Returns:

Object value of this attribute
getObject
(FaceletContext
FaceletContext to use
ctx
,
Class<T>
expected return type
type
)

Implements abstract javax.faces.view.facelets.TagAttribute.getObject.

If literal, simply coerce our String literal value using an ExpressionFactory, otherwise create a ValueExpression and evaluate it.
public String

Returns:

the qualified name for this attribute
getQName
()

Implements abstract javax.faces.view.facelets.TagAttribute.getQName.

The qualified name for this attribute
public Tag
getTag()

Overrides javax.faces.view.facelets.TagAttribute.getTag.

A reference to the Tag for which this class represents the attributes.

public String

Returns:

literal value
getValue
()

Implements abstract javax.faces.view.facelets.TagAttribute.getValue.

Return the literal value of this attribute
public String

Returns:

String value of this attribute
getValue
(FaceletContext
FaceletContext to use
ctx
)

Implements abstract javax.faces.view.facelets.TagAttribute.getValue.

If literal, then return our value, otherwise delegate to getObject, passing String.class.
public ValueExpression

Returns:

ValueExpression instance
getValueExpression
(FaceletContext
FaceletContext to use
ctx
,
Class<T>
expected return type
type
)

Implements abstract javax.faces.view.facelets.TagAttribute.getValueExpression.

Create a ValueExpression, using this attribute's literal value and the passed expected type.
public ValueExpression
public boolean

Returns:

true if this attribute is literal
isLiteral
()

Implements abstract javax.faces.view.facelets.TagAttribute.isLiteral.

If this TagAttributeImpl is literal (not #{..} or ${..})
public void
setTag(Tag
the tag we represent.
tag
)

Overrides javax.faces.view.facelets.TagAttribute.setTag.

Set a reference to the Tag for which this class represents the attributes.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Field Detail

literalback to summary
private final boolean literal
localNameback to summary
private final String localName
locationback to summary
private final Location location
namespaceback to summary
private final String namespace
qNameback to summary
private final String qName
stringback to summary
private String string
tagback to summary
private Tag tag
valueback to summary
private final String value

Constructor Detail

TagAttributeImplback to summary
public TagAttributeImpl()
TagAttributeImplback to summary
public TagAttributeImpl(Location location, String ns, String localName, String qName, String value)

Method Detail

getBooleanback to summary
public boolean getBoolean(FaceletContext ctx)

Implements abstract javax.faces.view.facelets.TagAttribute.getBoolean.

If literal,return Boolean.valueOf(java.lang.String) passing our value, otherwise call getObject(FaceletContext, Class).

Parameters
ctx:FaceletContext

FaceletContext to use

Returns:boolean

boolean value

Annotations
@Override
See Also
Boolean#valueOf(java.lang.String), getObject(FaceletContext, Class)
getIntback to summary
public int getInt(FaceletContext ctx)

Implements abstract javax.faces.view.facelets.TagAttribute.getInt.

If literal, call Integer.parseInt(String), otherwise call getObject(FaceletContext, Class).

Parameters
ctx:FaceletContext

FaceletContext to use

Returns:int

int value

Annotations
@Override
See Also
Integer#parseInt(java.lang.String), getObject(FaceletContext, Class)
getLocalNameback to summary
public String getLocalName()

Implements abstract javax.faces.view.facelets.TagAttribute.getLocalName.

Local name of this attribute

Returns:String

local name of this attribute

Annotations
@Override
getLocationback to summary
public Location getLocation()

Implements abstract javax.faces.view.facelets.TagAttribute.getLocation.

The location of this attribute in the FaceletContext

Returns:Location

the TagAttributeImpl's location

Annotations
@Override
getMethodExpressionback to summary
public MethodExpression getMethodExpression(FaceletContext ctx, Class<T> type, Class<T>[] paramTypes)

Implements abstract javax.faces.view.facelets.TagAttribute.getMethodExpression.

Create a MethodExpression, using this attribute's value as the expression String.

Parameters
ctx:FaceletContext

FaceletContext to use

type:Class<T>

expected return type

paramTypes:Class<T>[]

parameter type

Returns:MethodExpression

a MethodExpression instance

Annotations
@Override
See Also
ExpressionFactory#createMethodExpression(javax.el.ELContext, java.lang.String, java.lang.Class, java.lang.Class[]), MethodExpression
getNamespaceback to summary
public String getNamespace()

Implements abstract javax.faces.view.facelets.TagAttribute.getNamespace.

The resolved Namespace for this attribute

Returns:String

resolved Namespace

Annotations
@Override
getObjectback to summary
public Object getObject(FaceletContext ctx)

Implements abstract javax.faces.view.facelets.TagAttribute.getObject.

Delegates to getObject with Object.class as a param

Parameters
ctx:FaceletContext

FaceletContext to use

Returns:Object

Object representation of this attribute's value

Annotations
@Override
See Also
getObject(FaceletContext, Class)
getObjectback to summary
public Object getObject(FaceletContext ctx, Class<T> type)

Implements abstract javax.faces.view.facelets.TagAttribute.getObject.

If literal, simply coerce our String literal value using an ExpressionFactory, otherwise create a ValueExpression and evaluate it.

Parameters
ctx:FaceletContext

FaceletContext to use

type:Class<T>

expected return type

Returns:Object

Object value of this attribute

Annotations
@Override
See Also
ExpressionFactory#coerceToType(java.lang.Object, java.lang.Class), ExpressionFactory#createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class), ValueExpression
getQNameback to summary
public String getQName()

Implements abstract javax.faces.view.facelets.TagAttribute.getQName.

The qualified name for this attribute

Returns:String

the qualified name for this attribute

Annotations
@Override
getTagback to summary
public Tag getTag()

Overrides javax.faces.view.facelets.TagAttribute.getTag.

Doc from javax.faces.view.facelets.TagAttribute.getTag.

A reference to the Tag for which this class represents the attributes. For compatibility with previous implementations, an implementation is provided that returns null.

Returns:Tag

the Tag for which this class represents the attributes.

Annotations
@Override
getValueback to summary
public String getValue()

Implements abstract javax.faces.view.facelets.TagAttribute.getValue.

Return the literal value of this attribute

Returns:String

literal value

Annotations
@Override
getValueback to summary
public String getValue(FaceletContext ctx)

Implements abstract javax.faces.view.facelets.TagAttribute.getValue.

If literal, then return our value, otherwise delegate to getObject, passing String.class.

Parameters
ctx:FaceletContext

FaceletContext to use

Returns:String

String value of this attribute

Annotations
@Override
See Also
getObject(FaceletContext, Class)
getValueExpressionback to summary
public ValueExpression getValueExpression(FaceletContext ctx, Class<T> type)

Implements abstract javax.faces.view.facelets.TagAttribute.getValueExpression.

Create a ValueExpression, using this attribute's literal value and the passed expected type.

Parameters
ctx:FaceletContext

FaceletContext to use

type:Class<T>

expected return type

Returns:ValueExpression

ValueExpression instance

Annotations
@Override
See Also
ExpressionFactory#createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class), ValueExpression
getValueExpressionback to summary
public ValueExpression getValueExpression(FaceletContext ctx, String expr, Class<T> type)
isLiteralback to summary
public boolean isLiteral()

Implements abstract javax.faces.view.facelets.TagAttribute.isLiteral.

If this TagAttributeImpl is literal (not #{..} or ${..})

Returns:boolean

true if this attribute is literal

Annotations
@Override
setTagback to summary
public void setTag(Tag tag)

Overrides javax.faces.view.facelets.TagAttribute.setTag.

Doc from javax.faces.view.facelets.TagAttribute.setTag.

Set a reference to the Tag for which this class represents the attributes. The VDL runtime must ensure that this method is called before any FaceletHandlers for this element are instantiated. For compatibility with previous implementations, a no-op implementation is provided.

Parameters
tag:Tag

the tag we represent.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
com.sun.faces.facelets.tag back to summary

private Class TagAttributeImpl.AttributeLookupMethodExpression

extends MethodExpression
Class Inheritance

Field Summary

Modifier and TypeField and Description
private ValueExpression
private static final long

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the Object to test for equality.
otherObj
)

Implements abstract javax.el.Expression.equals.

Determines whether the specified object is equal to this Expression.
public String
getExpressionString()

Implements abstract javax.el.Expression.getExpressionString.

Returns the original String used to create this Expression, unmodified.
public MethodInfo
getMethodInfo(ELContext
The context of this evaluation
elContext
)

Implements abstract javax.el.MethodExpression.getMethodInfo.

Evaluates the expression relative to the provided context, and returns information about the actual referenced method.
public int
hashCode()

Implements abstract javax.el.Expression.hashCode.

Returns the hash code for this Expression.
public Object
invoke(ELContext
The context of this evaluation.
elContext
,
Object[]
The parameters to pass to the method, or null if no parameters.
args
)

Implements abstract javax.el.MethodExpression.invoke.

If a String literal is specified as the expression, returns the String literal coerced to the expected return type of the method signature.
public boolean
isLiteralText()

Implements abstract javax.el.Expression.isLiteralText.

Returns whether this expression was created from only literal text.
Inherited from javax.el.MethodExpression:
isParametersProvidedisParmetersProvided

Field Detail

lookupExpressionback to summary
private ValueExpression lookupExpression
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

AttributeLookupMethodExpressionback to summary
public AttributeLookupMethodExpression(ValueExpression lookupExpression)
AttributeLookupMethodExpressionback to summary
public AttributeLookupMethodExpression()
Annotations
@SuppressWarnings:UnusedDeclaration

Method Detail

equalsback to summary
public boolean equals(Object otherObj)

Implements abstract javax.el.Expression.equals.

Doc from javax.el.Expression.equals.

Determines whether the specified object is equal to this Expression.

The result is true if and only if the argument is not null, is an Expression object that is the of the same type (ValueExpression or MethodExpression), and has an identical parsed representation.

Note that two expressions can be equal if their expression Strings are different. For example, ${fn1:foo()} and ${fn2:foo()} are equal if their corresponding FunctionMappers mapped fn1:foo and fn2:foo to the same method.

Parameters
otherObj:Object

the Object to test for equality.

Returns:boolean

true if obj equals this Expression; false otherwise.

Annotations
@Override
getExpressionStringback to summary
public String getExpressionString()

Implements abstract javax.el.Expression.getExpressionString.

Doc from javax.el.Expression.getExpressionString.

Returns the original String used to create this Expression, unmodified.

This is used for debugging purposes but also for the purposes of comparison (e.g. to ensure the expression in a configuration file has not changed).

This method does not provide sufficient information to re-create an expression. Two different expressions can have exactly the same expression string but different function mappings. Serialization should be used to save and restore the state of an Expression.

Returns:String

The original expression String.

Annotations
@Override
getMethodInfoback to summary
public MethodInfo getMethodInfo(ELContext elContext)

Implements abstract javax.el.MethodExpression.getMethodInfo.

Doc from javax.el.MethodExpression.getMethodInfo.

Evaluates the expression relative to the provided context, and returns information about the actual referenced method.

Parameters
elContext:ELContext

The context of this evaluation

Returns:MethodInfo

an instance of MethodInfo containing information about the method the expression evaluated to.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Implements abstract javax.el.Expression.hashCode.

Doc from javax.el.Expression.hashCode.

Returns the hash code for this Expression.

See the note in the equals method on how two expressions can be equal if their expression Strings are different. Recall that if two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result. Implementations must take special note and implement hashCode correctly.

Returns:int

The hash code for this Expression.

Annotations
@Override
invokeback to summary
public Object invoke(ELContext elContext, Object[] args)

Implements abstract javax.el.MethodExpression.invoke.

Doc from javax.el.MethodExpression.invoke.

If a String literal is specified as the expression, returns the String literal coerced to the expected return type of the method signature. An ELException is thrown if expectedReturnType is void or if the coercion of the String literal to the expectedReturnType yields an error (see Section "1.18 Type Conversion" of the EL specification). If not a String literal, evaluates the expression relative to the provided context, invokes the method that was found using the supplied parameters, and returns the result of the method invocation. Any parameters passed to this method is ignored if isLiteralText() or isParmetersProvided() is true.

Parameters
elContext:ELContext

The context of this evaluation.

args:Object[]

The parameters to pass to the method, or null if no parameters.

Returns:Object

the result of the method invocation (null if the method has a void return type).

Annotations
@Override
isLiteralTextback to summary
public boolean isLiteralText()

Implements abstract javax.el.Expression.isLiteralText.

Doc from javax.el.Expression.isLiteralText.

Returns whether this expression was created from only literal text.

This method must return true if and only if the expression string this expression was created from contained no unescaped EL delimeters (${...} or #{...}).

Returns:boolean

true if this expression was created from only literal text; false otherwise.

Annotations
@Override