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

public Class CompositeComponentTagHandler

extends ComponentHandler
implements CreateComponentDelegate
Class Inheritance
All Implemented Interfaces
com.sun.faces.facelets.tag.faces.ComponentTagHandlerDelegateImpl.CreateComponentDelegate
Static Imports
com.sun.faces.facelets.tag.faces.ComponentSupport.getViewRoot

Facelet handler responsible for, building the component tree representation of a composite component based on the metadata contained in the composite interface and implementation sections of the composite component template.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
CompositeComponentTagHandler.CompositeComponentMetaRuleset

Specialized MetaRulesetImpl to return CompositeMetadataTarget for component attribute handling.

private static class
CompositeComponentTagHandler.CompositeComponentRule

MetaRule for populating the ValueExpression map of a composite component.

Field Summary

Modifier and TypeField and Description
private static final String
ATTACHED_OBJECT_HANDLERS_KEY

The key in the value set of the composite component BeanDescriptor, the value for which is a List<AttachedObjectHandler>.

private TagAttribute
private static final String
private Resource
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
public void
applyNextHandler(FaceletContext
the FaceletContext for this view execution
ctx
,
UIComponent
the UIComponent of the component represented by this element instance.
c
)

Overrides jakarta.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler.

Invoke the apply() method on this instance's TagHandler#nextHandler.

public UIComponent
createComponent(FaceletContext
the FaceletContext for this view execution
ctx
)

Overrides jakarta.faces.view.facelets.ComponentHandler.createComponent.

Implements com.sun.faces.facelets.tag.faces.ComponentTagHandlerDelegateImpl.CreateComponentDelegate.createComponent.

Subclasses that wish to take over the task of instantiating the UIComponent instance corresponding to this tag handler my override this method to do so.

protected MetaRuleset
createMetaRuleset(Class<T>
the Class for which the MetaRuleset must be created.
type
)

Overrides jakarta.faces.view.facelets.DelegatingMetaTagHandler.createMetaRuleset.

This is basically a copy of what's define in ComponentTagHandlerDelegateImpl except for the MetaRuleset implementation that's being used.

public static List<AttachedObjectHandler>
public static List<AttachedObjectHandler>
getAttachedObjectHandlers(UIComponent component, boolean create)

public UIComponent
public void
setAttributes(FaceletContext
the Facelet context.
ctx
,
Object
the instance.
instance
)

Overrides jakarta.faces.view.facelets.DelegatingMetaTagHandler.setAttributes.

Specialized implementation to prevent caching of the MetaRuleset when ProjectStage is Development.

public void
Inherited from jakarta.faces.view.facelets.ComponentHandler:
getComponentConfiggetTagHandlerDelegateisNewonComponentCreatedonComponentPopulated

Field Detail

ATTACHED_OBJECT_HANDLERS_KEYback to summary
private static final String ATTACHED_OBJECT_HANDLERS_KEY

The key in the value set of the composite component BeanDescriptor, the value for which is a List<AttachedObjectHandler>.

bindingback to summary
private TagAttribute binding

Hides jakarta.faces.view.facelets.DelegatingMetaTagHandler.binding.

ccInstanceVariableStandinKeyback to summary
private static final String ccInstanceVariableStandinKey
ccResourceback to summary
private Resource ccResource
LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

CompositeComponentTagHandlerback to summary
public CompositeComponentTagHandler(Resource ccResource, ComponentConfig config)

Method Detail

applyCompositeComponentback to summary
private void applyCompositeComponent(FaceletContext ctx, UIComponent c) throws IOException
applyNextHandlerback to summary
public void applyNextHandler(FaceletContext ctx, UIComponent c) throws IOException, FacesException, ELException

Overrides jakarta.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler.

Doc from jakarta.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler.

Invoke the apply() method on this instance's TagHandler#nextHandler.

Parameters
ctx:FaceletContext

the FaceletContext for this view execution

c:UIComponent

the UIComponent of the component represented by this element instance.

