@Check
 public void checkAnnotationIsBindingAnnotation(final XAnnotation it) {
   JvmType _annotationType = it.getAnnotationType();
   final JvmType type = _annotationType;
   boolean _matched = false;
   if (!_matched) {
     if (type instanceof JvmAnnotationType) {
       final JvmAnnotationType _jvmAnnotationType = (JvmAnnotationType) type;
       _matched = true;
       EList<JvmAnnotationReference> _annotations = _jvmAnnotationType.getAnnotations();
       final Function1<JvmAnnotationReference, Boolean> _function =
           new Function1<JvmAnnotationReference, Boolean>() {
             public Boolean apply(final JvmAnnotationReference it) {
               JvmAnnotationType _annotation = it.getAnnotation();
               boolean _is =
                   GuiceModulesValidator.this._typeReferences.is(
                       _annotation, BindingAnnotation.class);
               return Boolean.valueOf(_is);
             }
           };
       boolean _exists =
           IterableExtensions.<JvmAnnotationReference>exists(_annotations, _function);
       boolean _not = (!_exists);
       if (_not) {
         this.error(
             "The annotation is not annotated with @BindingAnnotation",
             Literals.XANNOTATION__ANNOTATION_TYPE);
       }
     }
   }
 }
Exemplo n.º 2
0
 protected boolean hasExtendsAnnotation(final XAnnotation annotation) {
   boolean _and = false;
   JvmType _annotationType = annotation.getAnnotationType();
   String _qualifiedName = null;
   if (_annotationType != null) {
     _qualifiedName = _annotationType.getQualifiedName();
   }
   String _name = Extends.class.getName();
   boolean _equals = Objects.equal(_qualifiedName, _name);
   if (!_equals) {
     _and = false;
   } else {
     XExpression _value = annotation.getValue();
     _and = (_value instanceof XTypeLiteral);
   }
   return _and;
 }
 protected void highlightAnnotation(
     XAnnotation annotation,
     IHighlightedPositionAcceptor acceptor,
     String highlightingConfiguration) {
   JvmType annotationType = annotation.getAnnotationType();
   if (annotationType != null
       && !annotationType.eIsProxy()
       && annotationType instanceof JvmAnnotationType) {
     ICompositeNode xannotationNode = NodeModelUtils.findActualNodeFor(annotation);
     if (xannotationNode != null) {
       ILeafNode firstLeafNode =
           NodeModelUtils.findLeafNodeAtOffset(xannotationNode, xannotationNode.getOffset());
       if (firstLeafNode != null)
         highlightNode(acceptor, firstLeafNode, highlightingConfiguration);
     }
     highlightReferenceJvmType(
         acceptor,
         annotation,
         XAnnotationsPackage.Literals.XANNOTATION__ANNOTATION_TYPE,
         annotationType,
         highlightingConfiguration);
   }
 }