VerificationAttributeとは? わかりやすく解説

VerificationAttribute クラス

メモ : このクラスは、.NET Framework version 2.0 で新しく追加されたものです。

Web コンテンツのアクセシビリティ規則のメタデータ属性を定義します。このクラスは継承できません。

名前空間: System.Web.UI
アセンブリ: System.Web (system.web.dll 内)
構文構文

<AttributeUsageAttribute(AttributeTargets.Class Or AttributeTargets.Property,
 AllowMultiple:=True)> _
Public NotInheritable Class
 VerificationAttribute
    Inherits Attribute
Dim instance As VerificationAttribute
[AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Property, AllowMultiple=true)]
 
public sealed class VerificationAttribute :
 Attribute
[AttributeUsageAttribute(AttributeTargets::Class|AttributeTargets::Property, AllowMultiple=true)]
 
public ref class VerificationAttribute sealed
 : public Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Property,
 AllowMultiple=true) */ 
public final class VerificationAttribute extends
 Attribute
AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Property, AllowMultiple=true)
 
public final class VerificationAttribute extends
 Attribute
解説解説

VerificationAttribute クラスのインスタンスは、検証できる、Web コンテンツのアクセシビリティ規則を定義します。『Web Content Accessibility Guidelines』の詳細については、W3C (World Wide Web Consortium) Web サイトを参照してください。

VerificationAttribute のインスタンスを定義するために必要な最小限の情報には、次のような種類があります。

インスタンスの作成時に指定できる、検証規則のオプションのプロパティ。

VerificationAttribute メタデータは、クラス、プロパティ、およびインデクサの各宣言で定義できます。

属性の使用方法については、「属性を使用したメタデータの拡張」を参照してください。

使用例使用例

VerificationAttribute クラスを使用するコード例を次に示します。検証のメタデータ定義で使用するガイドラインは、"WCAG" (Web Content Accessibility Guideline) および "ADA" (Americans with Disabilities Act Guidelines) です。詳細については、W3C (World Wide Web Consortium) Web サイトを参照してください。

使用するチェックポイントは、WCAG の場合は "1.1"、ADA の場合は "1194.22(a)" です。これらのチェックポイントは、テキスト以外の要素に等価のテキストが確実に存在するようにします。VerificationAttribute は、ImageProperty という名前の別のプロパティと等価のテキストを表す ImageText プロパティに適用されます。ImageText プロパティが設定されていない場合、アクセシビリティの検証によって "The image is missing a text equivalent." のメッセージが返されます。

