org.w3c.tidy

Class Report


public final class Report
extends java.lang.Object

Error/informational message reporter. You should only need to edit the file TidyMessages.properties to localize HTML tidy.
Version:
$Revision: 646 $ ($Author: fgiust $)
Authors:
Dave Raggett dsr@w3.org
Andy Quick ac.quick@sympatico.ca (translation to Java)
Fabrizio Giustina

Field Summary

static String
ACCESS_URL
used to point to Web Accessibility Guidelines.
static short
ANCHOR_NOT_UNIQUE
attribute: anchor not unique.
static short
APOS_UNDEFINED
invalid entity: apos undefined in current definition.
static short
ATTR_VALUE_NOT_LCASE
attribute: attribute value not lower case.
static short
BACKSLASH_IN_URI
attribute: backslash in URI.
static short
BADACCESS_SUMMARY
Constant used for reporting of bad access summary.
static short
BADFORM_SUMMARY
Constant used for reporting of bad form summary.
static short
BAD_ATTRIBUTE_VALUE
attribute: bad attribute value.
static short
BAD_ATTRIBUTE_VALUE_REPLACED
attribute: bad attribute value replaced.
static short
BAD_CDATA_CONTENT
bad cdata comment.
static short
BAD_COMMENT_CHARS
bad coment chars.
static short
BAD_XML_COMMENT
bad xml comment.
static short
CANT_BE_NESTED
elments can be nested.
static short
COERCE_TO_ENDTAG
coerce to end tag.
static short
COERCE_TO_ENDTAG_WARN
coerce to endtag.
static short
CONTENT_AFTER_BODY
content after body.
static short
DISCARDED_CHAR
char has been discarder.
static short
DISCARDING_UNEXPECTED
discarding unexpected element.
static short
DOCTYPE_AFTER_TAGS
doctype after tags.
static short
DOCTYPE_GIVEN_SUMMARY
Constant used for reporting of given doctype.
static short
DTYPE_NOT_UPPER_CASE
doctype not upper case.
static short
DUPLICATE_FRAMESET
duplicate frameset.
static short
ELEMENT_NOT_EMPTY
element not empty.
static short
ENCODING_IO_CONFLICT
encoding IO conflict.
static short
ENCODING_MISMATCH
character encoding: encoding mismatch.
static short
ENTITY_IN_ID
attribute: entity in id.
static short
ESCAPED_ILLEGAL_URI
attribute: escaped illegal URI.
static short
FIXED_BACKSLASH
attribute: fixed backslash.
static short
FOUND_UTF16
character encoding error: found utf16.
static short
ID_NAME_MISMATCH
attribute: id and name mismatch.
static short
ILLEGAL_NESTING
illegal nesting.
static short
ILLEGAL_URI_REFERENCE
attribute: illegal URI reference.
static short
INCONSISTENT_NAMESPACE
inconsistent namespace.
static short
INCONSISTENT_VERSION
inconsistent version.
static short
INSERTING_TAG
inserting tag.
static short
INVALID_ATTRIBUTE
attribute: invalid attribute.
static short
INVALID_NCR
character encoding: invalid NCR.
static short
INVALID_SGML_CHARS
character encoding: invalid sgml chars.
static short
INVALID_URI
character encoding: nvalid URI.
static short
INVALID_UTF16
character encoding: invalid utf16.
static short
INVALID_UTF8
character encoding: invalid utf8.
static short
INVALID_XML_ID
attribute: invalid xml id.
static short
JOINING_ATTRIBUTE
attribute: joining attribute.
static short
MALFORMED_COMMENT
malformed comment.
static short
MALFORMED_DOCTYPE
malformed doctype.
static short
MISSING_ATTRIBUTE
attribute: missing attribute.
static short
MISSING_ATTR_VALUE
attribute: missing attribute value.
static short
MISSING_DOCTYPE
missing doctype.
static short
MISSING_ENDTAG_BEFORE
missing end tag before.
static short
MISSING_ENDTAG_FOR
missing an end tag.
static short
MISSING_IMAGEMAP
attribute: missing image map.
static short
MISSING_IMAGE_ALT
accessibility flaw: missing image map.
static short
MISSING_IMAGE_MAP
accessibility flaw: missing image map.
static short
MISSING_LINK_ALT
accessibility flaw: missing link alt.
static short
MISSING_QUOTEMARK
attribute: missing quotemark.
static short
MISSING_SEMICOLON
invalid entity: missing semicolon.
static short
MISSING_SEMICOLON_NCR
invalid entity: missing semicolon.
static short
MISSING_STARTTAG
missing start tag.
static short
MISSING_SUMMARY
accessibility flaw: missing summary.
static short
MISSING_TITLE_ELEMENT
missing title element.
static short
MIXED_CONTENT_IN_BLOCK
mixed content in block.
static short
NESTED_EMPHASIS
nested emphasis.
static short
NESTED_QUOTATION
nested quotation.
static short
NEWLINE_IN_URI
attribute: newline in URI.
static short
NOFRAMES_CONTENT
noframes content.
static short
NON_ASCII
character encoding error: non ascii.
static short
NON_MATCHING_ENDTAG
non matching end tag.
static short
OBSOLETE_ELEMENT
obsolete element.
static short
PROPRIETARY_ATTRIBUTE
attribute: proprietary attribute.
static short
PROPRIETARY_ATTR_VALUE
attribute: proprietary attribute value.
static short
PROPRIETARY_ELEMENT
proprietary element.
static Date
RELEASE_DATE
Release date.
static String
RELEASE_DATE_STRING
Release date String.
static short
REPEATED_ATTRIBUTE
attribute: repeated attribute.
static short
REPLACED_CHAR
char has been replaced.
static short
REPLACING_ELEMENT
replacing element.
static short
REPLACING_UNEX_ELEMENT
replacing unexcaped element.
static short
REPORT_VERSION_SUMMARY
Constant used for reporting of version summary.
static short
SPACE_PRECEDING_XMLDECL
space preceding xml declaration.
static short
SUSPECTED_MISSING_QUOTE
suspected missing quote.
static short
TAG_NOT_ALLOWED_IN
tag not allowed in.
static short
TOO_MANY_ELEMENTS
too many element.
static short
TOO_MANY_ELEMENTS_IN
too many elements in.
static short
TRIM_EMPTY_ELEMENT
trim empty element.
static short
UNESCAPED_AMPERSAND
invalid entity: unescaped ampersand.
static short
UNESCAPED_ELEMENT
unescaped element.
static short
UNEXPECTED_ENDTAG
unexpected end tag.
static short
UNEXPECTED_ENDTAG_IN
unexpected endag in.
static short
UNEXPECTED_END_OF_FILE
unexpected end of file.
static short
UNEXPECTED_END_OF_FILE_ATTR
attribute: unexpected end of file.
static short
UNEXPECTED_EQUALSIGN
attribute: expected equalsign.
static short
UNEXPECTED_GT
attribute: unexpected gt.
static short
UNEXPECTED_QUOTEMARK
attribute: unexpected quotemark.
static short
UNKNOWN_ATTRIBUTE
attribute: unknown attribute.
static short
UNKNOWN_ELEMENT
unknown element.
static short
UNKNOWN_ENTITY
invalid entity: unknown entity.
static short
USING_BODY
presentation flaw: using body.
static short
USING_BR_INPLACE_OF
unsing br in place of.
static short
USING_FONT
presentation flaw: using font.
static short
USING_FRAMES
accessibility flaw: using frames.
static short
USING_LAYER
presentation flaw: using layer.
static short
USING_NOBR
presentation flaw: using nobr.
static short
USING_NOFRAMES
accessibility flaw: using noframes.
static short
USING_SPACER
presentation flaw: using spacer.
static short
VENDOR_SPECIFIC_CHARS
character encoding: vendor specific chars.
static short
WINDOWS_CHARS
character encoding error: windows chars.
static short
XML_ATTRIBUTE_VALUE
attribute: xml attribute value.
static short
XML_ID_SYNTAX
attribute: id sintax.

