/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/** An abstraction of a diagnostic message generated by the compiler.
*
* <p><b>This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.</b>
*/
/** A factory for creating diagnostic objects. */
public static class Factory {
/** The context key for the diagnostic factory. */
/** Get the Factory instance for this context. */
return instance;
}
/** Create a new diagnostic factory. */
}
/** Create a new diagnostic factory. */
}
/**
* Create an error diagnostic.
* @param source The source of the compilation unit, if any, in which to report the error.
* @param pos The source position at which to report the error.
* @param key The key for the localized error message.
* @param args Fields of the error message.
*/
}
/**
* Create a warning diagnostic that will not be hidden by the -nowarn or -Xlint:none options.
* @param source The source of the compilation unit, if any, in which to report the warning.
* @param pos The source position at which to report the warning.
* @param key The key for the localized warning message.
* @param args Fields of the warning message.
* @see MandatoryWarningHandler
*/
}
/**
* Create a warning diagnostic that will not be hidden by the -nowarn or -Xlint:none options.
* @param lc The lint category for the diagnostic
* @param source The source of the compilation unit, if any, in which to report the warning.
* @param pos The source position at which to report the warning.
* @param key The key for the localized warning message.
* @param args Fields of the warning message.
* @see MandatoryWarningHandler
*/
}
/**
* Create a warning diagnostic.
* @param lc The lint category for the diagnostic
* @param key The key for the localized error message.
* @param args Fields of the warning message.
* @see MandatoryWarningHandler
*/
}
/**
* Create a warning diagnostic.
* @param source The source of the compilation unit, if any, in which to report the warning.
* @param pos The source position at which to report the warning.
* @param key The key for the localized warning message.
* @param args Fields of the warning message.
*/
}
/**
* Create a warning diagnostic.
* @param lc The lint category for the diagnostic
* @param source The source of the compilation unit, if any, in which to report the warning.
* @param pos The source position at which to report the warning.
* @param key The key for the localized warning message.
* @param args Fields of the warning message.
* @see MandatoryWarningHandler
*/
}
/**
* Create a note diagnostic that will not be hidden by the -nowarn or -Xlint:none options.
* @param key The key for the localized message.
* @param args Fields of the message.
* @see MandatoryWarningHandler
*/
}
/**
* Create a note diagnostic.
* @param key The key for the localized error message.
* @param args Fields of the message.
*/
}
/**
* Create a note diagnostic.
* @param source The source of the compilation unit, if any, in which to report the note.
* @param pos The source position at which to report the note.
* @param key The key for the localized message.
* @param args Fields of the message.
*/
}
/**
* Create a fragment diagnostic, for use as an argument in other diagnostics
* @param key The key for the localized message.
* @param args Fields of the message.
*/
}
/**
* Create a new diagnostic of the given kind, which is not mandatory and which has
* no lint category.
* @param kind The diagnostic kind
* @param ls The lint category, if applicable, or null
* @param source The source of the compilation unit, if any, in which to report the message.
* @param pos The source position at which to report the message.
* @param key The key for the localized message.
* @param args Fields of the message.
*/
}
/**
* Create a new diagnostic of the given kind.
* @param kind The diagnostic kind
* @param lc The lint category, if applicable, or null
* @param isMandatory is diagnostic mandatory?
* @param source The source of the compilation unit, if any, in which to report the message.
* @param pos The source position at which to report the message.
* @param key The key for the localized message.
* @param args Fields of the message.
*/
DiagnosticType kind, LintCategory lc, Set<DiagnosticFlag> flags, DiagnosticSource source, DiagnosticPosition pos, String key, Object... args) {
}
}
}
/**
* Create a fragment diagnostic, for use as an argument in other diagnostics
* @param key The key for the localized error message.
* @param args Fields of the error message.
*
*/
return new JCDiagnostic(getFragmentFormatter(),
null,
null,
null,
args);
}
//where
if (fragmentFormatter == null) {
}
return fragmentFormatter;
}
/**
* A DiagnosticType defines the type of the diagnostic.
**/
public enum DiagnosticType {
/** A fragment of an enclosing diagnostic. */
/** A note: similar to, but less serious than, a warning. */
/** A warning. */
/** An error. */
/** Create a DiagnosticType.
* @param key A string used to create the resource key for the diagnostic.
*/
}
};
/**
* A DiagnosticPosition provides information about the positions in a file
* that gave rise to a diagnostic. It always defines a "preferred" position
* that most accurately defines the location of the diagnostic, it may also
* provide a related tree node that spans that location.
*/
public static interface DiagnosticPosition {
/** Gets the tree node, if any, to which the diagnostic applies. */
/** If there is a tree node, get the start position of the tree node.
* Otherwise, just returns the same as getPreferredPosition(). */
int getStartPosition();
/** Get the position within the file that most accurately defines the
* location for the diagnostic. */
int getPreferredPosition();
/** If there is a tree node, and if endPositions are available, get
* the end position of the tree node. Otherwise, just returns the
* same as getPreferredPosition(). */
}
/**
* A DiagnosticPosition that simply identifies a position, but no related
* tree node, as the location for a diagnostic. Used for scanner and parser
* diagnostics. */
}
return null;
}
public int getStartPosition() {
return pos;
}
public int getPreferredPosition() {
return pos;
}
return pos;
}
private final int pos;
}
public enum DiagnosticFlag {
}
private final int line;
private final int column;
/**
* Create a diagnostic object.
* @param fomatter the formatter to use for the diagnostic
* @param dt the type of diagnostic
* @param lc the lint category for the diagnostic
* @param source the name of the source file, or null if none.
* @param pos the character offset within the source file, if given.
* @param key a resource key to identify the text of the diagnostic
* @param args arguments to be included in the text of the diagnostic
*/
throw new IllegalArgumentException();
this.defaultFormatter = formatter;
this.lintCategory = lc;
else {
}
}
/**
* Get the type of this diagnostic.
* @return the type of this diagnostic
*/
return type;
}
/**
* Get the subdiagnostic list
* @return subdiagnostic list
*/
}
public boolean isMultiline() {
return false;
}
/**
* Check whether or not this diagnostic is required to be shown.
* @return true if this diagnostic is required to be shown.
*/
public boolean isMandatory() {
}
/**
* Check whether this diagnostic has an associated lint category.
*/
public boolean hasLintCategory() {
return (lintCategory != null);
}
/**
* Get the associated lint category, or null if none.
*/
return lintCategory;
}
/**
* Get the name of the source file referred to by this diagnostic.
* @return the name of the source referred to with this diagnostic, or null if none
*/
return null;
else
}
/**
* Get the source referred to by this diagnostic.
* @return the source referred to with this diagnostic, or null if none
*/
return source;
}
protected int getIntStartPosition() {
}
protected int getIntPosition() {
}
protected int getIntEndPosition() {
}
public long getStartPosition() {
return getIntStartPosition();
}
public long getPosition() {
return getIntPosition();
}
public long getEndPosition() {
return getIntEndPosition();
}
/**
* Get the line number within the source referred to by this diagnostic.
* @return the line number within the source referred to by this diagnostic
*/
public long getLineNumber() {
return line;
}
/**
* Get the column number within the line of source referred to by this diagnostic.
* @return the column number within the line of source referred to by this diagnostic
*/
public long getColumnNumber() {
return column;
}
/**
* Get the arguments to be included in the text of the diagnostic.
* @return the arguments to be included in the text of the diagnostic
*/
return args;
}
/**
* Get the prefix string associated with this type of diagnostic.
* @return the prefix string associated with this type of diagnostic
*/
}
/**
* Get the prefix string associated with a particular type of diagnostic.
* @return the prefix string associated with a particular type of diagnostic
*/
}
/**
* Return the standard presentation of this diagnostic.
*/
}
// Methods for javax.tools.Diagnostic
switch (type) {
case NOTE:
case WARNING:
case ERROR:
default:
}
}
return key;
}
}
switch (flag) {
case SYNTAX:
break;
case RESOLVE_ERROR:
break;
}
}
}
}
super(other.defaultFormatter,
this.subdiagnostics = subdiagnostics;
}
return subdiagnostics;
}
public boolean isMultiline() {
return true;
}
}
}