Java Code Examples for com.sun.tools.javac.util.JCDiagnostic#Factory

The following examples show how to use com.sun.tools.javac.util.JCDiagnostic#Factory . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Messager.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructor
 * @param programName  Name of the program (for error messages).
 * @param errWriter    Stream for error messages
 * @param warnWriter   Stream for warnings
 * @param noticeWriter Stream for other messages
 */
@SuppressWarnings("deprecation")
protected Messager(Context context,
                   String programName,
                   PrintWriter errWriter,
                   PrintWriter warnWriter,
                   PrintWriter noticeWriter) {
    super(context, errWriter, warnWriter, noticeWriter);
    messages = JavacMessages.instance(context);
    messages.add("com.sun.tools.javadoc.resources.javadoc");
    javadocDiags = new JCDiagnostic.Factory(messages, "javadoc");
    this.programName = programName;
}
 
Example 2
Source File: Messager.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructor
 * @param programName  Name of the program (for error messages).
 * @param errWriter    Stream for error messages
 * @param warnWriter   Stream for warnings
 * @param noticeWriter Stream for other messages
 */
@SuppressWarnings("deprecation")
protected Messager(Context context,
                   String programName,
                   PrintWriter errWriter,
                   PrintWriter warnWriter,
                   PrintWriter noticeWriter) {
    super(context, errWriter, warnWriter, noticeWriter);
    messages = JavacMessages.instance(context);
    messages.add(locale -> ResourceBundle.getBundle("com.sun.tools.javadoc.resources.javadoc",
                                                     locale));
    javadocDiags = new JCDiagnostic.Factory(messages, "javadoc");
    this.programName = programName;

}
 
Example 3
Source File: Messager.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructor
 * @param programName  Name of the program (for error messages).
 * @param errWriter    Stream for error messages
 * @param warnWriter   Stream for warnings
 * @param noticeWriter Stream for other messages
 */
@SuppressWarnings("deprecation")
protected Messager(Context context,
                   String programName,
                   PrintWriter errWriter,
                   PrintWriter warnWriter,
                   PrintWriter noticeWriter) {
    super(context, errWriter, warnWriter, noticeWriter);
    messages = JavacMessages.instance(context);
    messages.add("com.sun.tools.javadoc.resources.javadoc");
    javadocDiags = new JCDiagnostic.Factory(messages, "javadoc");
    this.programName = programName;
}
 
Example 4
Source File: Messager.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructor
 * @param programName  Name of the program (for error messages).
 * @param errWriter    Stream for error messages
 * @param warnWriter   Stream for warnings
 * @param noticeWriter Stream for other messages
 */
@SuppressWarnings("deprecation")
protected Messager(Context context,
                   String programName,
                   PrintWriter errWriter,
                   PrintWriter warnWriter,
                   PrintWriter noticeWriter) {
    super(context, errWriter, warnWriter, noticeWriter);
    messages = JavacMessages.instance(context);
    messages.add("com.sun.tools.javadoc.resources.javadoc");
    javadocDiags = new JCDiagnostic.Factory(messages, "javadoc");
    this.programName = programName;
}
 
Example 5
Source File: ClassFinder.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public BadClassFile(TypeSymbol sym, JavaFileObject file, JCDiagnostic diag,
        JCDiagnostic.Factory diagFactory) {
    super(sym, createBadClassFileDiagnostic(file, diag, diagFactory));
}
 
Example 6
Source File: DCTree.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
DCErroneous(String body, JCDiagnostic.Factory diags, DiagnosticSource diagSource, String code, Object... args) {
    this.body = body;
    this.diag = diags.error(null, diagSource, this, code, args);
}
 
Example 7
Source File: Infer.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
InvalidInstanceException(JCDiagnostic.Factory diags) {
    super(diags);
}
 
Example 8
Source File: Infer.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
NoInstanceException(boolean isAmbiguous, JCDiagnostic.Factory diags) {
    super(diags);
    this.isAmbiguous = isAmbiguous;
}
 
Example 9
Source File: Infer.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
InferenceException(JCDiagnostic.Factory diags) {
    super(diags);
}
 
Example 10
Source File: DCTree.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
DCErroneous(String body, JCDiagnostic.Factory diags, DiagnosticSource diagSource, String code, Object... args) {
    this.body = body;
    this.diag = diags.error(diagSource, this, code, args);
}
 
Example 11
Source File: DCTree.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
DCErroneous(String body, JCDiagnostic.Factory diags, DiagnosticSource diagSource, String code, Object... args) {
    this.body = body;
    this.diag = diags.error(diagSource, this, code, args);
}
 
Example 12
Source File: DCTree.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
DCErroneous(String body, JCDiagnostic.Factory diags, DiagnosticSource diagSource, String code, Object... args) {
    this.body = body;
    this.diag = diags.error(diagSource, this, code, args);
}
 
Example 13
Source File: ClassFinder.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
private static JCDiagnostic createBadClassFileDiagnostic(
        JavaFileObject file, JCDiagnostic diag, JCDiagnostic.Factory diagFactory) {
    String key = (file.getKind() == JavaFileObject.Kind.SOURCE
                ? "bad.source.file.header" : "bad.class.file.header");
    return diagFactory.fragment(key, file, diag);
}
 
Example 14
Source File: DCTree.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
DCErroneous(String body, JCDiagnostic.Factory diags, DiagnosticSource diagSource, String code, Object... args) {
    this.body = body;
    this.diag = diags.error(diagSource, this, code, args);
}
 
Example 15
Source File: DCTree.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
DCErroneous(String body, JCDiagnostic.Factory diags, DiagnosticSource diagSource, String code, Object... args) {
    this.body = body;
    this.diag = diags.error(null, diagSource, this, code, args);
}
 
Example 16
Source File: DCTree.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
DCErroneous(String body, JCDiagnostic.Factory diags, DiagnosticSource diagSource, String code, Object... args) {
    this.body = body;
    this.diag = diags.error(diagSource, this, code, args);
}
 
Example 17
Source File: Infer.java    From java-n-IDE-for-Android with Apache License 2.0 4 votes vote down vote up
NoInstanceException(boolean isAmbiguous, JCDiagnostic.Factory diags) {
    super(diags);
    this.isAmbiguous = isAmbiguous;
}
 
Example 18
Source File: Infer.java    From java-n-IDE-for-Android with Apache License 2.0 4 votes vote down vote up
InferenceException(JCDiagnostic.Factory diags) {
    super(diags);
}
 
Example 19
Source File: DCTree.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
DCErroneous(String body, JCDiagnostic.Factory diags, DiagnosticSource diagSource, String code, Object... args) {
    this.body = body;
    this.diag = diags.error(diagSource, this, code, args);
}
 
Example 20
Source File: DCTree.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
DCErroneous(String body, JCDiagnostic.Factory diags, DiagnosticSource diagSource, String code, Object... args) {
    this.body = body;
    this.diag = diags.error(diagSource, this, code, args);
}