Top Description Inners Fields Constructors Methods
com.sun.faces.component.visit

public Class PartialVisitContext

extends VisitContext
Class Inheritance
Imports
javax.faces.component.visit.*, java.util.AbstractCollection, .ArrayList, .Collection, .Collections, .EnumSet, .HashMap, .HashSet, .Iterator, .Map, .Set, javax.faces.component.UIComponent, .UINamingContainer, .NamingContainer, javax.faces.context.FacesContext

A VisitContext implementation that is used when performing a partial component tree visit.

RELEASE_PENDING
Since
2.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class

Field Summary

Modifier and TypeField and Description
private Collection<String>
private FacesContext
private Set<VisitHint>
private Collection<String>
private Map<String, Collection<String>>
private Collection<String>
Inherited from javax.faces.component.visit.VisitContext:
ALL_IDS

Constructor Summary

AccessConstructor and Description
public
PartialVisitContext(FacesContext
the FacesContext for the current request
facesContext
,
Collection<String>
the client ids of the components to visit
clientIds
)

Creates a PartialVisitorContext instance.

public
PartialVisitContext(FacesContext
the FacesContext for the current request
facesContext
,
Collection<String>
the client ids of the components to visit
clientIds
,
Set<VisitHint>
a the VisitHints for this visit
hints
)

Creates a PartialVisitorContext instance with the specified hints.

Method Summary

Modifier and TypeMethod and Description
private void
public FacesContext
getFacesContext()

Implements abstract javax.faces.component.visit.VisitContext.getFacesContext.

Returns the FacesContext for the current request.

public Set<VisitHint>
getHints()

Implements abstract javax.faces.component.visit.VisitContext.getHints.

Returns hints that influence the behavior of the tree visit.

private String
public Collection<String>
getIdsToVisit()

Implements abstract javax.faces.component.visit.VisitContext.getIdsToVisit.

Returns the ids of the components to visit.

public Collection<String>
getSubtreeIdsToVisit(UIComponent
a NamingContainer component
component
)

Implements abstract javax.faces.component.visit.VisitContext.getSubtreeIdsToVisit.

Given a javax.faces.component.NamingContainer component, returns the client ids of any components underneath the NamingContainer that should be visited.

public Collection<String>
private String
private void
idAdded(String clientId)

private void
idRemoved(String clientId)

private void
public VisitResult
invokeVisitCallback(UIComponent
the component to visit
component
,
VisitCallback
the VisitCallback to call
callback
)

Implements abstract javax.faces.component.visit.VisitContext.invokeVisitCallback.

Called by UIComponent.visitTree() to visit a single component.

private void
Inherited from javax.faces.component.visit.VisitContext:
createVisitContextcreateVisitContext

Field Detail

clientIdsback to summary
private Collection<String> clientIds
facesContextback to summary
private FacesContext facesContext
hintsback to summary
private Set<VisitHint> hints
idsback to summary
private Collection<String> ids
subtreeClientIdsback to summary
private Map<String, Collection<String>> subtreeClientIds
unvisitedClientIdsback to summary
private Collection<String> unvisitedClientIds

Constructor Detail

PartialVisitContextback to summary
public PartialVisitContext(FacesContext facesContext, Collection<String> clientIds)

Creates a PartialVisitorContext instance.

Parameters
facesContext:FacesContext

the FacesContext for the current request

clientIds:Collection<String>

the client ids of the components to visit

Exceptions
NullPointerException:
if facesContext is null
PartialVisitContextback to summary
public PartialVisitContext(FacesContext facesContext, Collection<String> clientIds, Set<VisitHint> hints)

Creates a PartialVisitorContext instance with the specified hints.

Parameters
facesContext:FacesContext

the FacesContext for the current request

clientIds:Collection<String>

the client ids of the components to visit

hints:Set<VisitHint>

a the VisitHints for this visit

Exceptions
NullPointerException:
if facesContext is null

Method Detail

addSubtreeClientIdback to summary
private void addSubtreeClientId(String clientId)
getFacesContextback to summary
public FacesContext getFacesContext()

Implements abstract javax.faces.component.visit.VisitContext.getFacesContext.

Doc from javax.faces.component.visit.VisitContext.getFacesContext.

Returns the FacesContext for the current request.

Returns:FacesContext

the FacesContext.

Annotations
@Override
See Also
VisitContext.getFacesContext()
getHintsback to summary
public Set<VisitHint> getHints()

Implements abstract javax.faces.component.visit.VisitContext.getHints.

Doc from javax.faces.component.visit.VisitContext.getHints.

Returns hints that influence the behavior of the tree visit.

Interested parties, such as UIComponent.visitTree() implementations, may check to see whether a particular hint is present by calling VisitContext.getHints().contains(), passing in one of the hints defined by VisitHint.

Returns:Set<VisitHint>

a non-empty, unmodifiable collection of VisitHints

Annotations
@Override
See Also
VisitContext.getHints
getIdFromClientIdback to summary
private String getIdFromClientId(String clientId)
getIdsToVisitback to summary
public Collection<String> getIdsToVisit()

Implements abstract javax.faces.component.visit.VisitContext.getIdsToVisit.

Doc from javax.faces.component.visit.VisitContext.getIdsToVisit.

Returns the ids of the components to visit.

In the case of a full tree visit, this method returns the ALL_IDS collection. Otherwise, if a partial visit is beign performed, returns a modifiable collection containing the client ids of the components that should be visited.

Returns:Collection<String>

the ids of the components to visit

Annotations
@Override
See Also
VisitContext.getIdsToVisit()
getSubtreeIdsToVisitback to summary
public Collection<String> getSubtreeIdsToVisit(UIComponent component)

Implements abstract javax.faces.component.visit.VisitContext.getSubtreeIdsToVisit.

