public class

XmlValidationModeDetector

extends Object
java.lang.Object
   ↳ org.springframework.util.xml.XmlValidationModeDetector

Class Overview

Detects whether an XML stream is using DTD- or XSD-based validation.

Summary

Constants
int VALIDATION_AUTO Indicates that the validation mode should be auto-guessed, since we cannot find a clear indication (probably choked on some special characters, or the like).
int VALIDATION_DTD Indicates that DTD validation should be used (we found a "DOCTYPE" declaration).
int VALIDATION_NONE Indicates that the validation should be disabled.
int VALIDATION_XSD Indicates that XSD validation should be used (found no "DOCTYPE" declaration).
Public Constructors
XmlValidationModeDetector()
Public Methods
int detectValidationMode(InputStream inputStream)
Detect the validation mode for the XML document in the supplied InputStream.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int VALIDATION_AUTO

Also: SpringCore

Indicates that the validation mode should be auto-guessed, since we cannot find a clear indication (probably choked on some special characters, or the like).

Constant Value: 1 (0x00000001)

public static final int VALIDATION_DTD

Also: SpringCore

Indicates that DTD validation should be used (we found a "DOCTYPE" declaration).

Constant Value: 2 (0x00000002)

public static final int VALIDATION_NONE

Also: SpringCore

Indicates that the validation should be disabled.

Constant Value: 0 (0x00000000)

public static final int VALIDATION_XSD

Also: SpringCore

Indicates that XSD validation should be used (found no "DOCTYPE" declaration).

Constant Value: 3 (0x00000003)

Public Constructors

public XmlValidationModeDetector ()

Also: SpringCore

Public Methods

public int detectValidationMode (InputStream inputStream)

Also: SpringCore

Detect the validation mode for the XML document in the supplied InputStream. Note that the supplied InputStream is closed by this method before returning.

Parameters
inputStream the InputStream to parse
Throws
IOException in case of I/O failure