Annotations
@Override
Exceptions
IOException:
if thrown by the next FaceletHandler
FacesException:
if thrown by the next FaceletHandler
ELException:
if thrown by the next FaceletHandler
createComponentback to summary
public UIComponent createComponent(FaceletContext ctx)

Overrides jakarta.faces.view.facelets.ComponentHandler.createComponent.

Implements com.sun.faces.facelets.tag.faces.ComponentTagHandlerDelegateImpl.CreateComponentDelegate.createComponent.

Doc from jakarta.faces.view.facelets.ComponentHandler.createComponent.

Subclasses that wish to take over the task of instantiating the UIComponent instance corresponding to this tag handler my override this method to do so. A null return from this method will cause the TagHandlerDelegate for instance to create the component instead.

Parameters
ctx:FaceletContext

the FaceletContext for this view execution

Returns:UIComponent

the newly created UIComponent

Annotations
@Override
createMetaRulesetback to summary
protected MetaRuleset createMetaRuleset(Class<T> type)

Overrides jakarta.faces.view.facelets.DelegatingMetaTagHandler.createMetaRuleset.

This is basically a copy of what's define in ComponentTagHandlerDelegateImpl except for the MetaRuleset implementation that's being used. This also allows us to treat composite component's backed by custom component implementation classes based on their type.

Parameters
type:Class<T>

the Class for which the MetaRuleset must be created.

Annotations
@Override
getAttachedObjectHandlersback to summary
public static List<AttachedObjectHandler> getAttachedObjectHandlers(UIComponent component)
getAttachedObjectHandlersback to summary
public static List<AttachedObjectHandler> getAttachedObjectHandlers(UIComponent component, boolean create)
Annotations
@SuppressWarnings:unchecked
getCompositeComponentback to summary
public UIComponent getCompositeComponent(FacesContext context)

Implements com.sun.faces.facelets.tag.faces.ComponentTagHandlerDelegateImpl.CreateComponentDelegate.getCompositeComponent.

Annotations
@Override
setAttributesback to summary
public void setAttributes(FaceletContext ctx, Object instance)

Overrides jakarta.faces.view.facelets.DelegatingMetaTagHandler.setAttributes.

Specialized implementation to prevent caching of the MetaRuleset when ProjectStage is Development.

Parameters
ctx:FaceletContext

Doc from jakarta.faces.view.facelets.MetaTagHandler.setAttributes.

the Facelet context.

instance:Object

Doc from jakarta.faces.view.facelets.MetaTagHandler.setAttributes.

the instance.

Annotations
@Override
setCompositeComponentback to summary
public void setCompositeComponent(FacesContext context, UIComponent cc)

Implements com.sun.faces.facelets.tag.faces.ComponentTagHandlerDelegateImpl.CreateComponentDelegate.setCompositeComponent.

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

private final Class CompositeComponentTagHandler.CompositeComponentMetaRuleset

extends MetaRulesetImpl
Class Inheritance

Specialized MetaRulesetImpl to return CompositeMetadataTarget for component attribute handling.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
CompositeComponentTagHandler.CompositeComponentMetaRuleset.CompositeMetadataTarget

This class is responsible for creating ValueExpression instances with the expected type based off the following: - if the composite:attribute metadata is present, then use the type if specified by the author, or default to Object.class - if no composite:attribute is specified, then attempt to return the type based off the bean info for this component

Field Summary

Modifier and TypeField and Description
private BeanInfo
private Class<?>

Constructor Summary

AccessConstructor and Description
public
CompositeComponentMetaRuleset(Tag tag, Class<?> type, BeanInfo compBeanInfo)

Method Summary

Modifier and TypeMethod and Description
protected MetadataTarget
Inherited from com.sun.faces.facelets.tag.MetaRulesetImpl:
addaddRulealiasfinishignoreignoreAll

Field Detail

compBeanInfoback to summary
private BeanInfo compBeanInfo
typeback to summary
private Class<?> type

Hides com.sun.faces.facelets.tag.MetaRulesetImpl.type.

