Method from javax.faces.component.UIComponentBase Detail: |
public void addClientBehavior(String eventName,
ClientBehavior behavior) {
assertClientBehaviorHolder();
// First, make sure that the event is supported. We don't want
// to bother attaching behaviors for unsupported events.
Collection< String > eventNames = getEventNames();
// getClientEventNames() is spec'ed to require a non-null Set.
// If getClientEventNames() returns null, throw an exception
// to indicate that the API in not being used properly.
if (eventNames == null) {
throw new IllegalStateException(
"Attempting to add a Behavior to a component " +
"that does not support any event types. " +
"getEventTypes() must return a non-null Set.");
}
if (eventNames.contains(eventName)) {
if (initialStateMarked()) {
// a Behavior has been added dynamically. Update existing
// Behaviors, if any, to save their full state.
if (behaviors != null) {
for (Entry< String, List< ClientBehavior > > entry : behaviors
.entrySet()) {
for (ClientBehavior b : entry.getValue()) {
if (b instanceof PartialStateHolder) {
((PartialStateHolder) behavior).clearInitialState();
}
}
}
}
}
// We've got an event that we support, create our Map
// if necessary
if (null == behaviors) {
// Typically we only have a small number of behaviors for
// any component - in most cases only 1. Using a very small
// initial capacity so that we keep the footprint to a minimum.
Map< String, List< ClientBehavior > > modifiableMap =
new HashMap< String, List< ClientBehavior > >(5,1.0f);
behaviors = new BehaviorsMap(modifiableMap);
}
List< ClientBehavior > eventBehaviours = behaviors.get(eventName);
if (null == eventBehaviours) {
// Again using small initial capacity - we typically
// only have 1 Behavior per event type.
eventBehaviours = new ArrayList< ClientBehavior >(3);
behaviors.getModifiableMap().put(eventName, eventBehaviours);
}
eventBehaviours.add(behavior);
}
}
|
protected void addFacesListener(FacesListener listener) {
if (listener == null) {
throw new NullPointerException();
}
if (listeners == null) {
listeners = new AttachedObjectListHolder< FacesListener >();
}
listeners.add(listener);
}
Add the specified FacesListener to the set of listeners
registered to receive event notifications from this UIComponent .
It is expected that UIComponent classes acting as event sources
will have corresponding typesafe APIs for registering listeners of the
required type, and the implementation of those registration methods
will delegate to this method. For example:
public class FooEvent extends FacesEvent {
...
protected boolean isAppropriateListener(FacesListener listener) {
return (listener instanceof FooListener);
}
protected void processListener(FacesListener listener) {
((FooListener) listener).processFoo(this);
}
...
}
public interface FooListener extends FacesListener {
public void processFoo(FooEvent event);
}
public class FooComponent extends UIComponentBase {
...
public void addFooListener(FooListener listener) {
addFacesListener(listener);
}
public void removeFooListener(FooListener listener) {
removeFacesListener(listener);
}
...
}
|
public void broadcast(FacesEvent event) throws AbortProcessingException {
if (event == null) {
throw new NullPointerException();
}
if (event instanceof BehaviorEvent) {
BehaviorEvent behaviorEvent = (BehaviorEvent) event;
Behavior behavior = behaviorEvent.getBehavior();
behavior.broadcast(behaviorEvent);
}
if (listeners == null) {
return;
}
for (FacesListener listener : listeners.asArray(FacesListener.class)) {
if (event.isAppropriateListener(listener)) {
event.processListener(listener);
}
}
}
|
public void clearInitialState() {
super.clearInitialState();
if (listeners != null) {
listeners.clearInitialState();
}
if (listenersByEventClass != null) {
for (List< SystemEventListener > listener : listenersByEventClass.values()) {
if (listener instanceof PartialStateHolder) {
((PartialStateHolder) listener).clearInitialState();
}
}
}
if (behaviors != null) {
for (Entry< String, List< ClientBehavior > > entry : behaviors.entrySet()) {
for (ClientBehavior behavior : entry.getValue()) {
if (behavior instanceof PartialStateHolder) {
((PartialStateHolder) behavior).clearInitialState();
}
}
}
}
}
|
public void decode(FacesContext context) {
if (context == null) {
throw new NullPointerException();
}
String rendererType = getRendererType();
if (rendererType != null) {
Renderer renderer = this.getRenderer(context);
if (renderer != null) {
renderer.decode(context, this);
} else {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine("Can't get Renderer for type " + rendererType);
}
}
}
}
|
public void encodeBegin(FacesContext context) throws IOException {
if (context == null) {
throw new NullPointerException();
}
pushComponentToEL(context, null);
if (!isRendered()) {
return;
}
context.getApplication().publishEvent(context,
PreRenderComponentEvent.class,
this);
String rendererType = getRendererType();
if (rendererType != null) {
Renderer renderer = this.getRenderer(context);
if (renderer != null) {
renderer.encodeBegin(context, this);
} else {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine("Can't get Renderer for type " + rendererType);
}
}
}
}
|
public void encodeChildren(FacesContext context) throws IOException {
if (context == null) {
throw new NullPointerException();
}
if (!isRendered()) {
return;
}
String rendererType = getRendererType();
if (rendererType != null) {
Renderer renderer = this.getRenderer(context);
if (renderer != null) {
renderer.encodeChildren(context, this);
}
// We've already logged for this component
} else {
if (getChildCount() > 0) {
for (UIComponent child : getChildren()) {
child.encodeAll(context);
}
}
}
}
|
public void encodeEnd(FacesContext context) throws IOException {
if (context == null) {
throw new NullPointerException();
}
if (!isRendered()) {
popComponentFromEL(context);
return;
}
String rendererType = getRendererType();
if (rendererType != null) {
Renderer renderer = this.getRenderer(context);
if (renderer != null) {
renderer.encodeEnd(context, this);
} else {
// We've already logged for this component
}
}
popComponentFromEL(context);
}
|
public UIComponent findComponent(String expr) {
if (expr == null) {
throw new NullPointerException();
}
FacesContext ctx = FacesContext.getCurrentInstance();
final char sepChar = UINamingContainer.getSeparatorChar(ctx);
final String SEPARATOR_STRING = String.valueOf(sepChar);
if (expr.length() == 0) {
// if an empty value is provided, fail fast.
throw new IllegalArgumentException("\"\"");
}
// Identify the base component from which we will perform our search
UIComponent base = this;
if (expr.charAt(0) == sepChar) {
// Absolute searches start at the root of the tree
while (base.getParent() != null) {
base = base.getParent();
}
// Treat remainder of the expression as relative
expr = expr.substring(1);
} else if (!(base instanceof NamingContainer)) {
// Relative expressions start at the closest NamingContainer or root
while (base.getParent() != null) {
if (base instanceof NamingContainer) {
break;
}
base = base.getParent();
}
}
// Evaluate the search expression (now guaranteed to be relative)
UIComponent result = null;
String[] segments = expr.split(SEPARATOR_STRING);
for (int i = 0, length = (segments.length - 1);
i < segments.length;
i++, length--) {
result = findComponent(base, segments[i], (i == 0));
// the first element of the expression may match base.id
// (vs. a child if of base)
if (i == 0 && result == null &&
segments[i].equals(base.getId())) {
result = base;
}
if (result != null && (!(result instanceof NamingContainer)) && length > 0) {
throw new IllegalArgumentException(segments[i]);
}
if (result == null) {
break;
}
base = result;
}
// Return the final result of our search
return (result);
}
|
public Map<String, Object> getAttributes() {
if (attributes == null) {
attributes = new AttributesMap(this);
}
return (attributes);
}
|
public int getChildCount() {
if (children != null) {
return (children.size());
} else {
return (0);
}
}
|
public List<UIComponent> getChildren() {
if (children == null) {
children = new ChildrenList(this);
}
return (children);
}
|
public Map<ClientBehavior> getClientBehaviors() {
if (null == behaviors) {
return Collections.emptyMap();
}
return behaviors;
}
|
public String getClientId(FacesContext context) {
if (context == null) {
throw new NullPointerException();
}
// if the clientId is not yet set
if (this.clientId == null) {
UIComponent namingContainerAncestor =
this.getNamingContainerAncestor();
UIComponent parent = namingContainerAncestor;
String parentId = null;
// give the parent the opportunity to first
// grab a unique clientId
if (parent != null) {
parentId = parent.getContainerClientId(context);
}
// now resolve our own client id
this.clientId = getId();
if (this.clientId == null) {
String generatedId;
if (null != namingContainerAncestor &&
namingContainerAncestor instanceof UniqueIdVendor) {
generatedId = ((UniqueIdVendor)namingContainerAncestor).createUniqueId(context, null);
}
else {
generatedId = context.getViewRoot().createUniqueId();
}
setId(generatedId);
this.clientId = getId();
}
if (parentId != null) {
StringBuilder idBuilder =
new StringBuilder(parentId.length()
+ 1
+ this.clientId.length());
this.clientId = idBuilder.append(parentId)
.append(UINamingContainer.getSeparatorChar(context))
.append(this.clientId).toString();
}
// allow the renderer to convert the clientId
Renderer renderer = this.getRenderer(context);
if (renderer != null) {
this.clientId = renderer.convertClientId(context, this.clientId);
}
}
return this.clientId;
}
|
public String getDefaultEventName() {
assertClientBehaviorHolder();
// Our default implementation just returns null - no default
// event name;
return null;
}
|
Map<String, PropertyDescriptor> getDescriptorMap() {
return pdMap;
}
|
public Collection<String> getEventNames() {
assertClientBehaviorHolder();
// Note: we intentionally return null here even though this
// is not a valid value. The result is that addClientBehavior()
// will fail with an IllegalStateException if getEventNames()
// is not overridden. This should make it obvious to the
// component author that something is wrong.
return null;
}
|
protected FacesContext getFacesContext() {
// PENDING(edburns): we can't use the cache ivar because we
// don't always know when to clear it. For example, in the
// "save state in server" case, the UIComponent instances stick
// around between requests, yielding stale facesContext
// references. If there was some way to clear the facesContext
// cache ivar for each node in the tree *after* the
// render-response phase, then we could keep a cache ivar. As
// it is now, we must always use the Thread Local Storage
// solution.
return FacesContext.getCurrentInstance();
}
|
protected FacesListener[] getFacesListeners(Class clazz) {
if (clazz == null) {
throw new NullPointerException();
}
if (!FacesListener.class.isAssignableFrom(clazz)) {
throw new IllegalArgumentException();
}
if (this.listeners == null) {
return (FacesListener[]) Array.newInstance(clazz, 0);
}
FacesListener[] listeners = this.listeners.asArray(FacesListener.class);
if (listeners.length == 0) {
return (FacesListener[]) Array.newInstance(clazz, 0);
}
List< FacesListener > results = new ArrayList< FacesListener >(listeners.length);
for (FacesListener listener : listeners) {
if (((Class< ? >) clazz).isAssignableFrom(listener.getClass())) {
results.add(listener);
}
}
return (results.toArray
((FacesListener[]) Array.newInstance(clazz,
results.size())));
}
|
public UIComponent getFacet(String name) {
if (facets != null) {
return (facets.get(name));
} else {
return (null);
}
}
|
public int getFacetCount() {
if (facets != null) {
return (facets.size());
} else {
return (0);
}
}
|
public Map<String, UIComponent> getFacets() {
if (facets == null) {
facets = new FacetsMap(this);
}
return (facets);
}
|
public Iterator<UIComponent> getFacetsAndChildren() {
Iterator< UIComponent > result;
int childCount = this.getChildCount(),
facetCount = this.getFacetCount();
// If there are neither facets nor children
if (0 == childCount && 0 == facetCount) {
result = EMPTY_ITERATOR;
}
// If there are only facets and no children
else if (0 == childCount) {
Collection< UIComponent > unmodifiable =
Collections.unmodifiableCollection(getFacets().values());
result = unmodifiable.iterator();
}
// If there are only children and no facets
else if (0 == facetCount) {
List< UIComponent > unmodifiable =
Collections.unmodifiableList(getChildren());
result = unmodifiable.iterator();
}
// If there are both children and facets
else {
result = new FacetsAndChildrenIterator(this);
}
return result;
}
|
public String getId() {
return (id);
}
|
public UIComponent getParent() {
return (this.parent);
}
|
protected Renderer getRenderer(FacesContext context) {
String rendererType = getRendererType();
Renderer result = null;
if (rendererType != null) {
result = context.getRenderKit().getRenderer(getFamily(),
rendererType);
if (null == result) {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine("Can't get Renderer for type " + rendererType);
}
}
} else {
if (LOGGER.isLoggable(Level.FINE)) {
String id = this.getId();
id = (null != id) ? id : this.getClass().getName();
LOGGER.fine("No renderer-type for component " + id);
}
}
return result;
}
|
public String getRendererType() {
return (String) getStateHelper().eval(PropertyKeys.rendererType);
}
|
public boolean getRendersChildren() {
boolean result = false;
Renderer renderer;
if (getRendererType() != null) {
if (null !=
(renderer = getRenderer(getFacesContext()))) {
result = renderer.getRendersChildren();
}
}
return result;
}
|
public ValueBinding getValueBinding(String name) {
if (name == null) {
throw new NullPointerException();
}
ValueBinding result = null;
ValueExpression ve;
if (null != (ve = getValueExpression(name))) {
// if the ValueExpression is an instance of our private
// wrapper class.
if (ve.getClass().equals(ValueExpressionValueBindingAdapter.class)) {
result = ((ValueExpressionValueBindingAdapter) ve).getWrapped();
} else {
// otherwise, this is a real ValueExpression. Wrap it
// in a ValueBinding.
result = new ValueBindingValueExpressionAdapter(ve);
}
}
return result;
} Deprecated! This - has been replaced by #getValueExpression .
|
public boolean invokeOnComponent(FacesContext context,
String clientId,
ContextCallback callback) throws FacesException {
return super.invokeOnComponent(context, clientId, callback);
}
|
public boolean isRendered() {
return Boolean.valueOf(getStateHelper().eval(PropertyKeys.rendered, Boolean.TRUE).toString());
}
|
public boolean isTransient() {
return (this.transientFlag);
}
|
public void markInitialState() {
super.markInitialState();
if (listeners != null) {
listeners.markInitialState();
}
if (listenersByEventClass != null) {
for (List< SystemEventListener > listener : listenersByEventClass.values()) {
if (listener instanceof PartialStateHolder) {
((PartialStateHolder) listener).markInitialState();
}
}
}
if (behaviors != null) {
for (Entry< String, List< ClientBehavior > > entry : behaviors.entrySet()) {
for (ClientBehavior behavior : entry.getValue()) {
if (behavior instanceof PartialStateHolder) {
((PartialStateHolder) behavior).markInitialState();
}
}
}
}
}
|
public void processDecodes(FacesContext context) {
if (context == null) {
throw new NullPointerException();
}
// Skip processing if our rendered flag is false
if (!isRendered()) {
return;
}
pushComponentToEL(context, null);
// Process all facets and children of this component
Iterator kids = getFacetsAndChildren();
while (kids.hasNext()) {
UIComponent kid = (UIComponent) kids.next();
kid.processDecodes(context);
}
// Process this component itself
try {
decode(context);
} catch (RuntimeException e) {
context.renderResponse();
throw e;
} finally {
popComponentFromEL(context);
}
}
|
public void processRestoreState(FacesContext context,
Object state) {
if (context == null) {
throw new NullPointerException();
}
Object[] stateStruct = (Object[]) state;
Object[] childState = (Object[]) stateStruct[CHILD_STATE];
// Process this component itself
restoreState(context, stateStruct[MY_STATE]);
int i = 0;
// Process all the children of this component
if (this.getChildCount() > 0) {
for (UIComponent kid : getChildren()) {
if (kid.isTransient()) {
continue;
}
Object currentState = childState[i++];
if (currentState == null) {
continue;
}
pushComponentToEL(context, null);
kid.processRestoreState(context, currentState);
popComponentFromEL(context);
}
}
// process all of the facets of this component
if (this.getFacetCount() > 0) {
int facetsSize = getFacets().size();
int j = 0;
Object[] facetSaveState;
String facetName;
UIComponent facet;
Object facetState;
while (j < facetsSize) {
if (null != (facetSaveState = (Object[]) childState[i++])) {
facetName = (String) facetSaveState[0];
facetState = facetSaveState[1];
facet = getFacets().get(facetName);
pushComponentToEL(context, null);
facet.processRestoreState(context, facetState);
popComponentFromEL(context);
}
++j;
}
}
}
|
public Object processSaveState(FacesContext context) {
if (context == null) {
throw new NullPointerException();
}
if (this.isTransient()) {
return null;
}
Object[] stateStruct = new Object[2];
Object[] childState = EMPTY_ARRAY;
pushComponentToEL(context, null);
// Process this component itself
stateStruct[MY_STATE] = saveState(context);
// determine if we have any children to store
int count = this.getChildCount() + this.getFacetCount();
if (count > 0) {
// this arraylist will store state
List< Object > stateList = new ArrayList< Object >(count);
// if we have children, add them to the stateList
if (this.getChildCount() > 0) {
Iterator kids = getChildren().iterator();
UIComponent kid;
while (kids.hasNext()) {
kid = (UIComponent) kids.next();
if (!kid.isTransient()) {
stateList.add(kid.processSaveState(context));
popComponentFromEL(context);
}
}
}
pushComponentToEL(context, null);
// if we have facets, add them to the stateList
if (this.getFacetCount() > 0) {
Iterator myFacets = getFacets().entrySet().iterator();
UIComponent facet;
Object facetState;
Object[] facetSaveState;
Map.Entry entry;
while (myFacets.hasNext()) {
entry = (Map.Entry) myFacets.next();
facet = (UIComponent) entry.getValue();
if (!facet.isTransient()) {
facetState = facet.processSaveState(context);
popComponentFromEL(context);
facetSaveState = new Object[2];
facetSaveState[0] = entry.getKey();
facetSaveState[1] = facetState;
stateList.add(facetSaveState);
}
}
}
// finally, capture the stateList and replace the original,
// EMPTY_OBJECT_ARRAY Object array
childState = stateList.toArray();
}
stateStruct[CHILD_STATE] = childState;
return stateStruct;
}
|
public void processUpdates(FacesContext context) {
if (context == null) {
throw new NullPointerException();
}
// Skip processing if our rendered flag is false
if (!isRendered()) {
return;
}
pushComponentToEL(context, null);
// Process all facets and children of this component
Iterator kids = getFacetsAndChildren();
while (kids.hasNext()) {
UIComponent kid = (UIComponent) kids.next();
kid.processUpdates(context);
}
popComponentFromEL(context);
}
|
public void processValidators(FacesContext context) {
if (context == null) {
throw new NullPointerException();
}
// Skip processing if our rendered flag is false
if (!isRendered()) {
return;
}
pushComponentToEL(context, null);
Application app = context.getApplication();
app.publishEvent(context, PreValidateEvent.class, this);
// Process all the facets and children of this component
Iterator kids = getFacetsAndChildren();
while (kids.hasNext()) {
UIComponent kid = (UIComponent) kids.next();
kid.processValidators(context);
}
app.publishEvent(context, PostValidateEvent.class, this);
popComponentFromEL(context);
}
|
public void queueEvent(FacesEvent event) {
if (event == null) {
throw new NullPointerException();
}
UIComponent parent = getParent();
if (parent == null) {
throw new IllegalStateException();
} else {
parent.queueEvent(event);
}
}
|
protected void removeFacesListener(FacesListener listener) {
if (listener == null) {
throw new NullPointerException();
}
if (listeners != null) {
listeners.remove(listener);
}
}
Remove the specified FacesListener from the set of listeners
registered to receive event notifications from this UIComponent .
|
public static Object restoreAttachedState(FacesContext context,
Object stateObj) throws IllegalStateException {
if (null == context) {
throw new NullPointerException();
}
if (null == stateObj) {
return null;
}
Object result;
if (stateObj instanceof List) {
List< StateHolderSaver > stateList = (List< StateHolderSaver >) stateObj;
Collection< Object > retCollection = null;
StateHolderSaver collectionSaver = stateList.get(0);
Class collectionClass = (Class) collectionSaver.restore(context);
try {
retCollection = (Collection< Object >) collectionClass.newInstance();
}
catch (Exception e) {
if (LOGGER.isLoggable(Level.SEVERE)) {
LOGGER.log(Level.SEVERE, e.toString(), e);
}
throw new IllegalStateException("Unknown object type");
}
for (int i = 1, len = stateList.size(); i < len; i++) {
try {
retCollection.add(stateList.get(i).restore(context));
} catch (ClassCastException cce) {
if (LOGGER.isLoggable(Level.SEVERE)) {
LOGGER.log(Level.SEVERE, cce.toString(), cce);
}
throw new IllegalStateException("Unknown object type");
}
}
result = retCollection;
} else if (stateObj instanceof StateHolderSaver) {
StateHolderSaver saver = (StateHolderSaver) stateObj;
result = saver.restore(context);
} else {
throw new IllegalStateException("Unknown object type");
}
return result;
}
|
public void restoreState(FacesContext context,
Object state) {
if (context == null) {
throw new NullPointerException();
}
if (state == null) {
return;
}
values = (Object[]) state;
if (values[0] != null) {
if (listeners == null) {
listeners = new AttachedObjectListHolder< FacesListener >();
}
listeners.restoreState(context, values[0]);
}
if (values[1] != null) {
Map m = restoreSystemEventListeners(context, values[1]);
if (listenersByEventClass != null) {
listenersByEventClass.putAll(m);
} else {
listenersByEventClass = m;
}
}
if (values[2] != null) {
behaviors = restoreBehaviorsState(context, values[2]);
}
if (values[3] != null) {
bindings = restoreBindingsState(context, values[3]);
}
if(values[4] != null) {
getStateHelper().restoreState(getFacesContext(), values[4]);
}
if (values.length == 6) {
// this means we've saved full state and need to do a little more
// work to finish the job
if (values[5] != null) {
id = (String) values[5];
}
}
}
|
public static Object saveAttachedState(FacesContext context,
Object attachedObject) {
if (null == context) {
throw new NullPointerException();
}
if (null == attachedObject) {
return null;
}
Object result;
if (attachedObject instanceof Collection) {
Collection attachedCollection = (Collection) attachedObject;
List< StateHolderSaver > resultList = null;
for (Object item : attachedCollection) {
if (item != null) {
if (item instanceof StateHolder && ((StateHolder) item).isTransient()) {
continue;
}
if (resultList == null) {
resultList = new ArrayList< StateHolderSaver >(attachedCollection.size() + 1);
resultList.add(new StateHolderSaver(context, attachedCollection.getClass()));
}
resultList.add(new StateHolderSaver(context, item));
}
}
result = resultList;
} else {
result = new StateHolderSaver(context, attachedObject);
}
return result;
}
This method is called by UIComponent subclasses that want to save one or more attached
objects. It is a convenience method that does the work of saving
attached objects that may or may not implement the StateHolder interface. Using this method implies the use of
#restoreAttachedState to restore the attached
objects.
This method supports saving attached objects of the following
type: Object s, null values, and Collection s of these objects.
If any contained objects are not Collection s and do not
implement StateHolder , they must have zero-argument
public constructors. The exact structure of the returned object
is undefined and opaque, but will be serializable.
|
public Object saveState(FacesContext context) {
if (context == null) {
throw new NullPointerException();
}
assert (!transientFlag);
if (initialStateMarked()) {
Object savedFacesListeners = ((listeners != null) ? listeners.saveState(context) : null);
Object savedSysEventListeners = saveSystemEventListeners(context);
Object savedBehaviors = saveBehaviorsState(context);
Object savedBindings = null;
if (bindings != null) {
savedBindings = saveBindingsState(context);
}
Object savedHelper = null;
if (stateHelper != null) {
savedHelper = stateHelper.saveState(getFacesContext());
}
if (savedFacesListeners == null
&& savedSysEventListeners == null
&& savedBehaviors == null
&& savedBindings == null
&& savedHelper == null) {
return null;
} else {
if (values == null || values.length != 5) {
values = new Object[5];
}
// since we're saving partial state, skip id and clientId
// as this will be reconstructed from the template execution
// when the view is restored
values[0] = savedFacesListeners;
values[1] = savedSysEventListeners;
values[2] = savedBehaviors;
values[3] = savedBindings;
values[4] = savedHelper;
return values;
}
} else {
if (values == null || values.length != 6) {
values = new Object[6];
}
values[0] = ((listeners != null) ? listeners.saveState(context) : null);
values[1] = saveSystemEventListeners(context);
values[2] = saveBehaviorsState(context);
if (bindings != null) {
values[3] = saveBindingsState(context);
}
if (stateHelper != null) {
values[4] = stateHelper.saveState(getFacesContext());
}
values[5] = id;
return (values);
}
}
|
public void setId(String id) {
// if the current ID is not null, and the passed
// argument is the same, no need to validate it
// as it has already been validated.
if (this.id == null || !(this.id.equals(id))) {
validateId(id);
this.id = id;
}
this.clientId = null; // Erase any cached value
}
|
public void setParent(UIComponent parent) {
if (parent == null) {
if (this.parent != null) {
doPreRemoveProcessing(FacesContext.getCurrentInstance(), this);
this.parent = parent;
}
compositeParent = null;
} else {
this.parent = parent;
if (this.getAttributes().get(ADDED) == null) {
// add an attribute to this component here to indiciate that
// it's being processed. If we don't do this, and the component
// is re-parented, the events could fire again in certain cases
// and cause a stack overflow.
this.getAttributes().put(ADDED, Boolean.TRUE);
doPostAddProcessing(FacesContext.getCurrentInstance(), this);
// remove the attribute once we've returned from the event
// processing.
this.getAttributes().remove(ADDED);
}
}
}
|
public void setRendered(boolean rendered) {
getStateHelper().put(PropertyKeys.rendered, rendered);
}
|
public void setRendererType(String rendererType) {
getStateHelper().put(PropertyKeys.rendererType, rendererType);
}
|
public void setTransient(boolean transientFlag) {
this.transientFlag = transientFlag;
}
|
public void setValueBinding(String name,
ValueBinding binding) {
if (name == null) {
throw new NullPointerException();
}
if (binding != null) {
ValueExpressionValueBindingAdapter adapter =
new ValueExpressionValueBindingAdapter(binding);
setValueExpression(name, adapter);
} else {
setValueExpression(name, null);
}
} Deprecated! This - has been replaced by #setValueExpression .
|