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 統合によるアクセシビリティテストのための個々のルールを設定できます。このクラスを使用して、テストを実行する際に特定のアクセシビリティルールを有効または無効にすることができます。これをAxeRunOptionssetRulesメソッドと共に使用して、有効または無効にするルールを指定します。

コンストラクタ

AxeRuleOptions()

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

AxeRuleOptions options = new AxeRuleOptions();

メソッド

setEnabled(boolean enabled)

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

パラメータ:

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

戻り値:

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

例:

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

AxeRuleOptionsを使用した例については、AxeRunOptionssetRulesメソッドを参照してください。

getEnabled()

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

戻り値:

  • boolean - 現在の有効状態

例:

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

toJson()

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

戻り値:

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

例:

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

関連項目