Doc from javax.faces.component.visit.VisitContext.getSubtreeIdsToVisit.

Given a javax.faces.component.NamingContainer component, returns the client ids of any components underneath the NamingContainer that should be visited.

This method is called by NamingContainer visitTree() implementations to determine whether the NamingContainer contains components to be visited. In the case where no such components exist, the NamingContainer can short-circuit the tree visit and avoid descending into child subtrees.

In addition, iterating components such as UIData may be able to use the returned ids to determine which iterated states (ie. rows) need to be visited. This allows the visit traversal to be contstrained such only those rows that contain visit targets need to be traversed.

Parameters
component:UIComponent

a NamingContainer component

Returns:Collection<String>

an unmodifiable Collection containing the client ids of any components underneath the NamingContainer that are known to be targets of the tree visit. If no such components exist, returns an empty Collection. If all components underneath the NamingContainer should be visited, returns the VisitContext.ALL_IDS collection.

Annotations
@Override
See Also
VisitContext.getSubtreeIdsToVisit()
getUnvisitedClientIdsback to summary
public Collection<String> getUnvisitedClientIds()
getVisitIdback to summary
private String getVisitId(UIComponent component)
idAddedback to summary
private void idAdded(String clientId)
idRemovedback to summary
private void idRemoved(String clientId)
initializeCollectionsback to summary
private void initializeCollections(Collection<String> clientIds)
invokeVisitCallbackback to summary
public VisitResult invokeVisitCallback(UIComponent component, VisitCallback callback)

Implements abstract javax.faces.component.visit.VisitContext.invokeVisitCallback.

Doc from javax.faces.component.visit.VisitContext.invokeVisitCallback.

Called by UIComponent.visitTree() to visit a single component.

Parameters
component:UIComponent

the component to visit

callback:VisitCallback

the VisitCallback to call

Returns:VisitResult

a VisitResult value that indicates whether to continue visiting the component's subtree, skip visiting the component's subtree or abort the visit altogether.

Annotations
@Override
See Also
VisitContext.invokeVisitCallback()
removeSubtreeClientIdback to summary
private void removeSubtreeClientId(String clientId)
com.sun.faces.component.visit back to summary

private Class PartialVisitContext.CollectionProxy<E extends java.lang.String>

extends AbstractCollection<E extends String>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private Collection<E>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public boolean
add(E
element whose presence in this collection is to be ensured
o
)

Overrides java.util.AbstractCollection.add.

Implements java.util.Collection.add.

Ensures that this collection contains the specified element (optional operation).
public Iterator<E>
iterator()

Implements abstract java.util.AbstractCollection.iterator.

Implements java.util.Collection.iterator.

Returns an iterator over the elements contained in this collection.
public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.Collection.size.

Returns the number of elements in this collection.
Inherited from java.util.AbstractCollection:
addAllclearcontainscontainsAllisEmptyremoveremoveAllretainAlltoArraytoArraytoString

Field Detail

wrappedback to summary
private Collection<E> wrapped

Constructor Detail

CollectionProxyback to summary
private CollectionProxy(Collection<E> wrapped)

Method Detail

addback to summary
public boolean add(E o)

Overrides java.util.AbstractCollection.add.

Implements java.util.Collection.add.

Doc from java.util.AbstractCollection.add.

Ensures that this collection contains the specified element (optional operation). Returns true if this collection changed as a result of the call. (Returns false if this collection does not permit duplicates and already contains the specified element.)

Collections that support this operation may place limitations on what elements may be added to this collection. In particular, some collections will refuse to add null elements, and others will impose restrictions on the type of elements that may be added. Collection classes should clearly specify in their documentation any restrictions on what elements may be added.

If a collection refuses to add a particular element for any reason other than that it already contains the element, it must throw an exception (rather than returning false). This preserves the invariant that a collection always contains the specified element after this call returns.

Parameters
o:E

Doc from java.util.Collection.add.

element whose presence in this collection is to be ensured

Returns:boolean

Doc from java.util.Collection.add.

true if this collection changed as a result of the call

Annotations
@Override
iteratorback to summary
public Iterator<E> iterator()

Implements abstract java.util.AbstractCollection.iterator.

Implements java.util.Collection.iterator.

Doc from java.util.AbstractCollection.iterator.

Returns an iterator over the elements contained in this collection.

Returns:Iterator<E>

an iterator over the elements contained in this collection

Annotations
@Override
sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.Collection.size.

Doc from java.util.Collection.size.

Returns the number of elements in this collection. If this collection contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this collection

Annotations
@Override
com.sun.faces.component.visit back to summary

private Class PartialVisitContext.IteratorProxy<E extends java.lang.String>

extends Object
implements Iterator<E extends String>
Class Inheritance
  • java.lang.Object
  • com.sun.faces.component.visit.PartialVisitContext.IteratorProxy
All Implemented Interfaces
java.util.Iterator

Field Summary

Modifier and TypeField and Description
private E
private Iterator<E>

Constructor Summary

AccessConstructor and Description
private
IteratorProxy(Iterator<E> wrapped)

Method Summary

Modifier and TypeMethod and Description
public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.
public E
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.
public void
remove()

Overrides default java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation).
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentback to summary
private E current
wrappedback to summary
private Iterator<E> wrapped

Constructor Detail

IteratorProxyback to summary
private IteratorProxy(Iterator<E> wrapped)

Method Detail

hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:boolean

true if the iteration has more elements

Annotations
@Override
nextback to summary
public E next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Returns:E

the next element in the iteration

Annotations
@Override
removeback to summary
public void remove()

Overrides default java.util.Iterator.remove.

Doc from java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation). This method can be called only once per call to next.

The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.

The behavior of an iterator is unspecified if this method is called after a call to the forEachRemaining method.

Annotations
@Override