Package org.w3c.tidy
Class Report
java.lang.Object
org.w3c.tidy.Report
Error/informational message reporter. You should only need to edit the file TidyMessages.properties to localize HTML
tidy.
- Version:
- $Revision: 921 $ ($Author: aditsu $)
- Author:
- Dave Raggett dsr@w3.org , Andy Quick ac.quick@sympatico.ca (translation to Java), Fabrizio Giustina
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
used to point to Web Accessibility Guidelines.static final short
attribute: anchor not unique.static final short
invalid entity: apos undefined in current definition.static final short
attribute: attribute value not lower case.static final short
attribute: backslash in URI.static final short
attribute: bad attribute value.static final short
attribute: bad attribute value replaced.static final short
bad cdata comment.static final short
bad coment chars.static final short
bad xml comment.static final short
Constant used for reporting of bad access summary.static final short
Constant used for reporting of bad form summary.static final short
elments can be nested.static final short
coerce to end tag.static final short
coerce to endtag.static final short
content after body.static final short
char has been discarder.static final short
discarding unexpected element.static final short
doctype after tags.static final short
Constant used for reporting of given doctype.static final short
doctype not upper case.static final short
duplicate frameset.static final short
element not empty.static final short
encoding IO conflict.static final short
character encoding: encoding mismatch.static final short
attribute: entity in id.static final short
attribute: escaped illegal URI.static final short
attribute: fixed backslash.static final short
character encoding error: found utf16.static final short
attribute: id and name mismatch.static final short
illegal nesting.static final short
attribute: illegal URI reference.static final short
inconsistent namespace.static final short
inconsistent version.static final short
inserting tag.static final short
attribute: invalid attribute.static final short
character encoding: invalid NCR.static final short
character encoding: invalid sgml chars.static final short
character encoding: nvalid URI.static final short
character encoding: invalid utf16.static final short
character encoding: invalid utf8.static final short
attribute: invalid xml id.static final short
attribute: joining attribute.static final short
malformed comment.static final short
malformed doctype.static final short
attribute: missing attribute value.static final short
attribute: missing attribute.static final short
missing doctype.static final short
missing end tag before.static final short
missing an end tag.static final short
accessibility flaw: missing image map.static final short
accessibility flaw: missing image map.static final short
attribute: missing image map.static final short
accessibility flaw: missing link alt.static final short
attribute: missing quotemark.static final short
invalid entity: missing semicolon.static final short
invalid entity: missing semicolon.static final short
missing start tag.static final short
accessibility flaw: missing summary.static final short
missing title element.static final short
mixed content in block.static final short
nested emphasis.static final short
nested quotation.static final short
attribute: newline in URI.static final short
noframes content.static final short
character encoding error: non ascii.static final short
non matching end tag.static final short
obsolete element.static final short
attribute: proprietary attribute value.static final short
attribute: proprietary attribute.static final short
proprietary element.static final String
Release date String.static final short
attribute: repeated attribute.static final short
char has been replaced.static final short
replacing element.static final short
replacing unexcaped element.static final short
Constant used for reporting of version summary.static final short
space preceding xml declaration.static final short
suspected missing quote.static final short
tag not allowed in.static final short
too many element.static final short
too many elements in.static final short
trim empty element.static final short
invalid entity: unescaped ampersand.static final short
unescaped element.static final short
unexpected end of file.static final short
attribute: unexpected end of file.static final short
unexpected end tag.static final short
unexpected endag in.static final short
attribute: expected equalsign.static final short
attribute: unexpected gt.static final short
attribute: unexpected quotemark.static final short
attribute: unknown attribute.static final short
unknown element.static final short
invalid entity: unknown entity.static final short
presentation flaw: using body.static final short
unsing br in place of.static final short
presentation flaw: using font.static final short
accessibility flaw: using frames.static final short
presentation flaw: using layer.static final short
presentation flaw: using nobr.static final short
accessibility flaw: using noframes.static final short
presentation flaw: using spacer.static final short
character encoding: vendor specific chars.static final short
character encoding error: windows chars.static final short
attribute: xml attribute value.static final short
attribute: id sintax. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMessageListener
(TidyMessageListener listener) Adds a message listener.void
Prints error messages for attributes.void
badArgument
(String key, String value) Prints a "bad argument" error message.void
badTree
(PrintWriter errout) Prints the "bad tree" message.void
encodingError
(Lexer lexer, int code, int c) Prints encoding error messages.void
entityError
(Lexer lexer, short code, String entity, int c) Prints entity error messages.void
Prints errors.void
errorSummary
(Lexer lexer) Prints error summary.void
generalInfo
(PrintWriter errout) Prints tidy general info.protected String
getMessage
(int errorCode, Lexer lexer, String message, Object[] params, TidyMessage.Level level) Generates a complete message for the warning/error.void
helpText
(PrintWriter out) Prints tidy help.void
missingBody
(PrintWriter errout) Prints the "missing body" message.void
needsAuthorIntervention
(PrintWriter errout) Prints the "needs author intervention" message.void
reportNumberOfSlides
(PrintWriter errout, int count) Prints the number of generated slides.void
reportNumWarnings
(PrintWriter errout, Lexer lexer) Prints the number of error/warnings found.void
reportVersion
(PrintWriter errout, Lexer lexer, String filename, Node doctype) Prints information for html version in input file.void
setFilename
(String filename) Sets the current file name.void
print version information.void
unknownFile
(PrintWriter errout, String file) Prints the "unknown file" message.void
unknownOption
(PrintWriter errout, char c) Prints the "unknown option" message.void
unknownOption
(String option) Prints an "unknown option" error message.void
Prints warnings.
-
Field Details
-
ACCESS_URL
used to point to Web Accessibility Guidelines.- See Also:
-
RELEASE_DATE_STRING
Release date String. -
MISSING_SEMICOLON
public static final short MISSING_SEMICOLONinvalid entity: missing semicolon.- See Also:
-
MISSING_SEMICOLON_NCR
public static final short MISSING_SEMICOLON_NCRinvalid entity: missing semicolon.- See Also:
-
UNKNOWN_ENTITY
public static final short UNKNOWN_ENTITYinvalid entity: unknown entity.- See Also:
-
UNESCAPED_AMPERSAND
public static final short UNESCAPED_AMPERSANDinvalid entity: unescaped ampersand.- See Also:
-
APOS_UNDEFINED
public static final short APOS_UNDEFINEDinvalid entity: apos undefined in current definition.- See Also:
-
MISSING_ENDTAG_FOR
public static final short MISSING_ENDTAG_FORmissing an end tag.- See Also:
-
MISSING_ENDTAG_BEFORE
public static final short MISSING_ENDTAG_BEFOREmissing end tag before.- See Also:
-
DISCARDING_UNEXPECTED
public static final short DISCARDING_UNEXPECTEDdiscarding unexpected element.- See Also:
-
NESTED_EMPHASIS
public static final short NESTED_EMPHASISnested emphasis.- See Also:
-
NON_MATCHING_ENDTAG
public static final short NON_MATCHING_ENDTAGnon matching end tag.- See Also:
-
TAG_NOT_ALLOWED_IN
public static final short TAG_NOT_ALLOWED_INtag not allowed in.- See Also:
-
MISSING_STARTTAG
public static final short MISSING_STARTTAGmissing start tag.- See Also:
-
UNEXPECTED_ENDTAG
public static final short UNEXPECTED_ENDTAGunexpected end tag.- See Also:
-
USING_BR_INPLACE_OF
public static final short USING_BR_INPLACE_OFunsing br in place of.- See Also:
-
INSERTING_TAG
public static final short INSERTING_TAGinserting tag.- See Also:
-
SUSPECTED_MISSING_QUOTE
public static final short SUSPECTED_MISSING_QUOTEsuspected missing quote.- See Also:
-
MISSING_TITLE_ELEMENT
public static final short MISSING_TITLE_ELEMENTmissing title element.- See Also:
-
DUPLICATE_FRAMESET
public static final short DUPLICATE_FRAMESETduplicate frameset.- See Also:
-
CANT_BE_NESTED
public static final short CANT_BE_NESTEDelments can be nested.- See Also:
-
OBSOLETE_ELEMENT
public static final short OBSOLETE_ELEMENTobsolete element.- See Also:
-
PROPRIETARY_ELEMENT
public static final short PROPRIETARY_ELEMENTproprietary element.- See Also:
-
UNKNOWN_ELEMENT
public static final short UNKNOWN_ELEMENTunknown element.- See Also:
-
TRIM_EMPTY_ELEMENT
public static final short TRIM_EMPTY_ELEMENTtrim empty element.- See Also:
-
COERCE_TO_ENDTAG
public static final short COERCE_TO_ENDTAGcoerce to end tag.- See Also:
-
ILLEGAL_NESTING
public static final short ILLEGAL_NESTINGillegal nesting.- See Also:
-
NOFRAMES_CONTENT
public static final short NOFRAMES_CONTENTnoframes content.- See Also:
-
CONTENT_AFTER_BODY
public static final short CONTENT_AFTER_BODYcontent after body.- See Also:
-
INCONSISTENT_VERSION
public static final short INCONSISTENT_VERSIONinconsistent version.- See Also:
-
MALFORMED_COMMENT
public static final short MALFORMED_COMMENTmalformed comment.- See Also:
-
BAD_COMMENT_CHARS
public static final short BAD_COMMENT_CHARSbad coment chars.- See Also:
-
BAD_XML_COMMENT
public static final short BAD_XML_COMMENTbad xml comment.- See Also:
-
BAD_CDATA_CONTENT
public static final short BAD_CDATA_CONTENTbad cdata comment.- See Also:
-
INCONSISTENT_NAMESPACE
public static final short INCONSISTENT_NAMESPACEinconsistent namespace.- See Also:
-
DOCTYPE_AFTER_TAGS
public static final short DOCTYPE_AFTER_TAGSdoctype after tags.- See Also:
-
MALFORMED_DOCTYPE
public static final short MALFORMED_DOCTYPEmalformed doctype.- See Also:
-
UNEXPECTED_END_OF_FILE
public static final short UNEXPECTED_END_OF_FILEunexpected end of file.- See Also:
-
DTYPE_NOT_UPPER_CASE
public static final short DTYPE_NOT_UPPER_CASEdoctype not upper case.- See Also:
-
TOO_MANY_ELEMENTS
public static final short TOO_MANY_ELEMENTStoo many element.- See Also:
-
UNESCAPED_ELEMENT
public static final short UNESCAPED_ELEMENTunescaped element.- See Also:
-
NESTED_QUOTATION
public static final short NESTED_QUOTATIONnested quotation.- See Also:
-
ELEMENT_NOT_EMPTY
public static final short ELEMENT_NOT_EMPTYelement not empty.- See Also:
-
ENCODING_IO_CONFLICT
public static final short ENCODING_IO_CONFLICTencoding IO conflict.- See Also:
-
MIXED_CONTENT_IN_BLOCK
public static final short MIXED_CONTENT_IN_BLOCKmixed content in block.- See Also:
-
MISSING_DOCTYPE
public static final short MISSING_DOCTYPEmissing doctype.- See Also:
-
SPACE_PRECEDING_XMLDECL
public static final short SPACE_PRECEDING_XMLDECLspace preceding xml declaration.- See Also:
-
TOO_MANY_ELEMENTS_IN
public static final short TOO_MANY_ELEMENTS_INtoo many elements in.- See Also:
-
UNEXPECTED_ENDTAG_IN
public static final short UNEXPECTED_ENDTAG_INunexpected endag in.- See Also:
-
REPLACING_ELEMENT
public static final short REPLACING_ELEMENTreplacing element.- See Also:
-
REPLACING_UNEX_ELEMENT
public static final short REPLACING_UNEX_ELEMENTreplacing unexcaped element.- See Also:
-
COERCE_TO_ENDTAG_WARN
public static final short COERCE_TO_ENDTAG_WARNcoerce to endtag.- See Also:
-
UNKNOWN_ATTRIBUTE
public static final short UNKNOWN_ATTRIBUTEattribute: unknown attribute.- See Also:
-
MISSING_ATTRIBUTE
public static final short MISSING_ATTRIBUTEattribute: missing attribute.- See Also:
-
MISSING_ATTR_VALUE
public static final short MISSING_ATTR_VALUEattribute: missing attribute value.- See Also:
-
BAD_ATTRIBUTE_VALUE
public static final short BAD_ATTRIBUTE_VALUEattribute: bad attribute value.- See Also:
-
UNEXPECTED_GT
public static final short UNEXPECTED_GTattribute: unexpected gt.- See Also:
-
PROPRIETARY_ATTRIBUTE
public static final short PROPRIETARY_ATTRIBUTEattribute: proprietary attribute.- See Also:
-
PROPRIETARY_ATTR_VALUE
public static final short PROPRIETARY_ATTR_VALUEattribute: proprietary attribute value.- See Also:
-
REPEATED_ATTRIBUTE
public static final short REPEATED_ATTRIBUTEattribute: repeated attribute.- See Also:
-
MISSING_IMAGEMAP
public static final short MISSING_IMAGEMAPattribute: missing image map.- See Also:
-
XML_ATTRIBUTE_VALUE
public static final short XML_ATTRIBUTE_VALUEattribute: xml attribute value.- See Also:
-
MISSING_QUOTEMARK
public static final short MISSING_QUOTEMARKattribute: missing quotemark.- See Also:
-
UNEXPECTED_QUOTEMARK
public static final short UNEXPECTED_QUOTEMARKattribute: unexpected quotemark.- See Also:
-
ID_NAME_MISMATCH
public static final short ID_NAME_MISMATCHattribute: id and name mismatch.- See Also:
-
BACKSLASH_IN_URI
public static final short BACKSLASH_IN_URIattribute: backslash in URI.- See Also:
-
FIXED_BACKSLASH
public static final short FIXED_BACKSLASHattribute: fixed backslash.- See Also:
-
ILLEGAL_URI_REFERENCE
public static final short ILLEGAL_URI_REFERENCEattribute: illegal URI reference.- See Also:
-
ESCAPED_ILLEGAL_URI
public static final short ESCAPED_ILLEGAL_URIattribute: escaped illegal URI.- See Also:
-
NEWLINE_IN_URI
public static final short NEWLINE_IN_URIattribute: newline in URI.- See Also:
-
ANCHOR_NOT_UNIQUE
public static final short ANCHOR_NOT_UNIQUEattribute: anchor not unique.- See Also:
-
ENTITY_IN_ID
public static final short ENTITY_IN_IDattribute: entity in id.- See Also:
-
JOINING_ATTRIBUTE
public static final short JOINING_ATTRIBUTEattribute: joining attribute.- See Also:
-
UNEXPECTED_EQUALSIGN
public static final short UNEXPECTED_EQUALSIGNattribute: expected equalsign.- See Also:
-
ATTR_VALUE_NOT_LCASE
public static final short ATTR_VALUE_NOT_LCASEattribute: attribute value not lower case.- See Also:
-
XML_ID_SYNTAX
public static final short XML_ID_SYNTAXattribute: id sintax.- See Also:
-
INVALID_ATTRIBUTE
public static final short INVALID_ATTRIBUTEattribute: invalid attribute.- See Also:
-
BAD_ATTRIBUTE_VALUE_REPLACED
public static final short BAD_ATTRIBUTE_VALUE_REPLACEDattribute: bad attribute value replaced.- See Also:
-
INVALID_XML_ID
public static final short INVALID_XML_IDattribute: invalid xml id.- See Also:
-
UNEXPECTED_END_OF_FILE_ATTR
public static final short UNEXPECTED_END_OF_FILE_ATTRattribute: unexpected end of file.- See Also:
-
VENDOR_SPECIFIC_CHARS
public static final short VENDOR_SPECIFIC_CHARScharacter encoding: vendor specific chars.- See Also:
-
INVALID_SGML_CHARS
public static final short INVALID_SGML_CHARScharacter encoding: invalid sgml chars.- See Also:
-
INVALID_UTF8
public static final short INVALID_UTF8character encoding: invalid utf8.- See Also:
-
INVALID_UTF16
public static final short INVALID_UTF16character encoding: invalid utf16.- See Also:
-
ENCODING_MISMATCH
public static final short ENCODING_MISMATCHcharacter encoding: encoding mismatch.- See Also:
-
INVALID_URI
public static final short INVALID_URIcharacter encoding: nvalid URI.- See Also:
-
INVALID_NCR
public static final short INVALID_NCRcharacter encoding: invalid NCR.- See Also:
-
DOCTYPE_GIVEN_SUMMARY
public static final short DOCTYPE_GIVEN_SUMMARYConstant used for reporting of given doctype.- See Also:
-
REPORT_VERSION_SUMMARY
public static final short REPORT_VERSION_SUMMARYConstant used for reporting of version summary.- See Also:
-
BADACCESS_SUMMARY
public static final short BADACCESS_SUMMARYConstant used for reporting of bad access summary.- See Also:
-
BADFORM_SUMMARY
public static final short BADFORM_SUMMARYConstant used for reporting of bad form summary.- See Also:
-
MISSING_IMAGE_ALT
public static final short MISSING_IMAGE_ALTaccessibility flaw: missing image map.- See Also:
-
MISSING_LINK_ALT
public static final short MISSING_LINK_ALTaccessibility flaw: missing link alt.- See Also:
-
MISSING_SUMMARY
public static final short MISSING_SUMMARYaccessibility flaw: missing summary.- See Also:
-
MISSING_IMAGE_MAP
public static final short MISSING_IMAGE_MAPaccessibility flaw: missing image map.- See Also:
-
USING_FRAMES
public static final short USING_FRAMESaccessibility flaw: using frames.- See Also:
-
USING_NOFRAMES
public static final short USING_NOFRAMESaccessibility flaw: using noframes.- See Also:
-
USING_SPACER
public static final short USING_SPACERpresentation flaw: using spacer.- See Also:
-
USING_LAYER
public static final short USING_LAYERpresentation flaw: using layer.- See Also:
-
USING_NOBR
public static final short USING_NOBRpresentation flaw: using nobr.- See Also:
-
USING_FONT
public static final short USING_FONTpresentation flaw: using font.- See Also:
-
USING_BODY
public static final short USING_BODYpresentation flaw: using body.- See Also:
-
WINDOWS_CHARS
public static final short WINDOWS_CHARScharacter encoding error: windows chars.- See Also:
-
NON_ASCII
public static final short NON_ASCIIcharacter encoding error: non ascii.- See Also:
-
FOUND_UTF16
public static final short FOUND_UTF16character encoding error: found utf16.- See Also:
-
REPLACED_CHAR
public static final short REPLACED_CHARchar has been replaced.- See Also:
-
DISCARDED_CHAR
public static final short DISCARDED_CHARchar has been discarder.- See Also:
-
-
Constructor Details
-
Report
protected Report()Instantiated only in Tidy() constructor.
-
-
Method Details
-
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
- Parameters:
errorCode
- tidy error codelexer
- Lexermessage
- key for the ResourceBundleparams
- optional parameters added with MessageFormatlevel
- message level. One ofTidyMessage.LEVEL_ERROR
,TidyMessage.LEVEL_WARNING
,TidyMessage.LEVEL_INFO
- Returns:
- formatted message
- Throws:
MissingResourceException
- ifmessage
key is not available in jtidy resource bundle.- See Also:
-
showVersion
print version information.- Parameters:
p
- printWriter
-
unknownOption
Prints an "unknown option" error message. Lexer is not defined when this is called.- Parameters:
option
- unknown option name
-
badArgument
Prints a "bad argument" error message. Lexer is not defined when this is called.- Parameters:
key
- argument namevalue
- bad argument value
-
encodingError
Prints encoding error messages.- Parameters:
lexer
- Lexercode
- error codec
- invalid char
-
entityError
Prints entity error messages.- Parameters:
lexer
- Lexercode
- error codeentity
- invalid entity Stringc
- invalid char
-
attrError
Prints error messages for attributes.- Parameters:
lexer
- Lexernode
- current tagattribute
- attributecode
- error code
-
warning
Prints warnings.- Parameters:
lexer
- Lexerelement
- parent/missing tagnode
- current tagcode
- error code
-
error
Prints errors.- Parameters:
lexer
- Lexerelement
- parent/missing tagnode
- current tagcode
- error code
-
errorSummary
Prints error summary.- Parameters:
lexer
- Lexer
-
unknownOption
Prints the "unknown option" message.- Parameters:
errout
- PrintWriterc
- invalid option char
-
unknownFile
Prints the "unknown file" message.- Parameters:
errout
- PrintWriterfile
- invalid file name
-
needsAuthorIntervention
Prints the "needs author intervention" message.- Parameters:
errout
- PrintWriter
-
missingBody
Prints the "missing body" message.- Parameters:
errout
- PrintWriter
-
reportNumberOfSlides
Prints the number of generated slides.- Parameters:
errout
- PrintWritercount
- slides count
-
generalInfo
Prints tidy general info.- Parameters:
errout
- PrintWriter
-
setFilename
Sets the current file name.- Parameters:
filename
- current file.
-
reportVersion
Prints information for html version in input file.- Parameters:
errout
- PrintWriterlexer
- Lexerfilename
- file namedoctype
- doctype Node
-
reportNumWarnings
Prints the number of error/warnings found.- Parameters:
errout
- PrintWriterlexer
- Lexer
-
helpText
Prints tidy help.- Parameters:
out
- PrintWriter
-
badTree
Prints the "bad tree" message.- Parameters:
errout
- PrintWriter
-
addMessageListener
Adds a message listener.- Parameters:
listener
- TidyMessageListener
-