org.apache.myfaces.extensions.validator.core.renderkit
Class AbstractRenderKitWrapperFactory

java.lang.Object
  extended by org.apache.myfaces.extensions.validator.core.renderkit.AbstractRenderKitWrapperFactory
All Implemented Interfaces:
ClassMappingFactory<javax.faces.render.RenderKit,javax.faces.render.RenderKit>
Direct Known Subclasses:
DefaultRenderKitWrapperFactory, GenericRenderKitWrapperFactory

public abstract class AbstractRenderKitWrapperFactory
extends Object
implements ClassMappingFactory<javax.faces.render.RenderKit,javax.faces.render.RenderKit>

Base for all RenderKitWrapperFactories to force a specific behaviour. Subclasses need to specify the logic to create the wrappers.

Since:
1.x.1

Field Summary
protected  Logger logger
           
protected  AbstractRenderKitWrapperFactory wrapped
           
 
Constructor Summary
protected AbstractRenderKitWrapperFactory()
           
 
Method Summary
 void addRenderKitWrapperFactory(AbstractRenderKitWrapperFactory renderKitWrapperFactory)
          Adds a AbstractRenderKitWrapperFactory which should be used before the default behavior gets executed (as fallback).
 javax.faces.render.RenderKit create(javax.faces.render.RenderKit renderKit)
          Wraps the given RenderKit to allow RendererInterceptors.
protected abstract  javax.faces.render.RenderKit createWrapper(javax.faces.render.RenderKit renderKit)
          Create the wrapper for the given RenderKit.
 void deactivate()
          Deactivates the current instance (and it's wrapped instance/s)
protected  boolean isApplicationInitialized()
          Checks if the JSF application is fully initialized.
 boolean isDeactivated()
          Checks if this instance is active or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final Logger logger

wrapped

protected AbstractRenderKitWrapperFactory wrapped
Constructor Detail

AbstractRenderKitWrapperFactory

protected AbstractRenderKitWrapperFactory()
Method Detail

addRenderKitWrapperFactory

public void addRenderKitWrapperFactory(AbstractRenderKitWrapperFactory renderKitWrapperFactory)
Adds a AbstractRenderKitWrapperFactory which should be used before the default behavior gets executed (as fallback). If there's already a wrapped instance, the new instance gets added as wrapped instance to the existing wrapped instance, so that we have a chain of RenderKitWrapperFactory's.

Parameters:
renderKitWrapperFactory - The renderKitWrapperFactory to add.

deactivate

public void deactivate()
Deactivates the current instance (and it's wrapped instance/s)


isDeactivated

public boolean isDeactivated()
Checks if this instance is active or not.

Returns:
true if the instance is deactivated - false otherwise

create

public final javax.faces.render.RenderKit create(javax.faces.render.RenderKit renderKit)
Wraps the given RenderKit to allow RendererInterceptors. When we have a chain of RenderKitWrapperFactories, the next instance in the chain is asked to wrap the RenderKit instance. The actual creation is performed by the abstract method createWrapper(javax.faces.render.RenderKit).

Specified by:
create in interface ClassMappingFactory<javax.faces.render.RenderKit,javax.faces.render.RenderKit>
Parameters:
renderKit - The renderKit to use.
Returns:
The new RenderKit

createWrapper

protected abstract javax.faces.render.RenderKit createWrapper(javax.faces.render.RenderKit renderKit)
Create the wrapper for the given RenderKit.

Parameters:
renderKit - The renderKit to use.
Returns:
Wrapped version of the RenderKit

isApplicationInitialized

protected boolean isApplicationInitialized()
Checks if the JSF application is fully initialized. simple test for early config in case of mojarra (incl. the combination with trinidad). use a custom extval context impl. (see EXTVAL-58) to optimize this check for the target runtime. this check works for all current implementations since the jsf internals are autom. ready during a request

Returns:
true if the jsf impl. is initialized and it's possible to use it as expected


Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.