public abstract class CategorizedProblem extends java.lang.Object implements IProblem
validationParticipant
,
the simpler problem interface IProblem
did not carry enough information to better
separate and categorize JavaScript problems. In order to minimize impact on existing API, JavaScript problems
are still passed around as IProblem
, though actual implementations should explicitly
extend CategorizedProblem
. Participants can produce their own problem definitions,
and given these are categorized problems, they can be better handled by clients (such as user
interface).
A categorized problem provides access to:
IProblem
, IProblem
for backward compatibility reason.
It is intended that CategorizedProblem
will be subclassed for custom problem implementation when
participating in compilation operations, so as to allow participant to contribute their own marker types, and thus
defining their own domain specific problem/category IDs.
Note: standard JavaScript problems produced by JavaScript default tooling will set the
marker IMarker#GENERATED_BY attribute to JavaBuilder#GENERATED_BY; compiler
participants may specify the IMarker#GENERATED_BY attribute of their markers
by adding it to the extra marker attributes of the problems they generate;
markers resulting from compiler participants' problems that do not have the
IMarker#GENERATED_BY extra attribute set do not have the IMarker#GENERATED_BY
attribute set either.
Provisional API: This class/interface is part of an interim API that is still under development and expected to
change significantly before reaching stability. It is being made available at this early stage to solicit feedback
from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
(repeatedly) as the API evolves.Modifier and Type | Field and Description |
---|---|
static int |
CAT_BUILDPATH
Category for problems related to buildpath
|
static int |
CAT_CODE_STYLE
Category for optional problems related to coding style practices
|
static int |
CAT_IMPORT
Category for fatal problems in import statements
|
static int |
CAT_INTERNAL
Category for fatal problems which could not be addressed by external changes, but require an edit to be addressed
|
static int |
CAT_JAVADOC
Category for optional problems in Javadoc
|
static int |
CAT_MEMBER
Category for fatal problems related to type members, could be addressed by some field or method change
|
static int |
CAT_NAME_SHADOWING_CONFLICT
Category for optional problems related to naming conflicts
|
static int |
CAT_POTENTIAL_PROGRAMMING_PROBLEM
Category for optional problems related to potential programming flaws
|
static int |
CAT_RESTRICTION
Category for optional problems related to access restrictions
|
static int |
CAT_SYNTAX
Category for fatal problems related to syntax
|
static int |
CAT_TYPE
Category for fatal problems related to types, could be addressed by some type change
|
static int |
CAT_UNNECESSARY_CODE
Category for optional problems related to unnecessary code
|
static int |
CAT_UNSPECIFIED
List of standard category IDs used by JavaScript problems, more categories will be added
in the future.
|
AbstractMethodCannotBeOverridden, AbstractMethodInAbstractClass, AbstractMethodMustBeImplemented, AmbiguousConstructor, AmbiguousConstructorInDefaultConstructor, AmbiguousConstructorInImplicitConstructorCall, AmbiguousField, AmbiguousMethod, AmbiguousType, ArgumentHidingField, ArgumentHidingLocalVariable, ArgumentIsNeverUsed, ArgumentTypeCannotBeVoid, ArrayConstantsOnlyInArrayInitializers, ArrayReferenceRequired, AssignmentHasNoEffect, BodyForAbstractMethod, BodyForNativeMethod, BytecodeExceeds64KLimit, BytecodeExceeds64KLimitForClinit, BytecodeExceeds64KLimitForConstructor, CannotAllocateVoidArray, CannotDefineDimensionExpressionsWithInit, CannotDefineStaticInitializerInLocalType, CannotHideAnInstanceMethodWithAStaticMethod, CannotImportPackage, CannotOverrideAStaticMethodWithAnInstanceMethod, CannotReadSource, CannotReturnOutsideFunction, CannotThrowNull, CannotThrowType, ClassExtendFinalClass, CodeCannotBeReached, CodeSnippetMissingClass, CodeSnippetMissingMethod, ConflictingImport, ConstructorRelated, CorruptedSignature, DirectInvocationOfAbstractMethod, DiscouragedReference, DuplicateBlankFinalFieldInitialization, DuplicateCase, DuplicateDefaultCase, DuplicateField, DuplicateFinalLocalInitialization, DuplicateImport, DuplicateLabel, DuplicateMethod, DuplicateModifierForArgument, DuplicateModifierForField, DuplicateModifierForMethod, DuplicateModifierForType, DuplicateModifierForVariable, DuplicateNestedType, DuplicateTypes, EmptyControlFlowStatement, EnclosingInstanceInConstructorCall, EndOfSource, ExpressionShouldBeAVariable, ExternalProblemFixable, ExternalProblemNotFixable, FallthroughCase, FieldHidingField, FieldHidingLocalVariable, FieldRelated, FinalFieldAssignment, FinallyMustCompleteNormally, FinalOuterLocalAssignment, ForbiddenReference, HidingEnclosingType, HierarchyCircularity, HierarchyCircularitySelfReference, HierarchyHasProblems, IgnoreCategoriesMask, IllegalAbstractModifierCombinationForMethod, IllegalDimension, IllegalEnclosingInstanceSpecification, IllegalModifierCombinationFinalAbstractForClass, IllegalModifierCombinationFinalVolatileForField, IllegalModifierForClass, IllegalModifierForField, IllegalModifierForLocalClass, IllegalModifierForMemberClass, IllegalModifierForMethod, IllegalPrimitiveOrArrayTypeForEnclosingInstance, IllegalStaticModifierForMemberType, IllegalUsageOfQualifiedTypeReference, IllegalVararg, IllegalVisibilityModifierCombinationForField, IllegalVisibilityModifierCombinationForMemberType, IllegalVisibilityModifierCombinationForMethod, ImportNotFound, ImportRelated, IncompatibleExceptionInInheritedMethodThrowsClause, IncompatibleExceptionInThrowsClause, IncompatibleReturnType, IncompatibleTypesInConditionalOperator, IncompatibleTypesInEqualityOperator, IncompatibleTypesInForeach, IncorrectEnclosingInstanceReference, IncorrectSwitchType, IndirectAccessToStaticField, IndirectAccessToStaticMethod, IndirectAccessToStaticType, InheritedFieldHidesEnclosingName, InheritedMethodHidesEnclosingName, InheritedMethodReducesVisibility, InheritedTypeHidesEnclosingName, InitializerMustCompleteNormally, InstanceFieldDuringConstructorInvocation, InstanceMethodDuringConstructorInvocation, Internal, InternalTypeNameProvided, InvalidBreak, InvalidCharacterConstant, InvalidClassInstantiation, InvalidContinue, InvalidDigit, InvalidEncoding, InvalidEscape, InvalidExplicitConstructorCall, InvalidExpressionAsStatement, InvalidFloat, InvalidHexa, InvalidHighSurrogate, InvalidInput, InvalidLowSurrogate, InvalidNullToSynchronized, InvalidOctal, InvalidOperator, InvalidParenthesizedExpression, InvalidTypeForCollection, InvalidTypeToSynchronized, InvalidUnaryExpression, InvalidUnicodeEscape, InvalidUsageOfForeachStatements, InvalidValueForGetter, InvalidValueForSetter, InvalidVoidExpression, IsClassPathCorrect, Javadoc, JavadocAmbiguousConstructor, JavadocAmbiguousField, JavadocAmbiguousMethod, JavadocAmbiguousType, JavadocDuplicateParamName, JavadocDuplicateReturnTag, JavadocDuplicateThrowsClassName, JavadocEmptyReturnTag, JavadocHiddenReference, JavadocInheritedFieldHidesEnclosingName, JavadocInheritedMethodHidesEnclosingName, JavadocInheritedNameHidesEnclosingTypeName, JavadocInternalTypeNameProvided, JavadocInvalidMemberTypeQualification, JavadocInvalidParamName, JavadocInvalidParamTagName, JavadocInvalidSeeArgs, JavadocInvalidSeeHref, JavadocInvalidSeeReference, JavadocInvalidTag, JavadocInvalidThrowsClass, JavadocInvalidThrowsClassName, JavadocMalformedSeeReference, JavadocMessagePrefix, JavadocMissing, JavadocMissingHashCharacter, JavadocMissingIdentifier, JavadocMissingParamName, JavadocMissingParamTag, JavadocMissingReturnTag, JavadocMissingSeeReference, JavadocMissingThrowsClassName, JavadocMissingThrowsTag, JavadocNoMessageSendOnArrayType, JavadocNoMessageSendOnBaseType, JavadocNonStaticTypeFromStaticInvocation, JavadocNotVisibleConstructor, JavadocNotVisibleField, JavadocNotVisibleMethod, JavadocNotVisibleType, JavadocParameterMismatch, JavadocUndefinedConstructor, JavadocUndefinedField, JavadocUndefinedMethod, JavadocUndefinedType, JavadocUnexpectedTag, JavadocUnexpectedText, JavadocUnterminatedInlineTag, JavadocUsingDeprecatedConstructor, JavadocUsingDeprecatedField, JavadocUsingDeprecatedMethod, JavadocUsingDeprecatedType, LocalVariableHidingField, LocalVariableHidingLocalVariable, LocalVariableIsNeverUsed, LooseVarDecl, MaskedCatch, MethodButWithConstructorName, MethodReducesVisibility, MethodRelated, MethodRequiresBody, MethodReturnsVoid, MissingEnclosingInstance, MissingEnclosingInstanceForConstructorCall, MissingReturnType, MissingSemiColon, MustDefineEitherDimensionExpressionsOrInitializer, MustSpecifyPackage, NativeMethodsCannotBeStrictfp, NeedToEmulateConstructorAccess, NeedToEmulateFieldReadAccess, NeedToEmulateFieldWriteAccess, NeedToEmulateMethodAccess, NoFieldOnBaseType, NoMessageSendOnArrayType, NoMessageSendOnBaseType, NonBlankFinalLocalAssignment, NonExternalizedStringLiteral, NonNullLocalVariableComparisonYieldsFalse, NonStaticAccessToStaticField, NonStaticAccessToStaticMethod, NonStaticFieldFromStaticInvocation, NotAFunction, NotVisibleConstructor, NotVisibleConstructorInDefaultConstructor, NotVisibleConstructorInImplicitConstructorCall, NotVisibleField, NotVisibleMethod, NotVisibleType, NullLocalVariableComparisonYieldsFalse, NullLocalVariableInstanceofYieldsFalse, NullLocalVariableReference, NullSourceString, NumericValueOutOfRange, ObjectCannotHaveSuperTypes, ObjectMustBeClass, OptionalSemiColon, OuterLocalMustBeFinal, OverridingDeprecatedMethod, OverridingMethodWithoutSuperInvocation, OverridingNonVisibleMethod, PackageCollidesWithType, PackageIsNotExpectedPackage, ParameterAssignment, ParameterMismatch, ParsingError, ParsingErrorDeleteToken, ParsingErrorDeleteTokens, ParsingErrorInsertToComplete, ParsingErrorInsertToCompletePhrase, ParsingErrorInsertToCompleteScope, ParsingErrorInsertTokenAfter, ParsingErrorInsertTokenBefore, ParsingErrorInvalidToken, ParsingErrorMergeTokens, ParsingErrorMisplacedConstruct, ParsingErrorNoSuggestion, ParsingErrorNoSuggestionForTokens, ParsingErrorOnKeyword, ParsingErrorOnKeywordNoSuggestion, ParsingErrorReplaceTokens, ParsingErrorUnexpectedEOF, PossibleAccidentalBooleanAssignment, PotentialNullLocalVariableReference, RecursiveConstructorInvocation, RedefinedArgument, RedefinedLocal, RedundantLocalVariableNullAssignment, RedundantNullCheckOnNonNullLocalVariable, RedundantNullCheckOnNullLocalVariable, ReferenceToForwardField, ShouldReturnValue, StaticInheritedMethodConflicts, StaticMethodRequested, StringConstantIsExceedingUtf8Limit, SuperclassMustBeAClass, SuperfluousSemicolon, Syntax, Task, ThisInStaticContext, ThisSuperDuringConstructorInvocation, TooManyArgumentSlots, TooManyArrayDimensions, TooManyBytesForStringConstant, TooManyConstantsInConstantPool, TooManyFields, TooManyLocalVariableSlots, TooManyMethods, TypeCollidesWithPackage, TypeHidingType, TypeMismatch, TypeRelated, Unclassified, UndefinedConstructor, UndefinedConstructorInDefaultConstructor, UndefinedConstructorInImplicitConstructorCall, UndefinedField, UndefinedFunction, UndefinedLabel, UndefinedMethod, UndefinedName, UndefinedType, UndocumentedEmptyBlock, UnexpectedStaticModifierForField, UnexpectedStaticModifierForMethod, UnhandledException, UnhandledExceptionInDefaultConstructor, UnhandledExceptionInImplicitConstructorCall, UninitializedBlankFinalField, UninitializedGlobalVariable, UninitializedLocalVariable, UnmatchedBracket, UnnecessaryElse, UnnecessaryInstanceof, UnnecessaryNLSTag, UnqualifiedFieldAccess, UnreachableCatch, UnterminatedComment, UnterminatedString, UnusedConstructorDeclaredThrownException, UnusedLabel, UnusedMethodDeclaredThrownException, UnusedPrivateConstructor, UnusedPrivateField, UnusedPrivateMethod, UnusedPrivateType, UseAssertAsAnIdentifier, UseEnumAsAnIdentifier, UsingDeprecatedConstructor, UsingDeprecatedField, UsingDeprecatedMethod, UsingDeprecatedType, VariableTypeCannotBeVoid, VoidMethodReturnsValue, WrongNumberOfArguments
Constructor and Description |
---|
CategorizedProblem() |
Modifier and Type | Method and Description |
---|---|
abstract int |
getCategoryID()
Returns an integer identifying the category of this problem.
|
java.lang.String[] |
getExtraMarkerAttributeNames()
Returns the names of the extra marker attributes associated to this problem when persisted into a marker
by the JavaBuilder.
|
java.lang.Object[] |
getExtraMarkerAttributeValues()
Returns the respective values for the extra marker attributes associated to this problem when persisted into
a marker by the JavaBuilder.
|
abstract java.lang.String |
getMarkerType()
Returns the marker type associated to this problem, if it gets persisted into a marker by the JavaBuilder
Standard JavaScript problems are associated to marker type "org.eclipse.wst.jsdt.core.problem").
|
void |
setMessage(java.lang.String msg) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getArguments, getID, getMessage, getOriginatingFileName, getSourceEnd, getSourceLineNumber, getSourceStart, isError, isWarning, setSourceEnd, setSourceLineNumber, setSourceStart
public static final int CAT_UNSPECIFIED
public static final int CAT_BUILDPATH
public static final int CAT_SYNTAX
public static final int CAT_IMPORT
public static final int CAT_TYPE
public static final int CAT_MEMBER
public static final int CAT_INTERNAL
public static final int CAT_JAVADOC
public static final int CAT_CODE_STYLE
public static final int CAT_POTENTIAL_PROGRAMMING_PROBLEM
public static final int CAT_NAME_SHADOWING_CONFLICT
public static final int CAT_UNNECESSARY_CODE
public static final int CAT_RESTRICTION
public abstract int getCategoryID()
CategorizedProblem
may choose arbitrary values for problem/category IDs, as long as they are associated with a different
marker type.
Standard JavaScript problem markers (i.e. marker type is "org.eclipse.wst.jsdt.core.problem") carry an
attribute "categoryId" persisting the originating problem category ID as defined by this method).public abstract java.lang.String getMarkerType()
public java.lang.String[] getExtraMarkerAttributeNames()
IMarker#MESSAGE
-> IProblem.getMessage()
IMarker#SEVERITY
-> IMarker#SEVERITY_ERROR
or
IMarker#SEVERITY_WARNING
depending on IProblem.isError()
or IProblem.isWarning()
IJavaScriptModelMarker#ID
-> IProblem.getID()
IMarker#CHAR_START
-> IProblem.getSourceStart()
IMarker#CHAR_END
-> IProblem.getSourceEnd()
IMarker#LINE_NUMBER
-> IProblem.getSourceLineNumber()
IJavaScriptModelMarker#ARGUMENTS
-> some String[]
used to compute quickfixes IJavaScriptModelMarker#CATEGORY_ID
-> getCategoryID()
IMarker#setAttributes(String[], Object[])
,
and there must be as many names as values according to getExtraMarkerAttributeValues()
.
Note that extra marker attributes will be inserted after default ones (as described in getMarkerType()
,
and thus could be used to override defaults.public java.lang.Object[] getExtraMarkerAttributeValues()
getExtraMarkerAttributeNames()
.
The values must be eligible for marker creation, as defined by IMarker#setAttributes(String[], Object[])
.public void setMessage(java.lang.String msg)
Copyright (c) IBM Corp. and others 2000, 2016. All Rights Reserved.