| Modifier and Type | Field and Description |
|---|---|
| private static final String | DOCTYPE
The token in an XML document that declares the DTD to use for validation and thus that DTD validation is being used. |
| private static final String | END_COMMENT
The token that indicates the end of an XML comment. |
| private boolean | inComment
Indicates whether the current parse position is inside an XML comment. |
| private static final String | START_COMMENT
The token that indicates the start of an XML comment. |
| public static final 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). |
| public static final int | VALIDATION_DTD
Indicates that DTD validation should be used (we found a "DOCTYPE" declaration). |
| public static final int | VALIDATION_NONE
Indicates that the validation should be disabled. |
| public static final int | VALIDATION_XSD
Indicates that XSD validation should be used (found no "DOCTYPE" declaration). |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private int | commentToken(String line, String token, boolean inCommentIfPresent)
Try to consume the supplied token against the supplied content and update the "in comment" parse state to the supplied value. |
| private String | |
| private String | consumeCommentTokens(String line)
Consume all comments in the given String and return the remaining content, which may be empty since the supplied content might be all comment data. |
| public int | detectValidationMode(InputStream
the InputStream to parse inputStream)Detect the validation mode for the XML document in the supplied |
| private int | |
| private boolean | |
| private boolean | |
| private int |
| DOCTYPE | back to summary |
|---|---|
| private static final String DOCTYPE The token in an XML document that declares the DTD to use for validation and thus that DTD validation is being used. | |
| END_COMMENT | back to summary |
|---|---|
| private static final String END_COMMENT The token that indicates the end of an XML comment. | |
| inComment | back to summary |
|---|---|
| private boolean inComment Indicates whether the current parse position is inside an XML comment. | |
| START_COMMENT | back to summary |
|---|---|
| private static final String START_COMMENT The token that indicates the start of an XML comment. | |
| VALIDATION_AUTO | back to summary |
|---|---|
| public static final 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). | |
| VALIDATION_DTD | back to summary |
|---|---|
| public static final int VALIDATION_DTD Indicates that DTD validation should be used (we found a "DOCTYPE" declaration). | |
| VALIDATION_NONE | back to summary |
|---|---|
| public static final int VALIDATION_NONE Indicates that the validation should be disabled. | |
| VALIDATION_XSD | back to summary |
|---|---|
| public static final int VALIDATION_XSD Indicates that XSD validation should be used (found no "DOCTYPE" declaration). | |
| XmlValidationModeDetector | back to summary |
|---|---|
| public XmlValidationModeDetector() | |
| commentToken | back to summary |
|---|---|
| private int commentToken(String line, String token, boolean inCommentIfPresent) Try to consume the supplied token against the supplied content and update the "in comment" parse state to the supplied value. Returns the index into the content which is after the token or -1 if the token is not found. | |
| consume | back to summary |
|---|---|
| private String consume(String line) Consume the next comment token, update the "inComment" flag, and return the remaining content.
| |
| consumeCommentTokens | back to summary |
|---|---|
| private String consumeCommentTokens(String line) Consume all comments in the given String and return the remaining content, which may be empty since the supplied content might be all comment data. This method takes the current "in comment" parsing state into account. | |
| detectValidationMode | back to summary |
|---|---|
| public int detectValidationMode(InputStream inputStream) throws IOException Detect the validation mode for the XML document in the supplied Note that the supplied
| |
| endComment | back to summary |
|---|---|
| private int endComment(String line) Try to consume the | |
| hasDoctype | back to summary |
|---|---|
| private boolean hasDoctype(String content) Does the content contain the DTD DOCTYPE declaration? | |
| hasOpeningTag | back to summary |
|---|---|
| private boolean hasOpeningTag(String content) Determine if the supplied content contains an XML opening tag. It is expected that all comment tokens will have been consumed for the
supplied content before passing the remainder to this method. However, as
a sanity check, if the parse state is currently in an XML comment this
method always returns | |
| startComment | back to summary |
|---|---|
| private int startComment(String line) Try to consume the | |