public void add(Diagnostic diagnostic) { if (children == null) { children = new BasicEList<Diagnostic>(); } children.add(diagnostic); int childSeverity = diagnostic.getSeverity(); if (childSeverity > getSeverity()) { severity = childSeverity; } }
/** * Parses a list of type parameters and returns a diagnostic representing the result of the analysis. * The {@link Diagnostic#getData() data} of the diagnostic will contain as the first object, the resulting list of {@link ETypeParameter type parameters}. * @param typeParameterList a comma separated list of type parameters delimited by '<' and '>'. * @return the diagnostic result of the analysis. */ public Diagnostic parseTypeParameterList(final String typeParameterList) { BasicDiagnostic placeholder = new BasicDiagnostic(); char [] instanceTypeNameCharacterArray = typeParameterList == null ? NO_CHARS : typeParameterList.toCharArray(); List<ETypeParameter> eTypeParameters = handleTypeParameters(instanceTypeNameCharacterArray, 0, instanceTypeNameCharacterArray.length, placeholder); BasicDiagnostic result = createDiagnostic (placeholder.getSeverity(), DIAGNOSTIC_SOURCE, WELL_FORMED_INSTANCE_TYPE_NAME, "_UI_EClassifierInstanceTypeNameAnalysisResult_diagnostic", new Object [] { typeParameterList }, new Object [] { eTypeParameters, typeParameterList }); result.addAll(placeholder); return result; }
/** * Parses an instance type name and returns a diagnostic representing the result of the analysis. * The {@link Diagnostic#getData() data} of the diagnostic will contain as the first object, the resulting {@link EGenericType generic type}. * @param instanceTypeName an instance type name. * @return the diagnostic result of the analysis. */ public Diagnostic parseInstanceTypeName(final String instanceTypeName) { BasicDiagnostic placeholder = new BasicDiagnostic(); char [] instanceTypeNameCharacterArray = instanceTypeName == null ? NO_CHARS: instanceTypeName.toCharArray(); EGenericType eGenericType = handleInstanceTypeName(instanceTypeNameCharacterArray, 0, instanceTypeNameCharacterArray.length, placeholder); BasicDiagnostic result = createDiagnostic (placeholder.getSeverity(), DIAGNOSTIC_SOURCE, WELL_FORMED_INSTANCE_TYPE_NAME, "_UI_EClassifierInstanceTypeNameAnalysisResult_diagnostic", new Object [] { instanceTypeName }, new Object [] { eGenericType, instanceTypeName }); result.addAll(placeholder); return result; }
/** * Parses a type parameter and returns a diagnostic representing the result of the analysis. * The {@link Diagnostic#getData() data} of the diagnostic will contain as the first object, the resulting {@link ETypeParameter type parameter}. * @param typeParameter a type parameter. * @return the diagnostic result of the analysis. */ public Diagnostic parseTypeParameter(final String typeParameter) { BasicDiagnostic placeholder = new BasicDiagnostic(); char [] instanceTypeNameCharacterArray = typeParameter == null ? NO_CHARS : typeParameter.toCharArray(); ETypeParameter eTypeParameter = handleTypeParameter(instanceTypeNameCharacterArray, 0, instanceTypeNameCharacterArray.length, placeholder); BasicDiagnostic result = createDiagnostic (placeholder.getSeverity(), DIAGNOSTIC_SOURCE, WELL_FORMED_INSTANCE_TYPE_NAME, "_UI_EClassifierInstanceTypeNameAnalysisResult_diagnostic", new Object [] { typeParameter }, new Object [] { eTypeParameter, typeParameter }); result.addAll(placeholder); return result; }
/** * Parses an instance type name and returns a diagnostic representing the result of the analysis. * The {@link Diagnostic#getData() data} of the diagnostic will contain as the first object, the resulting {@link EGenericType generic type}. * @param instanceTypeName an instance type name. * @return the diagnostic result of the analysis. */ public Diagnostic parseInstanceTypeName(final String instanceTypeName) { BasicDiagnostic placeholder = new BasicDiagnostic(); char [] instanceTypeNameCharacterArray = instanceTypeName == null ? NO_CHARS: instanceTypeName.toCharArray(); EGenericType eGenericType = handleInstanceTypeName(instanceTypeNameCharacterArray, 0, instanceTypeNameCharacterArray.length, placeholder); BasicDiagnostic result = createDiagnostic (placeholder.getSeverity(), DIAGNOSTIC_SOURCE, WELL_FORMED_INSTANCE_TYPE_NAME, "_UI_EClassifierInstanceTypeNameAnalysisResult_diagnostic", new Object [] { instanceTypeName }, new Object [] { eGenericType, instanceTypeName }); result.addAll(placeholder); return result; }
/** * Parses a list of type arguments and returns a diagnostic representing the result of the analysis. * The {@link Diagnostic#getData() data} of the diagnostic will contain as the first object, the resulting list of {@link EGenericType type arguments}. * @param typeArgumentList a comma separated list of type arguments. * @return the diagnostic result of the analysis. * @since 2.4 */ public Diagnostic parseTypeArgumentList(final String typeArgumentList) { BasicDiagnostic placeholder = new BasicDiagnostic(); char [] instanceTypeNameCharacterArray = typeArgumentList == null ? NO_CHARS : typeArgumentList.toCharArray(); List<EGenericType> eTypeArguments = handleTypeArguments(instanceTypeNameCharacterArray, 0, instanceTypeNameCharacterArray.length, placeholder); BasicDiagnostic result = createDiagnostic (placeholder.getSeverity(), DIAGNOSTIC_SOURCE, WELL_FORMED_INSTANCE_TYPE_NAME, "_UI_EClassifierInstanceTypeNameAnalysisResult_diagnostic", new Object [] { typeArgumentList }, new Object [] { eTypeArguments, typeArgumentList }); result.addAll(placeholder); return result; }
/** * Parses a list of type parameters and returns a diagnostic representing the result of the analysis. * The {@link Diagnostic#getData() data} of the diagnostic will contain as the first object, the resulting list of {@link ETypeParameter type parameters}. * @param typeParameterList a comma separated list of type parameters delimited by '<' and '>'. * @return the diagnostic result of the analysis. */ public Diagnostic parseTypeParameterList(final String typeParameterList) { BasicDiagnostic placeholder = new BasicDiagnostic(); char [] instanceTypeNameCharacterArray = typeParameterList == null ? NO_CHARS : typeParameterList.toCharArray(); List<ETypeParameter> eTypeParameters = handleTypeParameters(instanceTypeNameCharacterArray, 0, instanceTypeNameCharacterArray.length, placeholder); BasicDiagnostic result = createDiagnostic (placeholder.getSeverity(), DIAGNOSTIC_SOURCE, WELL_FORMED_INSTANCE_TYPE_NAME, "_UI_EClassifierInstanceTypeNameAnalysisResult_diagnostic", new Object [] { typeParameterList }, new Object [] { eTypeParameters, typeParameterList }); result.addAll(placeholder); return result; }
/** * Parses a type parameter and returns a diagnostic representing the result of the analysis. * The {@link Diagnostic#getData() data} of the diagnostic will contain as the first object, the resulting {@link ETypeParameter type parameter}. * @param typeParameter comma separated list of type parameters delimited by '<' and '>'. * @return the diagnostic result of the analysis. */ public Diagnostic parseTypeParameter(final String typeParameter) { BasicDiagnostic placeholder = new BasicDiagnostic(); char [] instanceTypeNameCharacterArray = typeParameter == null ? NO_CHARS : typeParameter.toCharArray(); ETypeParameter eTypeParameter = handleTypeParameter(instanceTypeNameCharacterArray, 0, instanceTypeNameCharacterArray.length, placeholder); BasicDiagnostic result = createDiagnostic (placeholder.getSeverity(), DIAGNOSTIC_SOURCE, WELL_FORMED_INSTANCE_TYPE_NAME, "_UI_EClassifierInstanceTypeNameAnalysisResult_diagnostic", new Object [] { typeParameter }, new Object [] { eTypeParameter, typeParameter }); result.addAll(placeholder); return result; }
/** * Parses a list of type arguments and returns a diagnostic representing the result of the analysis. * The {@link Diagnostic#getData() data} of the diagnostic will contain as the first object, the resulting list of {@link EGenericType type arguments}. * @param typeArgumentList a comma separated list of type arguments. * @return the diagnostic result of the analysis. * @since 2.4 */ public Diagnostic parseTypeArgumentList(final String typeArgumentList) { BasicDiagnostic placeholder = new BasicDiagnostic(); char [] instanceTypeNameCharacterArray = typeArgumentList == null ? NO_CHARS : typeArgumentList.toCharArray(); List<EGenericType> eTypeArguments = handleTypeArguments(instanceTypeNameCharacterArray, 0, instanceTypeNameCharacterArray.length, placeholder); BasicDiagnostic result = createDiagnostic (placeholder.getSeverity(), DIAGNOSTIC_SOURCE, WELL_FORMED_INSTANCE_TYPE_NAME, "_UI_EClassifierInstanceTypeNameAnalysisResult_diagnostic", new Object [] { typeArgumentList }, new Object [] { eTypeArguments, typeArgumentList }); result.addAll(placeholder); return result; }
if (diagnostic.getSeverity() != Diagnostic.OK)
if (diagnostic.getSeverity() != Diagnostic.OK) else if (diagnostic.getSeverity() != Diagnostic.OK) if (diagnostic.getSeverity() != Diagnostic.OK)