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 the renderKitWrapperFactory to this instance.
 javax.faces.render.RenderKit create(javax.faces.render.RenderKit renderKit)
          Creates a RenderKit wrapper when it is not deactivated.
protected abstract  javax.faces.render.RenderKit createWrapper(javax.faces.render.RenderKit renderKit)
          Create the wrapper for the renderKit.
 void deactivate()
          Set this instance an not active.
protected  boolean isApplicationInitialized()
          Checks if the JSF application is fully initialized.
 boolean isDeactivated()
          Checks if this instance is not active.
 
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 the renderKitWrapperFactory to this instance. If it has already a RenderKitWrapperFactory, it is added to that instance, so that we have a chain of RenderKitWrapperFactory's.

Parameters:
renderKitWrapperFactory - The renderKitWrapperFactory to add.

deactivate

public void deactivate()
Set this instance an not active.


isDeactivated

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

Returns:
is it deactivated?

create

public final javax.faces.render.RenderKit create(javax.faces.render.RenderKit renderKit)
Creates a RenderKit wrapper when it is not deactivated. When we have a chain of RenderKitWrapperFactory, the next instance in the chain is asked to create the RenderKit instance. The actual creation is performed by the abstract createWrapper method.

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 renderKit. The main purpose of the wrapper is that we can wrap the renderers so that additional functionality can be performed (like Validation during the decode value)

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-2013 The Apache Software Foundation. All Rights Reserved.