<Verification("ADA", "1194.22(a)",
 VerificationReportLevel.Error, 1, "The image is missing a text
 equivalent.", VerificationRule.NotEmptyString, "ImageUrl")> _
<Verification("WCAG", "1.1",
 VerificationReportLevel.Error, 1, "The image is missing a text
 equivalent.", VerificationRule.NotEmptyString, "ImageUrl")> _
Public Property ImageText() As
 String
    Get
        If ViewState("ImageText")
 Is Nothing Then
            Return String.Empty
        Else
            Return CType(ViewState("ImageText"),
 String)
        End If
    End Get
    Set(ByVal value As String)
        ViewState("ImageText") = value
    End Set
End Property


Public Property ImageUrl() As
 String
    Get
        If ViewState("ImageUrl")
 Is Nothing Then
            Return String.Empty
        Else
            Return CType(ViewState("ImageUrl"),
 String)
        End If
    End Get
    Set(ByVal value As String)
        ViewState("ImageUrl") = value
    End Set
End Property
[Verification("ADA", "1194.22(a)", 
    VerificationReportLevel.Error, 1,
    "The image is missing a text equivalent.", 
    VerificationRule.NotEmptyString, "ImageUrl"),
Verification("WCAG", "1.1", 
    VerificationReportLevel.Error, 1, 
    "The image is missing an text equivalent.", 
    VerificationRule.NotEmptyString, "ImageUrl")]
public virtual String ImageText
{
    get
    {
        object obj = ViewState["ImageText"];
        return ((obj == null) ? String.Empty
 : (string)obj);
    }
    set
    {
        ViewState["ImageText"] = value;
    }
}
public virtual String ImageUrl
{
    get 
    {
        object obj = ViewState["ImageUrl"];
        return ((obj == null) ? String.Empty
 : (string)obj);
    }
    set 
    { 
        ViewState["ImageUrl"] = value;
    }
}
.NET Framework のセキュリティ.NET Framework のセキュリティ
継承階層継承階層
System.Object
   System.Attribute
    System.Web.UI.VerificationAttribute
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

VerificationAttribute コンストラクタ (String, String, VerificationReportLevel, Int32, String, VerificationRule, String, VerificationConditionalOperator, String, String)

メモ : このコンストラクタは、.NET Framework version 2.0 で新しく追加されたものです。

アクセシビリティ ガイドライン、チェックポイント、レポート レベル、チェックポイントの優先度、エラー メッセージ、VerificationRule 値、関連する条件付きプロパティ、関連する条件付きプロパティ値、およびリファレンス ガイドラインの URL を使用して、VerificationAttribute クラスの新しいインスタンスを初期化します。

名前空間: System.Web.UI
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Sub New ( _
    guideline As String, _
    checkpoint As String, _
    reportLevel As VerificationReportLevel, _
    priority As Integer, _
    message As String, _
    rule As VerificationRule, _
    conditionalProperty As String, _
    conditionalOperator As VerificationConditionalOperator, _
    conditionalValue As String, _
    guidelineUrl As String _
)
Dim guideline As String
Dim checkpoint As String
Dim reportLevel As VerificationReportLevel
Dim priority As Integer
Dim message As String
Dim rule As VerificationRule
Dim conditionalProperty As String
Dim conditionalOperator As VerificationConditionalOperator
Dim conditionalValue As String
Dim guidelineUrl As String

Dim instance As New VerificationAttribute(guideline,
 checkpoint, reportLevel, priority, message, rule, conditionalProperty, conditionalOperator,
 conditionalValue, guidelineUrl)
public VerificationAttribute (
    string guideline,
    string checkpoint,
    VerificationReportLevel reportLevel,
    int priority,
    string message,
    VerificationRule rule,
    string conditionalProperty,
    VerificationConditionalOperator conditionalOperator,
    string conditionalValue,
    string guidelineUrl
)
public:
VerificationAttribute (
    String^ guideline, 
    String^ checkpoint, 
    VerificationReportLevel reportLevel, 
    int priority, 
    String^ message, 
    VerificationRule rule, 
    String^ conditionalProperty, 
    VerificationConditionalOperator conditionalOperator, 
    String^ conditionalValue, 
    String^ guidelineUrl
)
public VerificationAttribute (
    String guideline, 
    String checkpoint, 
    VerificationReportLevel reportLevel, 
    int priority, 
    String message, 
    VerificationRule rule, 
    String conditionalProperty, 
    VerificationConditionalOperator conditionalOperator, 
    String conditionalValue, 
    String guidelineUrl
)
public function VerificationAttribute (
    guideline : String, 
    checkpoint : String, 
    reportLevel : VerificationReportLevel, 
    priority : int, 
    message : String, 
    rule : VerificationRule, 
    conditionalProperty : String, 
    conditionalOperator : VerificationConditionalOperator, 
    conditionalValue : String, 
    guidelineUrl : String
)

パラメータ

guideline

検証規則に記述されアクセシビリティ ガイドライン。

checkpoint

ガイドライン内のチェックポイント。

reportLevel

VerificationReportLevel 値の 1 つ。

priority

チェックポイントの優先度。

message

検証規則が true の場合に表示されるメッセージ。

rule

VerificationRule 値の 1 つ。

conditionalProperty

アクセシビリティ規則を検証するために使用する条件式の左辺。

conditionalOperator

VerificationConditionalOperator 値の 1 つ。

conditionalValue

アクセシビリティ規則を検証するために使用する条件式の右辺。

guidelineUrl

guideline の参照 URL。

解説解説

この VerificationAttribute を使用すると、使用できるすべてのプロパティを指定して VerificationAttribute クラスのインスタンスを作成できます。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
VerificationAttribute クラス
VerificationAttribute メンバ
System.Web.UI 名前空間

VerificationAttribute コンストラクタ (String, String, VerificationReportLevel, Int32, String)

メモ : このコンストラクタは、.NET Framework version 2.0 で新しく追加されたものです。

アクセシビリティ ガイドライン、チェックポイント、レポート レベル、チェックポイントの優先度、およびエラー メッセージを使用して、VerificationAttribute クラスの新しいインスタンスを初期化します。

名前空間: System.Web.UI
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Sub New ( _
    guideline As String, _
    checkpoint As String, _
    reportLevel As VerificationReportLevel, _
    priority As Integer, _
    message As String _
)
Dim guideline As String
Dim checkpoint As String
Dim reportLevel As VerificationReportLevel
Dim priority As Integer
Dim message As String

Dim instance As New VerificationAttribute(guideline,
 checkpoint, reportLevel, priority, message)
public VerificationAttribute (
    string guideline,
    string checkpoint,
    VerificationReportLevel reportLevel,
    int priority,
    string message
)
public:
VerificationAttribute (
    String^ guideline, 
    String^ checkpoint, 
    VerificationReportLevel reportLevel, 
    int priority, 
    String^ message
)
public VerificationAttribute (
    String guideline, 
    String checkpoint, 
    VerificationReportLevel reportLevel, 
    int priority, 
    String message
)
public function VerificationAttribute (
    guideline : String, 
    checkpoint : String, 
    reportLevel : VerificationReportLevel, 
    priority : int, 
    message : String
)

パラメータ

guideline

検証規則に記述されたアクセシビリティ ガイドライン

checkpoint

ガイドライン内のチェックポイント。

reportLevel

VerificationReportLevel 値の 1 つ。

priority

チェックポイントの優先度。

message

検証規則が true の場合に表示されるメッセージ。

解説解説

VerificationAttribute クラスの VerificationAttribute コンストラクタは、検証規則を定義するために必要な最小限の情報を示します。VerificationAttribute インスタンスについて、次の既定値が設定されます。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
VerificationAttribute クラス
VerificationAttribute メンバ
System.Web.UI 名前空間

VerificationAttribute コンストラクタ (String, String, VerificationReportLevel, Int32, String, VerificationRule, String)

メモ : このコンストラクタは、.NET Framework version 2.0 で新しく追加されたものです。

アクセシビリティ ガイドライン、チェックポイント、レポート レベル、チェックポイントの優先度、エラー メッセージ、VerificationRule 値、および関連する条件付きプロパティを使用して、VerificationAttribute クラスの新しいインスタンスを初期化します。

名前空間: System.Web.UI
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Sub New ( _
    guideline As String, _
    checkpoint As String, _
    reportLevel As VerificationReportLevel, _
    priority As Integer, _
    message As String, _
    rule As VerificationRule, _
    conditionalProperty As String _
)
Dim guideline As String
Dim checkpoint As String
Dim reportLevel As VerificationReportLevel
Dim priority As Integer
Dim message As String
Dim rule As VerificationRule
Dim conditionalProperty As String

Dim instance As New VerificationAttribute(guideline,
 checkpoint, reportLevel, priority, message, rule, conditionalProperty)
public VerificationAttribute (
    string guideline,
    string checkpoint,
    VerificationReportLevel reportLevel,
    int priority,
    string message,
    VerificationRule rule,
    string conditionalProperty
)
public:
VerificationAttribute (
    String^ guideline, 
    String^ checkpoint, 
    VerificationReportLevel reportLevel, 
    int priority, 
    String^ message, 
    VerificationRule rule, 
    String^ conditionalProperty
)
public VerificationAttribute (
    String guideline, 
    String checkpoint, 
    VerificationReportLevel reportLevel, 
    int priority, 
    String message, 
    VerificationRule rule, 
    String conditionalProperty
)
public function VerificationAttribute (
    guideline : String, 
    checkpoint : String, 
    reportLevel : VerificationReportLevel, 
    priority : int, 
    message : String, 
    rule : VerificationRule, 
    conditionalProperty : String
)

パラメータ

guideline

検証規則に記述されたアクセシビリティ ガイドライン。

checkpoint

ガイドライン内のチェックポイント。

reportLevel

VerificationReportLevel 値の 1 つ。

priority

チェックポイントの優先度。

message

検証規則が true の場合に表示されるメッセージ。

rule

VerificationRule 値の 1 つ。

conditionalProperty

アクセシビリティ規則を検証するために使用する条件式の左辺。

解説解説

conditionalProperty パラメータは、検証規則を評価するための条件式の一部として使用される別のプロパティです。たとえば、その規則のパラメータが NotEmptyString である場合、conditionalProperty で指定される関連するプロパティは、空の文字列 ("") 以外である必要があります。

VerificationAttribute インスタンスについて、次の既定値が設定されます。

前述のリストにあるプロパティの値を既定値以外に指定するには、VerificationAttribute コンストラクタのオーバーロードを使用します。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
VerificationAttribute クラス
VerificationAttribute メンバ
System.Web.UI 名前空間

VerificationAttribute コンストラクタ

VerificationAttribute クラスの新しいインスタンスを初期化します。
オーバーロードの一覧オーバーロードの一覧

参照参照

関連項目

VerificationAttribute クラス
VerificationAttribute メンバ
System.Web.UI 名前空間

VerificationAttribute プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ Checkpoint 指定した Guideline プロパティの、アクセシビリティのチェックポイントの参照を取得します。
パブリック プロパティ ConditionalProperty アクセシビリティのチェックポイントの検証の一部として使用する条件式の左辺を取得します。
パブリック プロパティ ConditionalValue アクセシビリティのチェックポイントの検証の一部として使用する条件式の右辺を取得します。
パブリック プロパティ Guideline アクセシビリティのチェックに使用するガイドラインを取得します。
パブリック プロパティ GuidelineUrl Guideline プロパティで指定されるアクセシビリティのガイドラインについての詳細情報を取得するために使用できる URL を取得します。
パブリック プロパティ Message アクセシビリティのチェックポイントの検証規則が true の場合に、メッセージ文字列を取得します。
パブリック プロパティ Priority アクセシビリティのチェックポイントの優先度を取得します。
パブリック プロパティ TypeId  派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。 ( Attribute から継承されます。)
パブリック プロパティ VerificationConditionalOperator アクセシビリティのチェックポイントの検証方法を示す VerificationConditionalOperator 列挙値を取得します。
パブリック プロパティ VerificationReportLevel アクセシビリティのチェックポイントの使用方法を示す VerificationReportLevel 列挙値を取得します。
パブリック プロパティ VerificationRule アクセシビリティのチェックポイントの使用方法を示す VerificationRule 列挙値を取得します。
参照参照

関連項目

VerificationAttribute クラス
System.Web.UI 名前空間

その他の技術情報

属性を使用したメタデータの拡張

VerificationAttribute メソッド


パブリック メソッドパブリック メソッド

( プロテクト メソッド も参照)
  名前 説明
パブリック メソッド Equals  オーバーロードされます。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttribute  オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用された指定した型のカスタム属性を取得します。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されたカスタム属性の配列を取得します。 ( Attribute から継承されます。)
パブリック メソッド GetHashCode  このインスタンスのハッシュ コードを返します。 ( Attribute から継承されます。)
パブリック メソッド GetType  現在のインスタンスの Type を取得します。 ( Object から継承されます。)
パブリック メソッド IsDefaultAttribute  派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラスの既定値かどうかを示します。 ( Attribute から継承されます。)
パブリック メソッド IsDefined  オーバーロードされます。 指定した型のカスタム属性が、アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されているかどうかを判断します。 ( Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 ( Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String を返します。 ( Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

VerificationAttribute クラス
System.Web.UI 名前空間

その他の技術情報

属性を使用したメタデータの拡張

VerificationAttribute メンバ

Web コンテンツのアクセシビリティ規則のメタデータ属性を定義します。このクラスは継承できません。

VerificationAttribute データ型で公開されるメンバを以下の表に示します。


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド VerificationAttribute オーバーロードされます。 VerificationAttribute クラスの新しいインスタンスを初期化します。
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ Checkpoint 指定した Guideline プロパティの、アクセシビリティのチェックポイントの参照を取得します。
パブリック プロパティ ConditionalProperty アクセシビリティのチェックポイントの検証の一部として使用する条件式の左辺を取得します。
パブリック プロパティ ConditionalValue アクセシビリティのチェックポイントの検証の一部として使用する条件式の右辺を取得します。
パブリック プロパティ Guideline アクセシビリティのチェックに使用するガイドラインを取得します。
パブリック プロパティ GuidelineUrl Guideline プロパティで指定されるアクセシビリティのガイドラインについての詳細情報を取得するために使用できる URL を取得します。
パブリック プロパティ Message アクセシビリティのチェックポイントの検証規則が true の場合に、メッセージ文字列を取得します。
パブリック プロパティ Priority アクセシビリティのチェックポイントの優先度を取得します。
パブリック プロパティ TypeId  派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。(Attribute から継承されます。)
パブリック プロパティ VerificationConditionalOperator アクセシビリティのチェックポイントの検証方法を示す VerificationConditionalOperator 列挙値を取得します。
パブリック プロパティ VerificationReportLevel アクセシビリティのチェックポイントの使用方法を示す VerificationReportLevel 列挙値を取得します。
パブリック プロパティ VerificationRule アクセシビリティのチェックポイントの使用方法を示す VerificationRule 列挙値を取得します。
パブリック メソッドパブリック メソッド
( プロテクト メソッド も参照)
  名前 説明
パブリック メソッド Equals  オーバーロードされます。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttribute  オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用された指定した型のカスタム属性を取得します。 (Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されたカスタム属性の配列を取得します。 (Attribute から継承されます。)
パブリック メソッド GetHashCode  このインスタンスのハッシュ コードを返します。 (Attribute から継承されます。)
パブリック メソッド GetType  現在のインスタンスの Type を取得します。 (Object から継承されます。)
パブリック メソッド IsDefaultAttribute  派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラスの既定値かどうかを示します。 (Attribute から継承されます。)
パブリック メソッド IsDefined  オーバーロードされます。 指定した型のカスタム属性が、アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されているかどうかを判断します。 (Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 (Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String を返します。 (Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

VerificationAttribute クラス
System.Web.UI 名前空間

その他の技術情報

属性を使用したメタデータの拡張



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「VerificationAttribute」の関連用語

VerificationAttributeのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



VerificationAttributeのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS