Top Description Constructors Methods
jakarta.faces.view.facelets

public abstract Class TagAttribute

extends Object
Class Inheritance
Imports
jakarta.el.ExpressionFactory, .MethodExpression, .ValueExpression, jakarta.faces.view.Location

Representation of an XML attribute name=value pair on an XML element in a Facelet file.

Since
2.0

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract boolean

Returns:

boolean value
getBoolean
(FaceletContext
FaceletContext to use
ctx
)

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

public abstract int

Returns:

int value
getInt
(FaceletContext
FaceletContext to use
ctx
)

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

public abstract String

Returns:

local name of this attribute
getLocalName
()

Local name of this attribute

public abstract Location

Returns:

the TagAttribute's location
getLocation
()

The location of this attribute in the FaceletContext

public abstract MethodExpression

Returns:

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

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

public abstract String

Returns:

resolved Namespace
getNamespace
()

The resolved Namespace for this attribute

public abstract Object

Returns:

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

Delegates to getObject with Object.class as a param

public abstract Object

Returns:

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

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

public abstract String

Returns:

the qualified name for this attribute
getQName
()

The qualified name for this attribute

public Tag

Returns:

the Tag for which this class represents the attributes.
getTag
()

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

public abstract String

Returns:

literal value
getValue
()

Return the literal value of this attribute

public abstract String

Returns:

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

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

public abstract ValueExpression

Returns:

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

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

public abstract boolean

Returns:

true if this attribute is literal.
isLiteral
()

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

public void
setTag(Tag
the tag we represent.
tag
)

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

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

TagAttributeback to summary
public TagAttribute()

Method Detail

getBooleanback to summary
public abstract boolean getBoolean(FaceletContext ctx)

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

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

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

Parameters
ctx:FaceletContext

FaceletContext to use

Returns:int

int value

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

Local name of this attribute

Returns:String

local name of this attribute

getLocationback to summary
public abstract Location getLocation()

The location of this attribute in the FaceletContext

Returns:Location

the TagAttribute's location

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

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

See Also
ExpressionFactory#createMethodExpression(jakarta.el.ELContext, java.lang.String, java.lang.Class, java.lang.Class[]), MethodExpression
getNamespaceback to summary
public abstract String getNamespace()

The resolved Namespace for this attribute

Returns:String

resolved Namespace

getObjectback to summary
public abstract Object getObject(FaceletContext ctx)

Delegates to getObject with Object.class as a param

Parameters
ctx:FaceletContext

FaceletContext to use

Returns:Object

Object representation of this attribute's value

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

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

See Also
ExpressionFactory#coerceToType(java.lang.Object, java.lang.Class), ExpressionFactory#createValueExpression(jakarta.el.ELContext, java.lang.String, java.lang.Class), ValueExpression
getQNameback to summary
public abstract String getQName()

The qualified name for this attribute

Returns:String

the qualified name for this attribute

getTagback to summary
public Tag 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.

Since
2.2
getValueback to summary
public abstract String getValue()

Return the literal value of this attribute

Returns:String

literal value

getValueback to summary
public abstract String getValue(FaceletContext ctx)

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

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

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

the ValueExpression.

See Also
ExpressionFactory#createValueExpression(jakarta.el.ELContext, java.lang.String, java.lang.Class), ValueExpression
isLiteralback to summary
public abstract boolean isLiteral()

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

Returns:boolean

true if this attribute is literal.

setTagback to summary
public void setTag(Tag tag)

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.

Since
2.2