Class ValidateCommand

All Implemented Interfaces:
IStreamCommand

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

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

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

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

  • Method Details

    • create

      public static ValidateCommand create(String schemaPath)
      Factory method for creating a ValidateCommand.
      Parameters:
      schemaPath - クラスパスリソース識別子(例: "schemas/test.xsd", "test-schema.xsd")
      Returns:
      a ValidateCommand instance
      Throws:
      NullPointerException - スキーマパスがnullの場合
      IllegalArgumentException - スキーマパスが空の場合
      StreamProcessingException - スキーマファイルの読み込みに失敗した場合
    • consume

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

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

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

      Specified by:
      consume in class ConsumerCommand
      Parameters:
      inputStream - 入力ストリーム
      Throws:
      IOException - 入出力エラーが発生した場合
      StreamProcessingException - XXE防止設定の適用失敗またはXMLバリデーションエラーが発生した場合