Constructor Detail

CompositeComponentMetaRulesetback to summary
public CompositeComponentMetaRuleset(Tag tag, Class<?> type, BeanInfo compBeanInfo)

Method Detail

getMetadataTargetback to summary
protected MetadataTarget getMetadataTarget()

Overrides com.sun.faces.facelets.tag.MetaRulesetImpl.getMetadataTarget.

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

private final Class CompositeComponentTagHandler.CompositeComponentMetaRuleset.CompositeMetadataTarget

extends MetadataTargetImpl
Class Inheritance

This class is responsible for creating ValueExpression instances with the expected type based off the following: - if the composite:attribute metadata is present, then use the type if specified by the author, or default to Object.class - if no composite:attribute is specified, then attempt to return the type based off the bean info for this component

Field Summary

Modifier and TypeField and Description
private BeanInfo

Constructor Summary

AccessConstructor and Description
public
CompositeMetadataTarget(Class<?> type, BeanInfo compBeanInfo)

Method Summary

Modifier and TypeMethod and Description
private PropertyDescriptor
public Class<T>
getPropertyType(String
the name of the property for which the Class must be returned.
name
)

Overrides com.sun.faces.facelets.tag.MetadataTargetImpl.getPropertyType.

Return a Class for the property with name given by argument name.

private String
prefix(String className)

Inherited from com.sun.faces.facelets.tag.MetadataTargetImpl:
getPropertygetReadMethodgetTargetClassgetWriteMethodisTargetInstanceOf

Field Detail

compBeanInfoback to summary
private BeanInfo compBeanInfo

Constructor Detail

CompositeMetadataTargetback to summary
public CompositeMetadataTarget(Class<?> type, BeanInfo compBeanInfo) throws IntrospectionException

Method Detail

findDescriptorback to summary
private PropertyDescriptor findDescriptor(String name)
getPropertyTypeback to summary
public Class<T> getPropertyType(String name)

Overrides com.sun.faces.facelets.tag.MetadataTargetImpl.getPropertyType.

Doc from jakarta.faces.view.facelets.MetadataTarget.getPropertyType.

Return a Class for the property with name given by argument name.

Parameters
name:String

the name of the property for which the Class must be returned.

Returns:Class<T>

the Class of the property.

Annotations
@Override
prefixback to summary
private String prefix(String className)
com.sun.faces.facelets.tag.faces back to summary

private Class CompositeComponentTagHandler.CompositeComponentRule

extends MetaRule
Class Inheritance

MetaRule for populating the ValueExpression map of a composite component.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
CompositeComponentTagHandler.CompositeComponentRule.CompositeExpressionMetadata

CompositeExpressionMetadata sets up specialized wrapper ValueExpression instances around the source ValueExpression that, when evaluated, will cause the parent composite component of the currently available composite component to be pushed onto a stack that the ImplicitObjectELResolver will check for.

private static class
CompositeComponentTagHandler.CompositeComponentRule.LiteralAttributeMetadata

For literal expressions, coerce the literal value to the type as provided to the constructor prior to setting the value into the component's attribute map.

Field Summary

Modifier and TypeField and Description
private static final CompositeComponentTagHandler.CompositeComponentRule

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Metadata
applyRule(String
the name for this rule. This will generally be the name of a tag attribute in the VDL.
name
,
TagAttribute
the name/value pair for this attribute on this particular instance of an element in the page.
attribute
,
MetadataTarget
the MetadataTarged that can be used to discern what kind of action to encapsulate within the abstraction to be returned.
meta
)

Implements abstract jakarta.faces.view.facelets.MetaRule.applyRule.

Return an abstraction that takes appropriate action given the kind of rule represented by the argument name, in the context of this particular concrete subclass of MetaRule.

Field Detail

Instanceback to summary
private static final CompositeComponentTagHandler.CompositeComponentRule Instance

Constructor Detail

CompositeComponentRuleback to summary
private CompositeComponentRule()

Method Detail

applyRuleback to summary
public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta)

