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
javax.faces.view.facelets.Facelet, .FaceletContext, .FaceletHandler, com.sun.faces.facelets.tag.jsf.ComponentSupport, com.sun.faces.util.FacesLogger, .Util, javax.el.ExpressionFactory, javax.faces.application.ProjectStage, javax.faces.component.UIComponent, javax.faces.context.FacesContext, java.io.Externalizable, .IOException, .ObjectInput, .ObjectOutput, java.net.URL, java.text.DateFormat, .SimpleDateFormat, java.util.*, java.util.logging.Level, .Logger

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 String
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 javax.faces.view.facelets.Facelet.apply.

The passed UIComponent parent will be populated/restored in accordance with the Facelets chapter in the spec prose document.

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

private URL

Returns:

URL pointing to destination
getRelativePath
(String
a relative url path
path
)

Delegates resolution to DefaultFaceletFactory reference.

public String
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
path
)

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
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
JAVAX_FACES_ERROR_XHTMLback to summary
private static final String JAVAX_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 String 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 javax.faces.view.facelets.Facelet.apply.

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

The passed UIComponent parent will be populated/restored in accordance with the Facelets chapter in the spec prose 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
com.sun.faces.facelets.Facelet#apply(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
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

getRelativePathback to summary
private URL getRelativePath(String path) throws IOException

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

Parameters
path: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
getSavedDoctypeback to summary
public String 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 path) throws IOException

Used for delegation by the DefaultFaceletContext. First pulls the URL from getRelativePath(String), then calls include(DefaultFaceletContext, javax.faces.component.UIComponent, String).

Parameters
ctx:DefaultFaceletContext

FaceletContext to pass to the included Facelet

parent:UIComponent

UIComponent to apply changes to

path: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(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)
setSavedDoctypeback to summary
public void setSavedDoctype(String 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.

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