Package org.eclipse.emf.common.util

Examples of org.eclipse.emf.common.util.Diagnostic


        }
        else if (type instanceof MethodType)
        {
            final int offset = _context.getDocumentPosition() + node.getFirstToken().beginColumn - 1;
            final int length = node.getLastToken().endColumn - node.getFirstToken().beginColumn+1;
            final Diagnostic diagnostic = _diagnosticFactory.create_CANNOT_APPLY_OPERATOR_TO_METHOD_BINDING();
            _reporter.report(diagnostic, offset, length);
        }

        return null;
    }
View Full Code Here


            // some syntatical issue
            if (expr.getLastToken().endColumn < _elText.trim().length()-1)
            {
                final int offset = _context.getDocumentPosition() + expr.getLastToken().endColumn;
                final int length = _elText.trim().length() - expr.getLastToken().endColumn;
                final Diagnostic diagnostic =
                    _diagnosticFactory.create_GENERAL_SYNTAX_ERROR();
               
                _reporter.report(diagnostic, offset, length);
            }
           
            return expr;
        }
        catch (ParseException e) {
            Token curTok = e.currentToken;
            int offset = _context.getDocumentPosition() + curTok.beginColumn;
            int length = curTok.endColumn - curTok.beginColumn + 1;
            final Diagnostic diagnostic = _diagnosticFactory.create_GENERAL_SYNTAX_ERROR();
            _reporter.report(diagnostic, offset, length);
            return null;
        }
        catch (TokenMgrError te) {
            final int offset = _context.getDocumentPosition();
            final int length = _elText.length();
            final Diagnostic diagnostic =
                _diagnosticFactory.create_GENERAL_SYNTAX_ERROR();
            _reporter.report(diagnostic, offset, length);
            return null;
        }
    }
View Full Code Here

        // called
        if (nonEnumType instanceof LiteralType)
        {
            assert nonEnumType instanceof StringLiteralType;
           
            Diagnostic result = validateIfEnumToStringComparison(((StringLiteralType)nonEnumType).getLiteralValue(), enumType);
           
            if (result != null)
            {
                // compare two things that aren't equal
                return BooleanLiteralType.valueOf(doRealOperation("foo", "foo_")); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

            secondValue = ((LiteralType)secondType).getLiteralValue();
        }

        if (firstValue != null)
        {
            Diagnostic result = validateIfEnumToStringComparison(firstValue, secondType);
           
            if (result != null)
            {
                return result;
            }
        }

        if (secondValue != null)
        {
            Diagnostic result = validateIfEnumToStringComparison(secondValue, firstType);
           
            if (result != null)
            {
                return result;
            }
View Full Code Here

            secondValue = ((LiteralType)secondType).getLiteralValue();
        }

        if (firstValue != null)
        {
            Diagnostic result = validateIfEnumToStringComparison(firstValue, secondType);
           
            if (result != null)
            {
                return handleIfEnumToNonMemberStringComparison(firstValue, secondType);
            }
        }

        if (secondValue != null)
        {
            Diagnostic result = validateIfEnumToStringComparison(secondValue, firstType);
           
            if (result != null)
            {
                return handleIfEnumToNonMemberStringComparison(secondValue, firstType);
            }
View Full Code Here

        // called
        if (nonEnumType instanceof LiteralType)
        {
            assert nonEnumType instanceof StringLiteralType;
           
            Diagnostic result = validateIfEnumToStringComparison(((StringLiteralType)nonEnumType).getLiteralValue(), enumType);
           
            if (result != null)
            {
                return result;
            }
View Full Code Here

        // (compareTo may not work on the other arg, but who knows),
        // we are good
        if (firstArg.isInstanceOf(TypeConstants.TYPE_COMPARABLE)
                || secondArg.isInstanceOf(TypeConstants.TYPE_COMPARABLE))
        {
            Diagnostic diag = Diagnostic.OK_INSTANCE;
            if(checkIfIncompatibleEnums(firstArg, secondArg))
            {
                diag = _diagnosticFactory.create_BINARY_OP_COMPARISON_OF_ENUMS_INCOMPATIBLE();
            }
            return diag;
View Full Code Here

  }

  public Diagnostic validateObjectSymbolValue(IObjectSymbolBasedValueType firstArg,
                        ValueType secondArg)
  {
      Diagnostic diag = Diagnostic.OK_INSTANCE;
     
        if (secondArg instanceof LiteralType)
        {
          diag = validateNamedPropertyAccessorBase(firstArg, (LiteralType) secondArg);
        }
View Full Code Here

                        // anyway.
                        if ("".equals(elText.trim())) //$NON-NLS-1$
                        {
                            final int offset = elContext.getDocumentPosition() - 1;
                            final int length = elText.length() + 2;
                            final Diagnostic diagnostic = _validationContext
                            .getDiagnosticFactory()
                            .create_EMPTY_EL_EXPRESSION();
                            // detected empty EL expression
                            if (_validationContext.shouldValidateEL())
                            {
View Full Code Here

                                && _validationContext.shouldValidateEL())
                        {
                            final int offset = sDocContext
                                    .getDocumentPosition() + 1;
                            final int length = parentRegion.getText().length();
                            final Diagnostic diagnostic = _validationContext
                                    .getDiagnosticFactory()
                                    .create_MISSING_CLOSING_EXPR_BRACKET();
                            _validationContext.getReporter().report(diagnostic,
                                    offset, length);
                        }
View Full Code Here

TOP

Related Classes of org.eclipse.emf.common.util.Diagnostic

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.