| Method from org.apache.myfaces.custom.aliasbean.AliasBean Detail: |
public void broadcast(FacesEvent event) throws AbortProcessingException {
makeAlias();
if (event instanceof FacesEventWrapper)
{
FacesEvent originalEvent = ((FacesEventWrapper) event).getWrappedFacesEvent();
originalEvent.getComponent().broadcast(originalEvent);
}
else
{
super.broadcast(event);
}
removeAlias();
}
|
public void encodeBegin(FacesContext context) throws IOException {
makeAlias(context);
}
|
public void encodeEnd(FacesContext context) throws IOException {
removeAlias();
}
|
public String getFamily() {
return COMPONENT_FAMILY;
}
|
public String getRendererType() {
return null;
}
|
public String getValue() {
String valueExpression = alias.getValueExpression();
if (valueExpression != null)
return valueExpression;
ValueBinding vb = getValueBinding("value");
return vb != null ? _ComponentUtils.getStringValue(getFacesContext(), vb) : null;
}
|
public void handleBindings() {
makeAlias(getFacesContext());
RestoreStateUtils.recursivelyHandleComponentReferencesAndSetValid(getFacesContext(),this,true);
removeAlias(getFacesContext());
}
|
void makeAlias(FacesContext context) {
_context = context;
makeAlias();
}
|
public void processDecodes(FacesContext context) {
log.debug("processDecodes");
if (withinScope)
{
if (! alias.isActive())
makeAlias(context);
super.processDecodes(context);
return;
}
makeAlias(context);
super.processDecodes(context);
removeAlias(context);
}
|
public void processRestoreState(FacesContext context,
Object state) {
if (context == null)
throw new NullPointerException("context");
Object myState = ((Object[]) state)[0];
restoreState(context, myState);
makeAlias(context);
Map facetMap = (Map) ((Object[]) state)[1];
List childrenList = (List) ((Object[]) state)[2];
for (Iterator it = getFacets().entrySet().iterator(); it.hasNext();)
{
Map.Entry entry = (Map.Entry) it.next();
Object facetState = facetMap.get(entry.getKey());
if (facetState != null)
{
((UIComponent) entry.getValue()).processRestoreState(context, facetState);
}
else
{
context.getExternalContext().log("No state found to restore facet " + entry.getKey());
}
}
if (getChildCount() > 0)
{
int idx = 0;
for (Iterator it = getChildren().iterator(); it.hasNext();)
{
UIComponent child = (UIComponent) it.next();
Object childState = childrenList.get(idx++);
if (childState != null)
{
child.processRestoreState(context, childState);
}
else
{
context.getExternalContext().log("No state found to restore child of component " + getId());
}
}
}
removeAlias(context);
}
|
public Object processSaveState(FacesContext context) {
if (context == null)
throw new NullPointerException("context");
if (isTransient())
return null;
makeAlias(context);
Map facetMap = null;
for (Iterator it = getFacets().entrySet().iterator(); it.hasNext();)
{
Map.Entry entry = (Map.Entry) it.next();
if (facetMap == null)
facetMap = new HashMap();
UIComponent component = (UIComponent) entry.getValue();
if (!component.isTransient())
{
facetMap.put(entry.getKey(), component.processSaveState(context));
}
}
List childrenList = null;
if (getChildCount() > 0)
{
for (Iterator it = getChildren().iterator(); it.hasNext();)
{
UIComponent child = (UIComponent) it.next();
if (!child.isTransient())
{
if (childrenList == null)
childrenList = new ArrayList(getChildCount());
childrenList.add(child.processSaveState(context));
}
}
}
removeAlias(context);
return new Object[]{saveState(context), facetMap, childrenList};
}
|
public void processUpdates(FacesContext context) {
if (withinScope)
return;
log.debug("processUpdates");
makeAlias(context);
super.processUpdates(context);
removeAlias(context);
}
|
public void processValidators(FacesContext context) {
if (withinScope)
return;
log.debug("processValidators");
makeAlias(context);
super.processValidators(context);
removeAlias(context);
}
|
public void queueEvent(FacesEvent event) {
super.queueEvent(new FacesEventWrapper(event, this));
}
|
void removeAlias(FacesContext context) {
_context = context;
removeAlias();
}
|
public void restoreState(FacesContext context,
Object state) {
log.debug("restoreState");
_context = context;
Object values[] = (Object[]) state;
super.restoreState(context, values[0]);
alias.restoreState(values[1]);
}
|
public Object saveState(FacesContext context) {
log.debug("saveState");
_context = context;
return new Object[]{super.saveState(context), alias.saveState()};
}
|
public void setAlias(String aliasBeanExpression) {
alias.setAliasBeanExpression(aliasBeanExpression);
}
Define the "fictive" name which will be visible to the children
of this component as an alias to the "real" object specified
by the value attribute of this component. |
public void setValue(String valueExpression) {
alias.setValueExpression(valueExpression);
}
|