Package org.springframework.util.xml
Class XmlValidationModeDetector
java.lang.Object
org.springframework.util.xml.XmlValidationModeDetector
Detects whether an XML stream is using DTD- or XSD-based validation.
- Since:
 - 2.0
 - Author:
 - Rob Harrop, Juergen Hoeller, Sam Brannen
 
- 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intIndicates that the validation mode should be auto-guessed, since we cannot find a clear indication (probably choked on some special characters, or the like).static final intIndicates that DTD validation should be used (we found a "DOCTYPE" declaration).static final intIndicates that the validation should be disabled.static final intIndicates that XSD validation should be used (found no "DOCTYPE" declaration). - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionintdetectValidationMode(InputStream inputStream) Detect the validation mode for the XML document in the suppliedInputStream. 
- 
Field Details
- 
VALIDATION_NONE
public static final int VALIDATION_NONEIndicates that the validation should be disabled.- See Also:
 
 - 
VALIDATION_AUTO
public static final int VALIDATION_AUTOIndicates that the validation mode should be auto-guessed, since we cannot find a clear indication (probably choked on some special characters, or the like).- See Also:
 
 - 
VALIDATION_DTD
public static final int VALIDATION_DTDIndicates that DTD validation should be used (we found a "DOCTYPE" declaration).- See Also:
 
 - 
VALIDATION_XSD
public static final int VALIDATION_XSDIndicates that XSD validation should be used (found no "DOCTYPE" declaration).- See Also:
 
 
 - 
 - 
Constructor Details
- 
XmlValidationModeDetector
public XmlValidationModeDetector() 
 - 
 - 
Method Details
- 
detectValidationMode
Detect the validation mode for the XML document in the suppliedInputStream.Note that the supplied
InputStreamis closed by this method before returning.- Parameters:
 inputStream- the InputStream to parse- Throws:
 IOException- in case of I/O failure- See Also:
 
 
 -