Constructor Summary

Report()
Instantiated only in Tidy() constructor.

Method Summary

void
addMessageListener(TidyMessageListener listener)
Adds a message listener.
void
attrError(Lexer lexer, Node node, AttVal attribute, short code)
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
error(Lexer lexer, Node element, Node node, short code)
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
helloMessage(PrintWriter errout)
Prints tidy hello message.
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
reportNumWarnings(PrintWriter errout, Lexer lexer)
Prints the number of error/warnings found.
void
reportNumberOfSlides(PrintWriter errout, int count)
Prints the number of generated slides.
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
showVersion(PrintWriter p)
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
warning(Lexer lexer, Node element, Node node, short code)
Prints warnings.

Field Details

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.
Field Value:
66

APOS_UNDEFINED

public static final short APOS_UNDEFINED
invalid entity: apos undefined in current definition.
Field Value:
5

ATTR_VALUE_NOT_LCASE

public static final short ATTR_VALUE_NOT_LCASE
attribute: attribute value not lower case.
Field Value:
70

BACKSLASH_IN_URI

public static final short BACKSLASH_IN_URI
attribute: backslash in URI.
Field Value:
61

BADACCESS_SUMMARY

public static final short BADACCESS_SUMMARY
Constant used for reporting of bad access summary.
Field Value:
112

