Top Description Fields Constructors Methods
com.sun.faces.util

public Class ComponentStruct

extends Object
implements StateHolder
Class Inheritance
All Implemented Interfaces
javax.faces.component.StateHolder
Imports
javax.faces.component.StateHolder, javax.faces.context.FacesContext

Utility class to enable partial state saving of components that have been dynamically added to the view.

Field Summary

Modifier and TypeField and Description
private String
public static final String
ADD

Marker that specifies this is an ADD.

private String
private String
private String
private String
public static final String
REMOVE

Marker that specifies this is a REMOVE.

Constructor Summary

AccessConstructor and Description
public
public
ComponentStruct(String action, String clientId, String id)

public
ComponentStruct(String action, String facetName, String parentClientId, String clientId, String id)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public String
public String
public String
public String
public String
public int

Returns:

the hashcode.
hashCode
()

Overrides java.lang.Object.hashCode.

Hash code.
public boolean
isTransient()

Implements javax.faces.component.StateHolder.isTransient.

If true, the Object implementing this interface must not participate in state saving or restoring.

public void
restoreState(FacesContext
the Faces context.
ctx
,
Object
the state.
state
)

Implements javax.faces.component.StateHolder.restoreState.

Perform any processing required to restore the state from the entries in the state Object.

public Object
saveState(FacesContext
the Faces context.
ctx
)

Implements javax.faces.component.StateHolder.saveState.

Gets the state of the instance as a Serializable Object.

public void
setTransient(boolean
boolean pass true if this Object will not participate in state saving or restoring, otherwise pass false.
trans
)

Implements javax.faces.component.StateHolder.setTransient.

Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

actionback to summary
private String action
ADDback to summary
public static final String ADD

Marker that specifies this is an ADD.

clientIdback to summary
private String clientId
facetNameback to summary
private String facetName
idback to summary
private String id
parentClientIdback to summary
private String parentClientId
REMOVEback to summary
public static final String REMOVE

Marker that specifies this is a REMOVE.

Constructor Detail

ComponentStructback to summary
public ComponentStruct()
ComponentStructback to summary
public ComponentStruct(String action, String clientId, String id)
ComponentStructback to summary
public ComponentStruct(String action, String facetName, String parentClientId, String clientId, String id)

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getActionback to summary
public String getAction()
getClientIdback to summary
public String getClientId()
getFacetNameback to summary
public String getFacetName()
getIdback to summary
public String getId()
getParentClientIdback to summary
public String getParentClientId()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Hash code.

Returns:int

the hashcode.

Annotations
@Override
isTransientback to summary
public boolean isTransient()

Implements javax.faces.component.StateHolder.isTransient.

Doc from javax.faces.component.StateHolder.isTransient.

If true, the Object implementing this interface must not participate in state saving or restoring.

Returns:boolean

true if transient, false otherwise.

Annotations
@Override
restoreStateback to summary
public void restoreState(FacesContext ctx, Object state)

Implements javax.faces.component.StateHolder.restoreState.

Doc from javax.faces.component.StateHolder.restoreState.

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the restoreState method on all those instances as well.

If the state argument is null, take no action and return.

Parameters
ctx:FacesContext

the Faces context.

state:Object

the state.

Annotations
@Override
saveStateback to summary
public Object saveState(FacesContext ctx)

Implements javax.faces.component.StateHolder.saveState.

Doc from javax.faces.component.StateHolder.saveState.

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the saveState method on all those instances as well. This method must not save the state of children and facets. That is done via the javax.faces.application.StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:


Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Parameters
ctx:FacesContext

the Faces context.

Returns:Object

the saved state.

Annotations
@Override
setTransientback to summary
public void setTransient(boolean trans)

Implements javax.faces.component.StateHolder.setTransient.

Doc from javax.faces.component.StateHolder.setTransient.

Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.

Parameters
trans:boolean

boolean pass true if this Object will not participate in state saving or restoring, otherwise pass false.

Annotations
@Override