org.apache.myfaces.custom.loadbundle
Class AbstractLoadBundle

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by org.apache.myfaces.custom.loadbundle.AbstractLoadBundle
All Implemented Interfaces:
javax.faces.component.StateHolder

public abstract class AbstractLoadBundle
extends javax.faces.component.UIComponentBase
implements javax.faces.component.StateHolder

Extended loadbundle which does its job in all life-cycle phases or even on calling LoadBundle.loadBundle() - not only when rendering happens... A load-bundle alternative which allows to use load-bundle even on AJAX-enabled pages.

A component that allows to load bundles not only on rendering, but whenever the page author needs it. By default, it loads it on every lifecycle phase except restore-state and save-state.*

The core-load-bundle only loads its message-bundle on rendering - this load-bundle does it on every life-cycle, and optionally whenever the method loadBundle is called.

Author:
Martin Marinschek

Field Summary
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
 
Fields inherited from class javax.faces.component.UIComponent
bindings
 
Constructor Summary
AbstractLoadBundle()
           
 
Method Summary
 void broadcast(javax.faces.event.FacesEvent event)
           
 void encodeBegin(javax.faces.context.FacesContext context)
           
 void encodeEnd(javax.faces.context.FacesContext context)
           
abstract  java.lang.String getBasename()
          Path to the bundle-file in the class-path, e.g.: org.apache.myfaces.i18n.myprops
abstract  java.lang.String getVar()
          Variable this bundle will be stored under, e.g.
 void loadBundle()
           
 void processDecodes(javax.faces.context.FacesContext context)
           
 void processRestoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object processSaveState(javax.faces.context.FacesContext context)
           
 void processUpdates(javax.faces.context.FacesContext context)
           
 void processValidators(javax.faces.context.FacesContext context)
           
 void queueEvent(javax.faces.event.FacesEvent event)
           
abstract  void setBasename(java.lang.String basename)
           
abstract  void setVar(java.lang.String var)
           
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, decode, encodeChildren, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getFamily, getValueExpression, setValueExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.faces.component.StateHolder
isTransient, restoreState, saveState, setTransient
 

Field Detail

COMPONENT_TYPE

public static final java.lang.String COMPONENT_TYPE
See Also:
Constant Field Values

COMPONENT_FAMILY

public static final java.lang.String COMPONENT_FAMILY
See Also:
Constant Field Values
Constructor Detail

AbstractLoadBundle

public AbstractLoadBundle()
Method Detail

getBasename

public abstract java.lang.String getBasename()
Path to the bundle-file in the class-path, e.g.: org.apache.myfaces.i18n.myprops


setBasename

public abstract void setBasename(java.lang.String basename)

getVar

public abstract java.lang.String getVar()
Variable this bundle will be stored under, e.g. mybundle. Use #{mybundle.propertykey} or #{mybundle['propertykey']} to access the keys of the bundle.


setVar

public abstract void setVar(java.lang.String var)

processSaveState

public java.lang.Object processSaveState(javax.faces.context.FacesContext context)
Overrides:
processSaveState in class javax.faces.component.UIComponentBase

processRestoreState

public void processRestoreState(javax.faces.context.FacesContext context,
                                java.lang.Object state)
Overrides:
processRestoreState in class javax.faces.component.UIComponentBase

processValidators

public void processValidators(javax.faces.context.FacesContext context)
Overrides:
processValidators in class javax.faces.component.UIComponentBase

processDecodes

public void processDecodes(javax.faces.context.FacesContext context)
Overrides:
processDecodes in class javax.faces.component.UIComponentBase

processUpdates

public void processUpdates(javax.faces.context.FacesContext context)
Overrides:
processUpdates in class javax.faces.component.UIComponentBase

encodeBegin

public void encodeBegin(javax.faces.context.FacesContext context)
                 throws java.io.IOException
Overrides:
encodeBegin in class javax.faces.component.UIComponentBase
Throws:
java.io.IOException

encodeEnd

public void encodeEnd(javax.faces.context.FacesContext context)
               throws java.io.IOException
Overrides:
encodeEnd in class javax.faces.component.UIComponentBase
Throws:
java.io.IOException

queueEvent

public void queueEvent(javax.faces.event.FacesEvent event)
Overrides:
queueEvent in class javax.faces.component.UIComponentBase

broadcast

public void broadcast(javax.faces.event.FacesEvent event)
               throws javax.faces.event.AbortProcessingException
Overrides:
broadcast in class javax.faces.component.UIComponentBase
Throws:
javax.faces.event.AbortProcessingException

loadBundle

public void loadBundle()


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.