BADFORM_SUMMARY

public static final short BADFORM_SUMMARY
Constant used for reporting of bad form summary.
Field Value:
113

BAD_ATTRIBUTE_VALUE

public static final short BAD_ATTRIBUTE_VALUE
attribute: bad attribute value.
Field Value:
51

BAD_ATTRIBUTE_VALUE_REPLACED

public static final short BAD_ATTRIBUTE_VALUE_REPLACED
attribute: bad attribute value replaced.
Field Value:
73

BAD_CDATA_CONTENT

public static final short BAD_CDATA_CONTENT
bad cdata comment.
Field Value:
32

BAD_COMMENT_CHARS

public static final short BAD_COMMENT_CHARS
bad coment chars.
Field Value:
30

BAD_XML_COMMENT

public static final short BAD_XML_COMMENT
bad xml comment.
Field Value:
31

CANT_BE_NESTED

public static final short CANT_BE_NESTED
elments can be nested.
Field Value:
19

COERCE_TO_ENDTAG

public static final short COERCE_TO_ENDTAG
coerce to end tag.
Field Value:
24

COERCE_TO_ENDTAG_WARN

public static final short COERCE_TO_ENDTAG_WARN
coerce to endtag.
Field Value:
85

CONTENT_AFTER_BODY

public static final short CONTENT_AFTER_BODY
content after body.
Field Value:
27

DISCARDED_CHAR

public static final short DISCARDED_CHAR
char has been discarder.
Field Value:
1

DISCARDING_UNEXPECTED

public static final short DISCARDING_UNEXPECTED
discarding unexpected element.
Field Value:
8

DOCTYPE_AFTER_TAGS

public static final short DOCTYPE_AFTER_TAGS
doctype after tags.
Field Value:
34

DOCTYPE_GIVEN_SUMMARY

public static final short DOCTYPE_GIVEN_SUMMARY
Constant used for reporting of given doctype.
Field Value:
110

DTYPE_NOT_UPPER_CASE

public static final short DTYPE_NOT_UPPER_CASE
doctype not upper case.
Field Value:
37

DUPLICATE_FRAMESET

public static final short DUPLICATE_FRAMESET
duplicate frameset.
Field Value:
18

ELEMENT_NOT_EMPTY

public static final short ELEMENT_NOT_EMPTY
element not empty.
Field Value:
41

ENCODING_IO_CONFLICT

public static final short ENCODING_IO_CONFLICT
encoding IO conflict.
Field Value:
42

ENCODING_MISMATCH

public static final short ENCODING_MISMATCH
character encoding: encoding mismatch.
Field Value:
80

ENTITY_IN_ID

public static final short ENTITY_IN_ID
attribute: entity in id.
Field Value:
67

ESCAPED_ILLEGAL_URI

public static final short ESCAPED_ILLEGAL_URI
attribute: escaped illegal URI.
Field Value:
64

FIXED_BACKSLASH

public static final short FIXED_BACKSLASH
attribute: fixed backslash.
Field Value:
62

FOUND_UTF16

public static final short FOUND_UTF16
character encoding error: found utf16.
Field Value:
4

ID_NAME_MISMATCH

public static final short ID_NAME_MISMATCH
attribute: id and name mismatch.
Field Value:
60

ILLEGAL_NESTING

public static final short ILLEGAL_NESTING
illegal nesting.
Field Value:
25

ILLEGAL_URI_REFERENCE

public static final short ILLEGAL_URI_REFERENCE
attribute: illegal URI reference.
Field Value:
63

INCONSISTENT_NAMESPACE

public static final short INCONSISTENT_NAMESPACE
inconsistent namespace.
Field Value:
33

INCONSISTENT_VERSION

public static final short INCONSISTENT_VERSION
inconsistent version.
Field Value:
28

INSERTING_TAG

public static final short INSERTING_TAG
inserting tag.
Field Value:
15

INVALID_ATTRIBUTE

public static final short INVALID_ATTRIBUTE
attribute: invalid attribute.
Field Value:
72

INVALID_NCR

public static final short INVALID_NCR
character encoding: invalid NCR.
Field Value:
82

INVALID_SGML_CHARS

public static final short INVALID_SGML_CHARS
character encoding: invalid sgml chars.
Field Value:
77

INVALID_URI

public static final short INVALID_URI
character encoding: nvalid URI.
Field Value:
81

INVALID_UTF16

public static final short INVALID_UTF16
character encoding: invalid utf16.
Field Value:
79

INVALID_UTF8

public static final short INVALID_UTF8
character encoding: invalid utf8.
Field Value:
78

INVALID_XML_ID

public static final short INVALID_XML_ID
attribute: invalid xml id.
Field Value:
74

JOINING_ATTRIBUTE

public static final short JOINING_ATTRIBUTE
attribute: joining attribute.
Field Value:
68

MALFORMED_COMMENT

public static final short MALFORMED_COMMENT
malformed comment.
Field Value:
29

MALFORMED_DOCTYPE

public static final short MALFORMED_DOCTYPE
malformed doctype.
Field Value:
35

MISSING_ATTRIBUTE

public static final short MISSING_ATTRIBUTE
attribute: missing attribute.
Field Value:
49

MISSING_ATTR_VALUE

public static final short MISSING_ATTR_VALUE
attribute: missing attribute value.
Field Value:
50

MISSING_DOCTYPE

public static final short MISSING_DOCTYPE
missing doctype.
Field Value:
44

MISSING_ENDTAG_BEFORE

public static final short MISSING_ENDTAG_BEFORE
missing end tag before.
Field Value:
7

MISSING_ENDTAG_FOR

public static final short MISSING_ENDTAG_FOR
missing an end tag.
Field Value:
6

MISSING_IMAGEMAP

public static final short MISSING_IMAGEMAP
attribute: missing image map.
Field Value:
56

MISSING_IMAGE_ALT

public static final short MISSING_IMAGE_ALT
accessibility flaw: missing image map.
Field Value:
1

MISSING_IMAGE_MAP

public static final short MISSING_IMAGE_MAP
accessibility flaw: missing image map.
Field Value:
8

MISSING_LINK_ALT

public static final short MISSING_LINK_ALT
accessibility flaw: missing link alt.
Field Value:
2

MISSING_QUOTEMARK

public static final short MISSING_QUOTEMARK
attribute: missing quotemark.
Field Value:
58

MISSING_SEMICOLON

public static final short MISSING_SEMICOLON
invalid entity: missing semicolon.
Field Value:
1

MISSING_SEMICOLON_NCR

public static final short MISSING_SEMICOLON_NCR
invalid entity: missing semicolon.
Field Value:
2

MISSING_STARTTAG

public static final short MISSING_STARTTAG
missing start tag.
Field Value:
12

MISSING_SUMMARY

public static final short MISSING_SUMMARY
accessibility flaw: missing summary.
Field Value:
4

MISSING_TITLE_ELEMENT

public static final short MISSING_TITLE_ELEMENT
missing title element.
Field Value:
17

MIXED_CONTENT_IN_BLOCK

public static final short MIXED_CONTENT_IN_BLOCK
mixed content in block.
Field Value:
43

NESTED_EMPHASIS

public static final short NESTED_EMPHASIS
nested emphasis.
Field Value:
9

NESTED_QUOTATION

public static final short NESTED_QUOTATION
nested quotation.
Field Value:
40

NEWLINE_IN_URI

public static final short NEWLINE_IN_URI
attribute: newline in URI.
Field Value:
65

NOFRAMES_CONTENT

public static final short NOFRAMES_CONTENT
noframes content.
Field Value:
26

NON_ASCII

public static final short NON_ASCII
character encoding error: non ascii.
Field Value:
2

NON_MATCHING_ENDTAG

public static final short NON_MATCHING_ENDTAG
non matching end tag.
Field Value:
10

OBSOLETE_ELEMENT

public static final short OBSOLETE_ELEMENT
obsolete element.
Field Value:
20

PROPRIETARY_ATTRIBUTE

public static final short PROPRIETARY_ATTRIBUTE
attribute: proprietary attribute.
Field Value:
53

PROPRIETARY_ATTR_VALUE

public static final short PROPRIETARY_ATTR_VALUE
attribute: proprietary attribute value.
Field Value:
54

PROPRIETARY_ELEMENT

public static final short PROPRIETARY_ELEMENT
proprietary element.
Field Value:
21

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.
Field Value:
55

REPLACED_CHAR

public static final short REPLACED_CHAR
char has been replaced.
Field Value:
0

REPLACING_ELEMENT

public static final short REPLACING_ELEMENT
replacing element.
Field Value:
83

REPLACING_UNEX_ELEMENT

public static final short REPLACING_UNEX_ELEMENT
replacing unexcaped element.
Field Value:
84

REPORT_VERSION_SUMMARY

public static final short REPORT_VERSION_SUMMARY
Constant used for reporting of version summary.
Field Value:
111

SPACE_PRECEDING_XMLDECL

public static final short SPACE_PRECEDING_XMLDECL
space preceding xml declaration.
Field Value:
45

SUSPECTED_MISSING_QUOTE

public static final short SUSPECTED_MISSING_QUOTE
suspected missing quote.
Field Value:
16

TAG_NOT_ALLOWED_IN

public static final short TAG_NOT_ALLOWED_IN
tag not allowed in.
Field Value:
11

TOO_MANY_ELEMENTS

public static final short TOO_MANY_ELEMENTS
too many element.
Field Value:
38

TOO_MANY_ELEMENTS_IN

public static final short TOO_MANY_ELEMENTS_IN
too many elements in.
Field Value:
46

TRIM_EMPTY_ELEMENT

public static final short TRIM_EMPTY_ELEMENT
trim empty element.
Field Value:
23

UNESCAPED_AMPERSAND

public static final short UNESCAPED_AMPERSAND
invalid entity: unescaped ampersand.
Field Value:
4

UNESCAPED_ELEMENT

public static final short UNESCAPED_ELEMENT
unescaped element.
Field Value:
39

UNEXPECTED_ENDTAG

public static final short UNEXPECTED_ENDTAG
unexpected end tag.
Field Value:
13

UNEXPECTED_ENDTAG_IN

public static final short UNEXPECTED_ENDTAG_IN
unexpected endag in.
Field Value:
47

UNEXPECTED_END_OF_FILE

public static final short UNEXPECTED_END_OF_FILE
unexpected end of file.
Field Value:
36

UNEXPECTED_END_OF_FILE_ATTR

public static final short UNEXPECTED_END_OF_FILE_ATTR
attribute: unexpected end of file.
Field Value:
75

UNEXPECTED_EQUALSIGN

public static final short UNEXPECTED_EQUALSIGN
attribute: expected equalsign.
Field Value:
69

UNEXPECTED_GT

public static final short UNEXPECTED_GT
attribute: unexpected gt.
Field Value:
52

UNEXPECTED_QUOTEMARK

public static final short UNEXPECTED_QUOTEMARK
attribute: unexpected quotemark.
Field Value:
59

UNKNOWN_ATTRIBUTE

public static final short UNKNOWN_ATTRIBUTE
attribute: unknown attribute.
Field Value:
48

UNKNOWN_ELEMENT

public static final short UNKNOWN_ELEMENT
unknown element.
Field Value:
22

UNKNOWN_ENTITY

public static final short UNKNOWN_ENTITY
invalid entity: unknown entity.
Field Value:
3

USING_BODY

public static final short USING_BODY
presentation flaw: using body.
Field Value:
16

USING_BR_INPLACE_OF

public static final short USING_BR_INPLACE_OF
unsing br in place of.
Field Value:
14

USING_FONT

public static final short USING_FONT
presentation flaw: using font.
Field Value:
8

USING_FRAMES

public static final short USING_FRAMES
accessibility flaw: using frames.
Field Value:
16

USING_LAYER

public static final short USING_LAYER
presentation flaw: using layer.
Field Value:
2

USING_NOBR

public static final short USING_NOBR
presentation flaw: using nobr.
Field Value:
4

USING_NOFRAMES

public static final short USING_NOFRAMES
accessibility flaw: using noframes.
Field Value:
32

USING_SPACER

public static final short USING_SPACER
presentation flaw: using spacer.
Field Value:
1

VENDOR_SPECIFIC_CHARS

public static final short VENDOR_SPECIFIC_CHARS
character encoding: vendor specific chars.
Field Value:
76

WINDOWS_CHARS

public static final short WINDOWS_CHARS
character encoding error: windows chars.
Field Value:
1

XML_ATTRIBUTE_VALUE

public static final short XML_ATTRIBUTE_VALUE
attribute: xml attribute value.
Field Value:
57

XML_ID_SYNTAX

public static final short XML_ID_SYNTAX
attribute: id sintax.
Field Value:
71

Constructor Details

Report

protected Report()
Instantiated only in Tidy() constructor.

Method Details

addMessageListener

public void addMessageListener(TidyMessageListener listener)
Adds a message listener.
Parameters:
listener - TidyMessageListener

attrError

public void attrError(Lexer lexer,
                      Node node,
                      AttVal attribute,
                      short code)
Prints error messages for attributes.
Parameters:
lexer - Lexer
node - current tag
attribute - attribute
code - error code

badArgument

public void badArgument(String key,
                        String value)
Prints a "bad argument" error message. Lexer is not defined when this is called.
Parameters:
key - argument name
value - bad argument value

badTree

public void badTree(PrintWriter errout)
Prints the "bad tree" message.
Parameters:
errout - PrintWriter

encodingError

public void encodingError(Lexer lexer,
                          int code,
                          int c)
Prints encoding error messages.
Parameters:
lexer - Lexer
code - error code
c - invalid char

entityError

public void entityError(Lexer lexer,
                        short code,
                        String entity,
                        int c)
Prints entity error messages.
Parameters:
lexer - Lexer
code - error code
entity - invalid entity String
c - invalid char

error

public void error(Lexer lexer,
                  Node element,
                  Node node,
                  short code)
Prints errors.
Parameters:
lexer - Lexer
element - parent/missing tag
node - current tag
code - error code

errorSummary

public void errorSummary(Lexer lexer)
Prints error summary.
Parameters:
lexer - Lexer

generalInfo

public void generalInfo(PrintWriter errout)
Prints tidy general info.
Parameters:
errout - PrintWriter

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 code
lexer - Lexer
message - key for the ResourceBundle
params - optional parameters added with MessageFormat
level - message level. One of TidyMessage.LEVEL_ERROR, TidyMessage.LEVEL_WARNING,TidyMessage.LEVEL_INFO
Returns:
formatted message
See Also:
TidyMessage

helloMessage

public void helloMessage(PrintWriter errout)
Prints tidy hello message.
Parameters:
errout - PrintWriter

helpText

public void helpText(PrintWriter out)
Prints tidy help.
Parameters:
out - PrintWriter

missingBody

public void missingBody(PrintWriter errout)
Prints the "missing body" message.
Parameters:
errout - PrintWriter

needsAuthorIntervention

public void needsAuthorIntervention(PrintWriter errout)
Prints the "needs author intervention" message.
Parameters:
errout - PrintWriter

reportNumWarnings

public void reportNumWarnings(PrintWriter errout,
                              Lexer lexer)
Prints the number of error/warnings found.
Parameters:
errout - PrintWriter
lexer - Lexer

reportNumberOfSlides

public void reportNumberOfSlides(PrintWriter errout,
                                 int count)
Prints the number of generated slides.
Parameters:
errout - PrintWriter
count - slides count

reportVersion

public void reportVersion(PrintWriter errout,
                          Lexer lexer,
                          String filename,
                          Node doctype)
Prints information for html version in input file.
Parameters:
errout - PrintWriter
lexer - Lexer
filename - file name
doctype - doctype Node

setFilename

public void setFilename(String filename)
Sets the current file name.
Parameters:
filename - current file.

showVersion

public void showVersion(PrintWriter p)
print version information.
Parameters:
p - printWriter

unknownFile

public void unknownFile(PrintWriter errout,
                        String file)
Prints the "unknown file" message.
Parameters:
errout - PrintWriter
file - invalid file name

unknownOption

public void unknownOption(PrintWriter errout,
                          char c)
Prints the "unknown option" message.
Parameters:
errout - PrintWriter
c - invalid option char

unknownOption

public void unknownOption(String option)
Prints an "unknown option" error message. Lexer is not defined when this is called.
Parameters:
option - unknown option name

warning

public void warning(Lexer lexer,
                    Node element,
                    Node node,
                    short code)
Prints warnings.
Parameters:
lexer - Lexer
element - parent/missing tag
node - current tag
code - error code