AxeRuleOptions クラス

This page is not available in the language you requested. You have been redirected to the English version of the page.
Link to this page copied to clipboard

axe Watcher Java 統合の設定時に、特定の axe-core ルールを有効または無効にする

Not for use with personal data

この AxeRuleOptions クラスを使用すると、axe Watcher Java 統合でアクセシビリティテストの個別ルールを設定できます。テストを実行する際に、特定のアクセシビリティルールを有効または無効にするためにこのクラスを使用します。また、 setRules メソッドと共に使用して、 AxeRunOptions 有効または無効にするルールを指定します。

コンストラクタ

AxeRuleOptions()

デフォルトの設定で新しいインスタンスを作成します。 AxeRuleOptions

AxeRuleOptions options = new AxeRuleOptions();

メソッド

setEnabled(boolean enabled)

ルールを有効(true)または無効(false)にするかを設定します。

パラメータ:

  • enabled - ルールを有効にするかどうかを示すブール値

戻り値:

  • AxeRuleOptions - 現在のインスタンス

例:

AxeRuleOptions options = new AxeRuleOptions().setEnabled(false);
tip

の使用例については、 setRules メソッドを参照してください AxeRunOptions AxeRuleOptions

getEnabled()

ルールの現在の有効状態を取得します。

戻り値:

  • boolean - 現在の有効状態

例:

AxeRuleOptions options = new AxeRuleOptions().setEnabled(true);
boolean isEnabled = options.getEnabled(); // Returns true

toJson()

インスタンスを JSON 文字列にシリアライズします。 AxeRuleOptions

戻り値:

  • String - オプションの JSON 文字列表現

例:

AxeRuleOptions options = new AxeRuleOptions().setEnabled(false);
String json = options.toJson(); // Returns {"enabled":false}

関連項目