APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.javadoc.internal.doclets.toolkit

public Class Messages

extends Object
Class Inheritance
Imports
javax.lang.model.element.Element, javax.tools.Diagnostic, .FileObject, com.sun.source.util.DocTreePath, jdk.javadoc.doclet.Reporter

Provides standardized access to the diagnostic reporting facilities for a doclet. Messages are specified by resource keys to be found in the doclet's resources. Values can be substituted into the strings obtained from the resource files. Messages are reported to the doclet's reporter.

Field Summary

Modifier and TypeField and Description
private final BaseConfiguration
private boolean
private final Reporter
private final Resources

Constructor Summary

AccessConstructor and Description
public
Messages(BaseConfiguration
the doclet's configuration, used to access the doclet's reporter, and additional methods and state used to filter out messages, if any, which should be suppressed.
configuration
,
Resources
resources for console messages and exceptions
resources
)

Creates a Messages object to provide standardized access to the doclet's diagnostic reporting mechanisms.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the generated documentation contains one or more diagnostic markers for invalid input
containsDiagnosticMarkers
()

Returns true if the generated documentation contains one or more diagnostic markers for invalid input.

public void
error(String
the name of a resource containing the message to be printed
key
,
Object...
optional arguments to be replaced in the message
args
)

Reports an error message to the doclet's reporter.

public void
error(DocTreePath
a path identifying the position to be included with the message
path
,
String
the name of a resource containing the message to be printed
key
,
Object...
optional arguments to be replaced in the message
args
)

Reports an error message to the doclet's reporter.

public void
error(DocTreePath
a path identifying the position to be included with the message
path
,
int
the start of a range of characters to be associated with the message
start
,
int
the position to be associated with the message
pos
,
int
the end of a range of characters to be associated with the message
end
,
String
the name of a resource containing the message to be printed
key
,
Object...
optional arguments to be replaced in the message
args
)

Reports an error message to the doclet's reporter.

public void
error(FileObject
the file object to be associated with the message
fo
,
int
the start of a range of characters to be associated with the message
start
,
int
the position to be associated with the message
pos
,
int
the end of a range of characters to be associated with the message
end
,
String
the name of a resource containing the message to be printed
key
,
Object...
optional arguments to be replaced in the message
args
)

Reports an error message to the doclet's reporter.

public void
error(Element
an element identifying the position to be included with the message
e
,
String
the name of a resource containing the message to be printed
key
,
Object...
optional arguments to be replaced in the message
args
)

Reports an error message to the doclet's reporter.

public Resources

Returns:

the resources
getResources
()

Returns the resources being used when generating messages.

public void
notice(String
the name of a resource containing the message to be printed
key
,
Object...
optional arguments to be replaced in the message
args
)

Reports an informational notice to the doclet's reporter.

private void
private void
private void
private void
report(Diagnostic.Kind k, FileObject fo, int start, int pos, int end, String msg)

private void
report(Diagnostic.Kind k, DocTreePath path, int start, int pos, int end, String msg)

public void
setContainsDiagnosticMarkers()

Sets the flag for documentation containing a diagnostic marker for invalid input.

public void
warning(String
the name of a resource containing the message to be printed
key
,
Object...
optional arguments to be replaced in the message
args
)

Reports a warning message to the doclet's reporter.

public void
warning(DocTreePath
a path identifying the position to be included with the message
path
,
String
the name of a resource containing the message to be printed
key
,
Object...
optional arguments to be replaced in the message
args
)

Reports a warning message to the doclet's reporter.

public void
warning(DocTreePath
a path identifying the position to be included with the message
path
,
int
the start of a range of characters to be associated with the message
start
,
int
the position to be associated with the message
pos
,
int
the end of a range of characters to be associated with the message
end
,
String
the name of a resource containing the message to be printed
key
,
Object...
optional arguments to be replaced in the message
args
)

Reports a warning message to the doclet's reporter.

public void
warning(Element
an element identifying the position to be included with the message
e
,
String
the name of a resource containing the message to be printed
key
,
Object...
optional arguments to be replaced in the message
args
)

Reports a warning message to the doclet's reporter.

public void
warning(FileObject
the file object to be associated with the message
fo
,
int
the start of a range of characters to be associated with the message
start
,
int
the position to be associated with the message
pos
,
int
the end of a range of characters to be associated with the message
end
,
String
the name of a resource containing the message to be printed
key
,
Object...
optional arguments to be replaced in the message
args
)

Reports a warning message to the doclet's reporter.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

configurationback to summary
private final BaseConfiguration configuration
containsDiagnosticMarkersback to summary
private boolean containsDiagnosticMarkers
reporterback to summary
private final Reporter reporter
resourcesback to summary
private final Resources resources

Constructor Detail

Messagesback to summary
public Messages(BaseConfiguration configuration, Resources resources)

Creates a Messages object to provide standardized access to the doclet's diagnostic reporting mechanisms.

Parameters
configuration:BaseConfiguration

the doclet's configuration, used to access the doclet's reporter, and additional methods and state used to filter out messages, if any, which should be suppressed.

resources:Resources

resources for console messages and exceptions

Method Detail

containsDiagnosticMarkersback to summary
public boolean containsDiagnosticMarkers()

Returns true if the generated documentation contains one or more diagnostic markers for invalid input.

Returns:boolean

true if the generated documentation contains one or more diagnostic markers for invalid input

errorback to summary
public void error(String key, Object... args)

Reports an error message to the doclet's reporter.

Parameters
key:String

the name of a resource containing the message to be printed

args:Object[]

optional arguments to be replaced in the message

errorback to summary
public void error(DocTreePath path, String key, Object... args)

Reports an error message to the doclet's reporter.

Parameters
path:DocTreePath

a path identifying the position to be included with the message

key:String

the name of a resource containing the message to be printed

args:Object[]

optional arguments to be replaced in the message

errorback to summary
public void error(DocTreePath path, int start, int pos, int end, String key, Object... args)

Reports an error message to the doclet's reporter.

Parameters
path:DocTreePath

a path identifying the position to be included with the message

start:int

the start of a range of characters to be associated with the message

pos:int

the position to be associated with the message

end:int

the end of a range of characters to be associated with the message

key:String

the name of a resource containing the message to be printed

args:Object[]

optional arguments to be replaced in the message

errorback to summary
public void error(FileObject fo, int start, int pos, int end, String key, Object... args)

Reports an error message to the doclet's reporter.

Parameters
fo:FileObject

the file object to be associated with the message

start:int

the start of a range of characters to be associated with the message

pos:int

the position to be associated with the message

end:int

the end of a range of characters to be associated with the message

key:String

the name of a resource containing the message to be printed

args:Object[]

optional arguments to be replaced in the message

errorback to summary
public void error(Element e, String key, Object... args)

Reports an error message to the doclet's reporter.

Parameters
e:Element

an element identifying the position to be included with the message

key:String

the name of a resource containing the message to be printed

args:Object[]

optional arguments to be replaced in the message

getResourcesback to summary
public Resources getResources()

Returns the resources being used when generating messages.

Returns:Resources

the resources

noticeback to summary
public void notice(String key, Object... args)

Reports an informational notice to the doclet's reporter. The message is written directly to the reporter's diagnostic stream.

Parameters
key:String

the name of a resource containing the message to be printed

args:Object[]

optional arguments to be replaced in the message

reportback to summary
private void report(Diagnostic.Kind k, String msg)
reportback to summary
private void report(Diagnostic.Kind k, DocTreePath p, String msg)
reportback to summary
private void report(Diagnostic.Kind k, Element e, String msg)
reportback to summary
private void report(Diagnostic.Kind k, FileObject fo, int start, int pos, int end, String msg)
reportback to summary
private void report(Diagnostic.Kind k, DocTreePath path, int start, int pos, int end, String msg)
setContainsDiagnosticMarkersback to summary
public void setContainsDiagnosticMarkers()

Sets the flag for documentation containing a diagnostic marker for invalid input.

warningback to summary
public void warning(String key, Object... args)

Reports a warning message to the doclet's reporter.

Parameters
key:String

the name of a resource containing the message to be printed

args:Object[]

optional arguments to be replaced in the message

warningback to summary
public void warning(DocTreePath path, String key, Object... args)

Reports a warning message to the doclet's reporter.

Parameters
path:DocTreePath

a path identifying the position to be included with the message

key:String

the name of a resource containing the message to be printed

args:Object[]

optional arguments to be replaced in the message

warningback to summary
public void warning(DocTreePath path, int start, int pos, int end, String key, Object... args)

Reports a warning message to the doclet's reporter.

Parameters
path:DocTreePath

a path identifying the position to be included with the message

start:int

the start of a range of characters to be associated with the message

pos:int

the position to be associated with the message

end:int

the end of a range of characters to be associated with the message

key:String

the name of a resource containing the message to be printed

args:Object[]

optional arguments to be replaced in the message

warningback to summary
public void warning(Element e, String key, Object... args)

Reports a warning message to the doclet's reporter.

Parameters
e:Element

an element identifying the position to be included with the message

key:String

the name of a resource containing the message to be printed

args:Object[]

optional arguments to be replaced in the message

warningback to summary
public void warning(FileObject fo, int start, int pos, int end, String key, Object... args)

Reports a warning message to the doclet's reporter.

Parameters
fo:FileObject

the file object to be associated with the message

start:int

the start of a range of characters to be associated with the message

pos:int

the position to be associated with the message

end:int

the end of a range of characters to be associated with the message

key:String

the name of a resource containing the message to be printed

args:Object[]

optional arguments to be replaced in the message