@Override public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append("API problem: "); // $NON-NLS-1$ buffer .append(fResourcePath != null ? fResourcePath : "no path") .append("\n"); // $NON-NLS-1$//$NON-NLS-2$ buffer.append("\tseverity: "); // $NON-NLS-1$ buffer.append(Util.getSeverity(getSeverity())).append("\n"); // $NON-NLS-1$ buffer.append("\tcategory: "); // $NON-NLS-1$ buffer.append(ApiProblem.getProblemCategory(getCategory())).append("\n"); // $NON-NLS-1$ buffer.append("\telement kind: "); // $NON-NLS-1$ buffer .append(ApiProblem.getProblemElementKind(getCategory(), getElementKind())) .append("\n"); // $NON-NLS-1$ buffer.append("\tkind: "); // $NON-NLS-1$ buffer.append(ApiProblem.getProblemKind(getCategory(), getKind())).append("\n"); // $NON-NLS-1$ buffer.append("\tflags: "); // $NON-NLS-1$ buffer .append(ApiProblem.getProblemFlagsName(getCategory(), getFlags())) .append("\n"); // $NON-NLS-1$ buffer.append("\tmessage id: "); // $NON-NLS-1$ buffer.append(getMessageid()); buffer.append("\n\tmessage: "); // $NON-NLS-1$ buffer.append(getMessage()); return buffer.toString(); }
/** * Returns the string representation of the element kind of an {@link IApiProblem}, given its * category * * @param category * @param kind * @return the string of the {@link IApiProblem} element kind */ public static String getProblemElementKind(int category, int kind) { switch (category) { case IApiProblem.CATEGORY_COMPATIBILITY: case IApiProblem.CATEGORY_SINCETAGS: { return Util.getDeltaElementType(kind); } case IApiProblem.CATEGORY_USAGE: case IApiProblem.CATEGORY_VERSION: case IApiProblem.CATEGORY_API_BASELINE: case IApiProblem.CATEGORY_API_COMPONENT_RESOLUTION: { return ApiProblem.getDescriptorKind(kind); } case IApiProblem.CATEGORY_API_USE_SCAN_PROBLEM: { return Util.getApiElementType(kind); } default: return Util.UNKNOWN_KIND; } }
/** * Returns the string representation of the kind of an {@link IApiProblem}, given its category * * @param category * @param kind * @return the string of the {@link IApiProblem} kind */ public static String getProblemKind(int category, int kind) { switch (category) { case IApiProblem.CATEGORY_COMPATIBILITY: return Util.getDeltaKindName(kind); case IApiProblem.CATEGORY_SINCETAGS: return ApiProblem.getTagsProblemKindName(kind); case IApiProblem.CATEGORY_USAGE: return ApiProblem.getUsageProblemKindName(kind); case IApiProblem.CATEGORY_VERSION: return ApiProblem.getVersionProblemKindName(kind); case IApiProblem.CATEGORY_API_BASELINE: return ApiProblem.getApiBaselineProblemKindName(kind); case IApiProblem.CATEGORY_API_COMPONENT_RESOLUTION: return ApiProblem.getApiComponentResolutionProblemKindName(kind); case IApiProblem.CATEGORY_API_USE_SCAN_PROBLEM: return ApiProblem.getApiUseScanProblemKindName(kind); default: return Util.UNKNOWN_KIND; } }