Class ValidateCommand

All Implemented Interfaces:
IStreamCommand

public class ValidateCommand extends ConsumerCommand
XMLのバリデーションを行うコマンドクラス

XMLのバリデーションを行うコマンドクラスです。

このクラスは、XMLのスキーマを指定して、XMLのバリデーションを行います。

バリデーションエラーが発生した場合は、エラーメッセージを出力します。

  • Constructor Details

    • ValidateCommand

      public ValidateCommand(String schemaPath)
      コンストラクタ

      クラスパスからXMLスキーマを読み込み、バリデーションコマンドを作成します。

      セキュリティ: ClassLoaderはクラスパス内でパス正規化を行います(例: "hoge/../fuga" → "fuga")。 ただし、クラスパス境界外へのアクセスは不可能です("../etc/passwd" → リソース未発見)。

      Parameters:
      schemaPath - クラスパスリソース識別子(例: "schemas/test.xsd", "test-schema.xsd")
      Throws:
      StreamProcessingException - スキーマファイルの読み込みに失敗した場合
  • Method Details

    • consume

      public void consume(InputStream inputStream) throws IOException
      XMLのバリデーションを行うコマンドを実行します。

      XMLのスキーマを指定して、XMLのバリデーションを行います。

      バリデーションエラーが発生した場合は、エラーメッセージを出力します。

      Specified by:
      consume in class ConsumerCommand
      Parameters:
      inputStream - 入力ストリーム
      Throws:
      IOException - 入出力エラーが発生した場合
      StreamProcessingException - XMLバリデーションエラーが発生した場合