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

pack-priv final Class DefaultFacelet

extends Facelet
implements XMLFrontMatterSaver
Class Inheritance
All Implemented Interfaces
com.sun.faces.facelets.impl.XMLFrontMatterSaver
Imports
java.io.Externalizable, .IOException, .ObjectInput, .ObjectOutput, java.net.URL, java.text.DateFormat, .SimpleDateFormat, java.util.Collection, .Date, .Iterator, .List, .Map, java.util.logging.Level, .Logger, com.sun.faces.facelets.tag.faces.ComponentSupport, com.sun.faces.util.FacesLogger, .Util, jakarta.el.ELException, .ExpressionFactory, jakarta.faces.FacesException, jakarta.faces.application.ProjectStage, jakarta.faces.component.Doctype, .UIComponent, jakarta.faces.context.FacesContext, jakarta.faces.view.facelets.Facelet, .FaceletContext, .FaceletException, .FaceletHandler

Default Facelet implementation.
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 String
private static final String
private final long
private final ExpressionFactory
private final DefaultFaceletFactory
private static final String
private static final Logger
private IdMapper
private final long
private final FaceletHandler
private Doctype
private String
private final URL

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
apply(FacesContext
The current FacesContext (Should be the same as FacesContext.getInstance())
facesContext
,
UIComponent
The UIComponent to populate in a compositional fashion. In most cases a Facelet will be base a UIViewRoot.
parent
)

Implements abstract jakarta.faces.view.facelets.Facelet.apply.

The passed UIComponent parent will be populated/restored in accordance with the section 10.2.1 "Specification of the ViewDeclarationLanguage Implementation for Facelets for Jakarta Faces" in the Jakarta Faces Specification Document.

public void
applyMetadata(FacesContext
The current FacesContext (Should be the same as FacesContext.getInstance())
facesContext
,
UIComponent
The UIComponent to populate in a compositional fashion. In most cases a Facelet will be base a UIViewRoot.
parent
)

Overrides jakarta.faces.view.facelets.Facelet.applyMetadata.

The passed UIComponent parent will be populated/restored in accordance with the section 10.2.1 "Specification of the ViewDeclarationLanguage Implementation for Facelets for Jakarta Faces" in the Jakarta Faces Specification Document with only the meta data as per the f:metadata tag.

public String

Returns:

alias name
getAlias
()

Return the alias name for error messages and logging

public long

Returns:

final timestamp of when this Facelet was created
getCreateTime
()

The time when this Facelet was created, NOT the URL source code

private URL
public ExpressionFactory

Returns:

internal ExpressionFactory instance
getExpressionFactory
()

Return this Facelet's ExpressionFactory instance

public Doctype
public String
public URL

Returns:

the URL this Facelet was created from
getSource
()

The URL this Facelet was created from.

private void
include(DefaultFaceletContext
the FaceletContext to use for applying our FaceletHandlers
ctx
,
UIComponent
the parent component to apply changes to
parent
)

Given the passed FaceletContext, apply our child FaceletHandlers to the passed parent

public void
include(DefaultFaceletContext
FaceletContext to pass to the included Facelet
ctx
,
UIComponent
UIComponent to apply changes to
parent
,
String
relative path to the desired Facelet from the FaceletContext
relativePath
)

Used for delegation by the DefaultFaceletContext.

public void
include(DefaultFaceletContext
FaceletContext to pass to the included Facelet
ctx
,
UIComponent
UIComponent to apply changes to
parent
,
URL
URL source to include Facelet from
url
)

Grabs a DefaultFacelet from referenced DefaultFaceletFacotry

private boolean
private void
private void
private URL

Returns:

URL pointing to destination
resolveURL
(String
a relative url path
relativePath
)

Delegates resolution to DefaultFaceletFactory reference.

public void
public void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Field Detail

aliasback to summary
private final String alias
APPLIED_KEYback to summary
private static final String APPLIED_KEY
createTimeback to summary
private final long createTime
elFactoryback to summary
private final ExpressionFactory elFactory
factoryback to summary
private final DefaultFaceletFactory factory
JAKARTA_FACES_ERROR_XHTMLback to summary
private static final String JAKARTA_FACES_ERROR_XHTML
logback to summary
private static final Logger log
mapperback to summary
private IdMapper mapper
refreshPeriodback to summary
private final long refreshPeriod
rootback to summary
private final FaceletHandler root
savedDoctypeback to summary
private Doctype savedDoctype
savedXMLDeclback to summary
private String savedXMLDecl
srcback to summary
private final URL src

Constructor Detail

DefaultFaceletback to summary
public DefaultFacelet(DefaultFaceletFactory factory, ExpressionFactory el, URL src, String alias, FaceletHandler root)

Method Detail

applyback to summary
public void apply(FacesContext facesContext, UIComponent parent) throws IOException

Implements abstract jakarta.faces.view.facelets.Facelet.apply.

Doc from jakarta.faces.view.facelets.Facelet.apply.

The passed UIComponent parent will be populated/restored in accordance with the section 10.2.1 "Specification of the ViewDeclarationLanguage Implementation for Facelets for Jakarta Faces" in the Jakarta Faces Specification Document.

Parameters
facesContext:FacesContext

The current FacesContext (Should be the same as FacesContext.getInstance())

parent:UIComponent

The UIComponent to populate in a compositional fashion. In most cases a Facelet will be base a UIViewRoot.

Annotations
@Override
Exceptions
IOException:
if unable to load a file necessary to apply this Facelet
See Also
jakarta.faces.view.facelets.Facelet#apply(jakarta.faces.context.FacesContext, jakarta.faces.component.UIComponent)
applyMetadataback to summary
public void applyMetadata(FacesContext facesContext, UIComponent parent) throws IOException

Overrides jakarta.faces.view.facelets.Facelet.applyMetadata.

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

The passed UIComponent parent will be populated/restored in accordance with the section 10.2.1 "Specification of the ViewDeclarationLanguage Implementation for Facelets for Jakarta Faces" in the Jakarta Faces Specification Document with only the meta data as per the f:metadata tag.

Parameters
facesContext:FacesContext

The current FacesContext (Should be the same as FacesContext.getInstance())

parent:UIComponent

The UIComponent to populate in a compositional fashion. In most cases a Facelet will be base a UIViewRoot.

Annotations
@Override
Exceptions
IOException:
if unable to load a file necessary to apply this Facelet
getAliasback to summary
public String getAlias()

Return the alias name for error messages and logging

Returns:String

alias name

getCreateTimeback to summary
public long getCreateTime()

The time when this Facelet was created, NOT the URL source code

Returns:long

final timestamp of when this Facelet was created

getErrorFaceletback to summary
private URL getErrorFacelet(ClassLoader loader)
getExpressionFactoryback to summary
public ExpressionFactory getExpressionFactory()

Return this Facelet's ExpressionFactory instance

Returns:ExpressionFactory

internal ExpressionFactory instance

getSavedDoctypeback to summary
public Doctype getSavedDoctype()

Implements com.sun.faces.facelets.impl.XMLFrontMatterSaver.getSavedDoctype.

Annotations
@Override
getSavedXMLDeclback to summary
public String getSavedXMLDecl()

Implements com.sun.faces.facelets.impl.XMLFrontMatterSaver.getSavedXMLDecl.

Annotations
@Override
getSourceback to summary
public URL getSource()

The URL this Facelet was created from.

Returns:URL

the URL this Facelet was created from

includeback to summary
private void include(DefaultFaceletContext ctx, UIComponent parent) throws IOException

Given the passed FaceletContext, apply our child FaceletHandlers to the passed parent

Parameters
ctx:DefaultFaceletContext

the FaceletContext to use for applying our FaceletHandlers

parent:UIComponent

the parent component to apply changes to

See Also
FaceletHandler#apply(FaceletContext, UIComponent)
includeback to summary
public void include(DefaultFaceletContext ctx, UIComponent parent, String relativePath) throws IOException

Used for delegation by the DefaultFaceletContext. First validates that the path does not represent a contracts resource, then pulls the URL from resolveURL(String), then calls include(DefaultFaceletContext, jakarta.faces.component.UIComponent, String).

Parameters
ctx:DefaultFaceletContext

FaceletContext to pass to the included Facelet

parent:UIComponent

UIComponent to apply changes to

relativePath:String

relative path to the desired Facelet from the FaceletContext

See Also
FaceletContext#includeFacelet(UIComponent, String)
includeback to summary
public void include(DefaultFaceletContext ctx, UIComponent parent, URL url) throws IOException

Grabs a DefaultFacelet from referenced DefaultFaceletFacotry

Parameters
ctx:DefaultFaceletContext

FaceletContext to pass to the included Facelet

parent:UIComponent

UIComponent to apply changes to

url:URL

URL source to include Facelet from

See Also
DefaultFaceletFactory#getFacelet(FacesContext, URL)
isDevelopmentback to summary
private boolean isDevelopment(FaceletContext ctx)
markAppliedback to summary
private void markApplied(UIComponent parent)
refreshback to summary
private void refresh(UIComponent c)
resolveURLback to summary
private URL resolveURL(String relativePath) throws IOException

Delegates resolution to DefaultFaceletFactory reference. Also, caches URLs for absolute paths.

Parameters
relativePath:String

a relative url path

Returns:URL

URL pointing to destination

Exceptions
IOException:
if there is a problem creating the URL for the path specified
setSavedDoctypeback to summary
public void setSavedDoctype(Doctype savedDoctype)

Implements com.sun.faces.facelets.impl.XMLFrontMatterSaver.setSavedDoctype.

Annotations
@Override
setSavedXMLDeclback to summary
public void setSavedXMLDecl(String savedXMLDecl)

Implements com.sun.faces.facelets.impl.XMLFrontMatterSaver.setSavedXMLDecl.

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. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

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

private Class DefaultFacelet.ApplyToken

extends Object
implements Externalizable
Class Inheritance
All Implemented Interfaces
java.io.Externalizable, java.io.Serializable

Field Summary

Modifier and TypeField and Description
public String
public long

Constructor Summary

AccessConstructor and Description
public
public
ApplyToken(String alias, long time)

Method Summary

Modifier and TypeMethod and Description
public void
readExternal(ObjectInput
the stream to read data from in order to restore the object
in
)

Implements java.io.Externalizable.readExternal.

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.

public void
writeExternal(ObjectOutput
the stream to write the object to
out
)

Implements java.io.Externalizable.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

aliasback to summary
public String alias
timeback to summary
public long time

Constructor Detail

ApplyTokenback to summary
public ApplyToken()
Annotations
@SuppressWarnings:UnusedDeclaration
ApplyTokenback to summary
public ApplyToken(String alias, long time)

Method Detail

readExternalback to summary
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException

Implements java.io.Externalizable.readExternal.

Doc from java.io.Externalizable.readExternal.

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.

Parameters
in:ObjectInput

the stream to read data from in order to restore the object

Annotations
@Override
Exceptions
IOException:
if I/O errors occur
ClassNotFoundException:
If the class for an object being restored cannot be found.
writeExternalback to summary
public void writeExternal(ObjectOutput out) throws IOException

Implements java.io.Externalizable.writeExternal.

Doc from java.io.Externalizable.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Parameters
out:ObjectOutput

the stream to write the object to

Annotations
@Override
Exceptions
IOException:
Includes any I/O exceptions that may occur