public abstract class VisitContext extends ObjectSE
コンポーネントツリーの訪問の実行に関連する状態を保持するために使用されるコンテキストオブジェクト。
コンポーネントツリーへのアクセスは UIComponent.visitTree(javax.faces.component.visit.VisitContext, javax.faces.component.visit.VisitCallback) を呼び出すことで開始されます。その時点で、VisitContext と VisitCallback の両方を提供する必要があります。
UIComponent.visitTree(), VisitCallback| 修飾子と型 | フィールドと説明 |
|---|---|
static CollectionSE<StringSE> | ALL_IDS この変更不可能なコレクションは、すべての ID にアクセスする必要がある場合に、 |
| コンストラクターと説明 |
|---|
VisitContext() |
| 修飾子と型 | メソッドと説明 |
|---|---|
static VisitContext | createVisitContext(FacesContext context)UIComponent.visitTree() で使用する VisitContext インスタンスを作成します。 |
static VisitContext | createVisitContext(FacesContext context, CollectionSE<StringSE> ids, SetSE<VisitHint> hints)UIComponent.visitTree(javax.faces.component.visit.VisitContext, javax.faces.component.visit.VisitCallback) で使用するために、指定された ID とヒントで初期化された VisitContext インスタンスを返します。 |
abstract FacesContext | getFacesContext()現在のリクエストの FacesContext を返します。 |
abstract SetSE<VisitHint> | getHints() ツリー訪問の動作に影響を与えるヒントを返します。 |
abstract CollectionSE<StringSE> | getIdsToVisit()アクセスするコンポーネントの ID を返します。 |
abstract CollectionSE<StringSE> | getSubtreeIdsToVisit(UIComponent component)
|
abstract VisitResult | invokeVisitCallback(UIComponent component, VisitCallback callback) 単一のコンポーネントを訪問するために UIComponent.visitTree() によって呼び出されます。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSEpublic static final CollectionSE<StringSE> ALL_IDS
この変更不可能なコレクションは、すべての ID にアクセスする必要がある場合に、getIdsToVisit() および getSubtreeIdsToVisit() によって返されます。
visitTree() 実装のロジックを簡略化するために、このコレクションは常に isEmpty の false を返します。他のすべてのメソッドは UnsupportedOperationException をスローします。
public abstract FacesContext getFacesContext()
現在のリクエストの FacesContext を返します。
public abstract CollectionSE<StringSE> getIdsToVisit()
アクセスするコンポーネントの ID を返します。
完全なツリーアクセスの場合、このメソッドは ALL_IDS コレクションを返します。それ以外の場合、部分的なアクセスが実行されると、アクセスする必要があるコンポーネントのクライアント ID を含む変更可能なコレクションを返します。
public abstract CollectionSE<StringSE> getSubtreeIdsToVisit(UIComponent component)
NamingContainer コンポーネントを指定すると、アクセスする必要がある NamingContainer のすべてのコンポーネントのクライアント ID を返します。
このメソッドは、NamingContainer にアクセスするコンポーネントが含まれているかどうかを判断するために、NamingContainer visitTree() 実装によって呼び出されます。そのようなコンポーネントが存在しない場合、NamingContainer はツリーの訪問を短絡し、子サブツリーへの下降を回避できます。
さらに、UIData などの反復コンポーネントは、返された ID を使用して、どの反復状態(つまり行)にアクセスする必要があるかを判断できる場合があります。これにより、訪問トラバーサルを制約することができ、訪問ターゲットを含む行のみをトラバースする必要があります。
component - NamingContainer コンポーネント VisitContext.ALL_IDS コレクションを返します。IllegalArgumentExceptionSE - component が NamingContainer のインスタンスでない場合 public abstract VisitResult invokeVisitCallback(UIComponent component, VisitCallback callback)
単一のコンポーネントを訪問するために UIComponent.visitTree() によって呼び出されます。
component - 訪問するコンポーネント callback - 呼び出す VisitCallbackpublic abstract SetSE<VisitHint> getHints()
ツリー訪問の動作に影響を与えるヒントを返します。
UIComponent.visitTree() 実装などの関係者は、VisitContext.getHints().contains() を呼び出して VisitHint で定義されたヒントの 1 つを渡すことにより、特定のヒントが存在するかどうかを確認できます。
public static VisitContext createVisitContext(FacesContext context, CollectionSE<StringSE> ids, SetSE<VisitHint> hints)
UIComponent.visitTree(javax.faces.component.visit.VisitContext, javax.faces.component.visit.VisitCallback) で使用するために、指定された ID とヒントで初期化された VisitContext インスタンスを返します。
context - 現在のリクエストの FacesContextids - 訪問するコンポーネントのクライアント ID。null の場合、すべてのコンポーネントが訪問されます。hints - 訪問に適用する VisitHints。null の場合、ヒントは適用されません。public static VisitContext createVisitContext(FacesContext context)
UIComponent.visitTree() で使用する VisitContext インスタンスを作成します。このメソッドは、デフォルトの訪問ヒントを使用してすべてのコンポーネントにアクセスする必要がある場合に、VisitContext インスタンスを取得するために使用できます。
context - 現在のリクエストの FacesContextCopyright © 2019 Eclipse Foundation.
Use is subject to license terms.