Implements abstract jakarta.faces.view.facelets.MetaRule.applyRule.

Doc from jakarta.faces.view.facelets.MetaRule.applyRule.

Return an abstraction that takes appropriate action given the kind of rule represented by the argument name, in the context of this particular concrete subclass of MetaRule. The abstraction must encapsulate the value from the argument attribute.

Parameters
name:String

the name for this rule. This will generally be the name of a tag attribute in the VDL.

attribute:TagAttribute

the name/value pair for this attribute on this particular instance of an element in the page.

meta:MetadataTarget

the MetadataTarged that can be used to discern what kind of action to encapsulate within the abstraction to be returned.

Returns:Metadata

the Metadata.

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

private final Class CompositeComponentTagHandler.CompositeComponentRule.CompositeExpressionMetadata

extends Metadata
Class Inheritance

CompositeExpressionMetadata sets up specialized wrapper ValueExpression instances around the source ValueExpression that, when evaluated, will cause the parent composite component of the currently available composite component to be pushed onto a stack that the ImplicitObjectELResolver will check for.

Field Summary

Modifier and TypeField and Description
private TagAttribute
private String
private Class<?>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
applyMetadata(FaceletContext
The FaceletContext for this request.
ctx
,
Object
The instance from the Jakarta Faces Java API on which the action should be taken. For example, an instance of jakarta.faces.component.EditableValueHolder.
instance
)

Implements abstract jakarta.faces.view.facelets.Metadata.applyMetadata.

Take the action prescribed in the Jakarta Faces Specification for this particular VDL element attribute.

Field Detail

attrback to summary
private TagAttribute attr
nameback to summary
private String name
typeback to summary
private Class<?> type

Constructor Detail

CompositeExpressionMetadataback to summary
public CompositeExpressionMetadata(String name, Class<?> type, TagAttribute attr)

Method Detail

applyMetadataback to summary
public void applyMetadata(FaceletContext ctx, Object instance)

Implements abstract jakarta.faces.view.facelets.Metadata.applyMetadata.

Doc from jakarta.faces.view.facelets.Metadata.applyMetadata.

Take the action prescribed in the Jakarta Faces Specification for this particular VDL element attribute.

Parameters
ctx:FaceletContext

The FaceletContext for this request.

instance:Object

The instance from the Jakarta Faces Java API on which the action should be taken. For example, an instance of jakarta.faces.component.EditableValueHolder.

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

private final Class CompositeComponentTagHandler.CompositeComponentRule.LiteralAttributeMetadata

extends Metadata
Class Inheritance

For literal expressions, coerce the literal value to the type as provided to the constructor prior to setting the value into the component's attribute map.

Field Summary

Modifier and TypeField and Description
private TagAttribute
private String
private Class<?>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
applyMetadata(FaceletContext
The FaceletContext for this request.
ctx
,
Object
The instance from the Jakarta Faces Java API on which the action should be taken. For example, an instance of jakarta.faces.component.EditableValueHolder.
instance
)

Implements abstract jakarta.faces.view.facelets.Metadata.applyMetadata.

Take the action prescribed in the Jakarta Faces Specification for this particular VDL element attribute.

Field Detail

attributeback to summary
private TagAttribute attribute
nameback to summary
private String name
typeback to summary
private Class<?> type

Constructor Detail

LiteralAttributeMetadataback to summary
public LiteralAttributeMetadata(String name, Class<?> type, TagAttribute attribute)

Method Detail

applyMetadataback to summary
public void applyMetadata(FaceletContext ctx, Object instance)

Implements abstract jakarta.faces.view.facelets.Metadata.applyMetadata.

Doc from jakarta.faces.view.facelets.Metadata.applyMetadata.

Take the action prescribed in the Jakarta Faces Specification for this particular VDL element attribute.

Parameters
ctx:FaceletContext

The FaceletContext for this request.

instance:Object

The instance from the Jakarta Faces Java API on which the action should be taken. For example, an instance of jakarta.faces.component.EditableValueHolder.

Annotations
@Override