Error/informational message reporter. You should only need to edit the file TidyMessages.properties to localize HTML
tidy.
ACCESS_URL
public static final String ACCESS_URL
used to point to Web Accessibility Guidelines.
ANCHOR_NOT_UNIQUE
public static final short ANCHOR_NOT_UNIQUE
attribute: anchor not unique.
APOS_UNDEFINED
public static final short APOS_UNDEFINED
invalid entity: apos undefined in current definition.
ATTR_VALUE_NOT_LCASE
public static final short ATTR_VALUE_NOT_LCASE
attribute: attribute value not lower case.
BACKSLASH_IN_URI
public static final short BACKSLASH_IN_URI
attribute: backslash in URI.
BADACCESS_SUMMARY
public static final short BADACCESS_SUMMARY
Constant used for reporting of bad access summary.
BADFORM_SUMMARY
public static final short BADFORM_SUMMARY
Constant used for reporting of bad form summary.
BAD_ATTRIBUTE_VALUE
public static final short BAD_ATTRIBUTE_VALUE
attribute: bad attribute value.
BAD_ATTRIBUTE_VALUE_REPLACED
public static final short BAD_ATTRIBUTE_VALUE_REPLACED
attribute: bad attribute value replaced.
BAD_CDATA_CONTENT
public static final short BAD_CDATA_CONTENT
bad cdata comment.
BAD_COMMENT_CHARS
public static final short BAD_COMMENT_CHARS
bad coment chars.
BAD_XML_COMMENT
public static final short BAD_XML_COMMENT
bad xml comment.
CANT_BE_NESTED
public static final short CANT_BE_NESTED
elments can be nested.
COERCE_TO_ENDTAG
public static final short COERCE_TO_ENDTAG
coerce to end tag.
COERCE_TO_ENDTAG_WARN
public static final short COERCE_TO_ENDTAG_WARN
coerce to endtag.
CONTENT_AFTER_BODY
public static final short CONTENT_AFTER_BODY
content after body.
DISCARDED_CHAR
public static final short DISCARDED_CHAR
char has been discarder.
DISCARDING_UNEXPECTED
public static final short DISCARDING_UNEXPECTED
discarding unexpected element.
DOCTYPE_AFTER_TAGS
public static final short DOCTYPE_AFTER_TAGS
doctype after tags.
DOCTYPE_GIVEN_SUMMARY
public static final short DOCTYPE_GIVEN_SUMMARY
Constant used for reporting of given doctype.
DTYPE_NOT_UPPER_CASE
public static final short DTYPE_NOT_UPPER_CASE
doctype not upper case.
DUPLICATE_FRAMESET
public static final short DUPLICATE_FRAMESET
duplicate frameset.
ELEMENT_NOT_EMPTY
public static final short ELEMENT_NOT_EMPTY
element not empty.
ENCODING_IO_CONFLICT
public static final short ENCODING_IO_CONFLICT
encoding IO conflict.
ENCODING_MISMATCH
public static final short ENCODING_MISMATCH
character encoding: encoding mismatch.
ENTITY_IN_ID
public static final short ENTITY_IN_ID
attribute: entity in id.
ESCAPED_ILLEGAL_URI
public static final short ESCAPED_ILLEGAL_URI
attribute: escaped illegal URI.
FIXED_BACKSLASH
public static final short FIXED_BACKSLASH
attribute: fixed backslash.
FOUND_UTF16
public static final short FOUND_UTF16
character encoding error: found utf16.
ID_NAME_MISMATCH
public static final short ID_NAME_MISMATCH
attribute: id and name mismatch.
ILLEGAL_NESTING
public static final short ILLEGAL_NESTING
illegal nesting.
ILLEGAL_URI_REFERENCE
public static final short ILLEGAL_URI_REFERENCE
attribute: illegal URI reference.
INCONSISTENT_NAMESPACE
public static final short INCONSISTENT_NAMESPACE
inconsistent namespace.
INCONSISTENT_VERSION
public static final short INCONSISTENT_VERSION
inconsistent version.
INSERTING_TAG
public static final short INSERTING_TAG
inserting tag.
INVALID_ATTRIBUTE
public static final short INVALID_ATTRIBUTE
attribute: invalid attribute.
INVALID_NCR
public static final short INVALID_NCR
character encoding: invalid NCR.
INVALID_SGML_CHARS
public static final short INVALID_SGML_CHARS
character encoding: invalid sgml chars.
INVALID_URI
public static final short INVALID_URI
character encoding: nvalid URI.
INVALID_UTF16
public static final short INVALID_UTF16
character encoding: invalid utf16.
INVALID_UTF8
public static final short INVALID_UTF8
character encoding: invalid utf8.
INVALID_XML_ID
public static final short INVALID_XML_ID
attribute: invalid xml id.
JOINING_ATTRIBUTE
public static final short JOINING_ATTRIBUTE
attribute: joining attribute.
MALFORMED_COMMENT
public static final short MALFORMED_COMMENT
malformed comment.
MALFORMED_DOCTYPE
public static final short MALFORMED_DOCTYPE
malformed doctype.
MISSING_ATTRIBUTE
public static final short MISSING_ATTRIBUTE
attribute: missing attribute.
MISSING_ATTR_VALUE
public static final short MISSING_ATTR_VALUE
attribute: missing attribute value.
MISSING_DOCTYPE
public static final short MISSING_DOCTYPE
missing doctype.
MISSING_ENDTAG_BEFORE
public static final short MISSING_ENDTAG_BEFORE
missing end tag before.
MISSING_ENDTAG_FOR
public static final short MISSING_ENDTAG_FOR
missing an end tag.
MISSING_IMAGEMAP
public static final short MISSING_IMAGEMAP
attribute: missing image map.
MISSING_IMAGE_ALT
public static final short MISSING_IMAGE_ALT
accessibility flaw: missing image map.
MISSING_IMAGE_MAP
public static final short MISSING_IMAGE_MAP
accessibility flaw: missing image map.
MISSING_LINK_ALT
public static final short MISSING_LINK_ALT
accessibility flaw: missing link alt.
MISSING_QUOTEMARK
public static final short MISSING_QUOTEMARK
attribute: missing quotemark.
MISSING_SEMICOLON
public static final short MISSING_SEMICOLON
invalid entity: missing semicolon.
MISSING_SEMICOLON_NCR
public static final short MISSING_SEMICOLON_NCR
invalid entity: missing semicolon.
MISSING_STARTTAG
public static final short MISSING_STARTTAG
missing start tag.
MISSING_SUMMARY
public static final short MISSING_SUMMARY
accessibility flaw: missing summary.
MISSING_TITLE_ELEMENT
public static final short MISSING_TITLE_ELEMENT
missing title element.
MIXED_CONTENT_IN_BLOCK
public static final short MIXED_CONTENT_IN_BLOCK
mixed content in block.
NESTED_EMPHASIS
public static final short NESTED_EMPHASIS
nested emphasis.
NESTED_QUOTATION
public static final short NESTED_QUOTATION
nested quotation.
NEWLINE_IN_URI
public static final short NEWLINE_IN_URI
attribute: newline in URI.
NOFRAMES_CONTENT
public static final short NOFRAMES_CONTENT
noframes content.
NON_ASCII
public static final short NON_ASCII
character encoding error: non ascii.
NON_MATCHING_ENDTAG
public static final short NON_MATCHING_ENDTAG
non matching end tag.
OBSOLETE_ELEMENT
public static final short OBSOLETE_ELEMENT
obsolete element.
PROPRIETARY_ATTRIBUTE
public static final short PROPRIETARY_ATTRIBUTE
attribute: proprietary attribute.
PROPRIETARY_ATTR_VALUE
public static final short PROPRIETARY_ATTR_VALUE
attribute: proprietary attribute value.
PROPRIETARY_ELEMENT
public static final short PROPRIETARY_ELEMENT
proprietary element.
RELEASE_DATE
public static final Date RELEASE_DATE
Release date.
RELEASE_DATE_STRING
public static final String RELEASE_DATE_STRING
Release date String.
REPEATED_ATTRIBUTE
public static final short REPEATED_ATTRIBUTE
attribute: repeated attribute.
REPLACED_CHAR
public static final short REPLACED_CHAR
char has been replaced.
REPLACING_ELEMENT
public static final short REPLACING_ELEMENT
replacing element.
REPLACING_UNEX_ELEMENT
public static final short REPLACING_UNEX_ELEMENT
replacing unexcaped element.
REPORT_VERSION_SUMMARY
public static final short REPORT_VERSION_SUMMARY
Constant used for reporting of version summary.
SPACE_PRECEDING_XMLDECL
public static final short SPACE_PRECEDING_XMLDECL
space preceding xml declaration.
SUSPECTED_MISSING_QUOTE
public static final short SUSPECTED_MISSING_QUOTE
suspected missing quote.
TAG_NOT_ALLOWED_IN
public static final short TAG_NOT_ALLOWED_IN
tag not allowed in.
TOO_MANY_ELEMENTS
public static final short TOO_MANY_ELEMENTS
too many element.
TOO_MANY_ELEMENTS_IN
public static final short TOO_MANY_ELEMENTS_IN
too many elements in.
TRIM_EMPTY_ELEMENT
public static final short TRIM_EMPTY_ELEMENT
trim empty element.
UNESCAPED_AMPERSAND
public static final short UNESCAPED_AMPERSAND
invalid entity: unescaped ampersand.
UNESCAPED_ELEMENT
public static final short UNESCAPED_ELEMENT
unescaped element.
UNEXPECTED_ENDTAG
public static final short UNEXPECTED_ENDTAG
unexpected end tag.
UNEXPECTED_ENDTAG_IN
public static final short UNEXPECTED_ENDTAG_IN
unexpected endag in.
UNEXPECTED_END_OF_FILE
public static final short UNEXPECTED_END_OF_FILE
unexpected end of file.
UNEXPECTED_END_OF_FILE_ATTR
public static final short UNEXPECTED_END_OF_FILE_ATTR
attribute: unexpected end of file.
UNEXPECTED_EQUALSIGN
public static final short UNEXPECTED_EQUALSIGN
attribute: expected equalsign.
UNEXPECTED_GT
public static final short UNEXPECTED_GT
attribute: unexpected gt.
UNEXPECTED_QUOTEMARK
public static final short UNEXPECTED_QUOTEMARK
attribute: unexpected quotemark.
UNKNOWN_ATTRIBUTE
public static final short UNKNOWN_ATTRIBUTE
attribute: unknown attribute.
UNKNOWN_ELEMENT
public static final short UNKNOWN_ELEMENT
unknown element.
UNKNOWN_ENTITY
public static final short UNKNOWN_ENTITY
invalid entity: unknown entity.
USING_BODY
public static final short USING_BODY
presentation flaw: using body.
USING_BR_INPLACE_OF
public static final short USING_BR_INPLACE_OF
unsing br in place of.
USING_FONT
public static final short USING_FONT
presentation flaw: using font.
USING_FRAMES
public static final short USING_FRAMES
accessibility flaw: using frames.
USING_LAYER
public static final short USING_LAYER
presentation flaw: using layer.
USING_NOBR
public static final short USING_NOBR
presentation flaw: using nobr.
USING_NOFRAMES
public static final short USING_NOFRAMES
accessibility flaw: using noframes.
USING_SPACER
public static final short USING_SPACER
presentation flaw: using spacer.
VENDOR_SPECIFIC_CHARS
public static final short VENDOR_SPECIFIC_CHARS
character encoding: vendor specific chars.
WINDOWS_CHARS
public static final short WINDOWS_CHARS
character encoding error: windows chars.
XML_ATTRIBUTE_VALUE
public static final short XML_ATTRIBUTE_VALUE
attribute: xml attribute value.
XML_ID_SYNTAX
public static final short XML_ID_SYNTAX
attribute: id sintax.
addMessageListener
public void addMessageListener(TidyMessageListener listener)
Adds a message listener.
listener
- TidyMessageListener
attrError
public void attrError(Lexer lexer,
Node node,
AttVal attribute,
short code)
Prints error messages for attributes.
lexer
- Lexernode
- current tagattribute
- attributecode
- error code
badArgument
public void badArgument(String key,
String value)
Prints a "bad argument" error message. Lexer is not defined when this is called.
key
- argument namevalue
- bad argument value
badTree
public void badTree(PrintWriter errout)
Prints the "bad tree" message.
encodingError
public void encodingError(Lexer lexer,
int code,
int c)
Prints encoding error messages.
lexer
- Lexercode
- error codec
- invalid char
entityError
public void entityError(Lexer lexer,
short code,
String entity,
int c)
Prints entity error messages.
lexer
- Lexercode
- error codeentity
- invalid entity Stringc
- invalid char
error
public void error(Lexer lexer,
Node element,
Node node,
short code)
Prints errors.
lexer
- Lexerelement
- parent/missing tagnode
- current tagcode
- error code
errorSummary
public void errorSummary(Lexer lexer)
Prints error summary.
generalInfo
public void generalInfo(PrintWriter errout)
Prints tidy general info.
getMessage
protected String getMessage(int errorCode,
Lexer lexer,
String message,
Object[] params,
TidyMessage.Level level)
throws MissingResourceException
Generates a complete message for the warning/error. The message is composed by:
- position in file
- prefix for the error level (warning: | error:)
- message read from ResourceBundle
- optional parameters added to message using MessageFormat
errorCode
- tidy error codelexer
- Lexermessage
- key for the ResourceBundleparams
- optional parameters added with MessageFormatlevel
- message level. One of TidyMessage.LEVEL_ERROR
,
TidyMessage.LEVEL_WARNING
,TidyMessage.LEVEL_INFO
helloMessage
public void helloMessage(PrintWriter errout)
Prints tidy hello message.
helpText
public void helpText(PrintWriter out)
Prints tidy help.
missingBody
public void missingBody(PrintWriter errout)
Prints the "missing body" message.
needsAuthorIntervention
public void needsAuthorIntervention(PrintWriter errout)
Prints the "needs author intervention" message.
reportNumWarnings
public void reportNumWarnings(PrintWriter errout,
Lexer lexer)
Prints the number of error/warnings found.
errout
- PrintWriterlexer
- Lexer
reportNumberOfSlides
public void reportNumberOfSlides(PrintWriter errout,
int count)
Prints the number of generated slides.
errout
- PrintWritercount
- slides count
reportVersion
public void reportVersion(PrintWriter errout,
Lexer lexer,
String filename,
Node doctype)
Prints information for html version in input file.
errout
- PrintWriterlexer
- Lexerfilename
- file namedoctype
- doctype Node
setFilename
public void setFilename(String filename)
Sets the current file name.
showVersion
public void showVersion(PrintWriter p)
print version information.
unknownFile
public void unknownFile(PrintWriter errout,
String file)
Prints the "unknown file" message.
errout
- PrintWriterfile
- invalid file name
unknownOption
public void unknownOption(PrintWriter errout,
char c)
Prints the "unknown option" message.
errout
- PrintWriterc
- invalid option char
unknownOption
public void unknownOption(String option)
Prints an "unknown option" error message. Lexer is not defined when this is called.
option
- unknown option name
warning
public void warning(Lexer lexer,
Node element,
Node node,
short code)
Prints warnings.
lexer
- Lexerelement
- parent/missing tagnode
- current tagcode
- error code