Package org.eclipse.jdt.core

Examples of org.eclipse.jdt.core.IAnnotation


    if (match.getAccuracy() == SearchMatch.A_INACCURATE)
      return;
    TypeReferenceMatch refMatch = (TypeReferenceMatch)match;
   
    IType contextType = (IType) refMatch.getElement();     
    IAnnotation constraint = (IAnnotation) refMatch.getLocalElement();
   
    if (parsed.contains(constraint))
      return; //SCREW YOU ECLIPSE!!!!
   
    if (constraint.getElementName().contains("Constraints")) {
      for (Object objAnno : (Object[])constraint.getMemberValuePairs()[0].getValue()) {
        parseConstraint((IAnnotation)objAnno, contextType);
      }
    }
    else
      parseConstraint(constraint, contextType);
View Full Code Here


    if (match.getAccuracy() == SearchMatch.A_INACCURATE)
      return;
    TypeReferenceMatch refMatch = (TypeReferenceMatch)match;
   
    IType relation = (IType) refMatch.getElement();
    IAnnotation relAnno = (IAnnotation) refMatch.getLocalElement();
   
    Object[] types = (Object[])relAnno.getMemberValuePairs()[0].getValue();
    String[] qualifiedTypes = new String[types.length];
    for (int ndx = 0; ndx < qualifiedTypes.length; ndx++)
      qualifiedTypes[ndx] = Utilities.resolveType(relation, (String)types[ndx]);
    addRelation(new Relation(relation.getFullyQualifiedName(), qualifiedTypes));
View Full Code Here

    if (match.getAccuracy() == SearchMatch.A_INACCURATE)
      return;
    TypeReferenceMatch refMatch = (TypeReferenceMatch)match;
   
    IType contextType = (IType) refMatch.getElement();     
    IAnnotation infer = (IAnnotation) refMatch.getLocalElement();
   
    if (parsed.contains(infer))
      return; //SCREW YOU ECLIPSE!!!!
   
    if (infer.getElementName().contains("Infers")) {
      for (Object objAnno : (Object[])infer.getMemberValuePairs()[0].getValue()) {
        parseInferRule((IAnnotation)objAnno, contextType);
      }
    }
    else
      parseInferRule(infer, contextType);
View Full Code Here

      }
      else {
        rel = isMultiRelation(anno, method.getDeclaringType());
        if (rel != null) {
          for (Object obj : (Object[])anno.getMemberValuePairs()[0].getValue()) {
            IAnnotation inner = (IAnnotation)obj;
            effects.add(parseEffect(inner, rel, method));
          }
        }
      }
    }
View Full Code Here

    if (((Object[])pair.getValue()).length < 2//can't be a multi-anno if there's less than two things in it
      return null;
   
   
    //check if those annotations are a relation
    IAnnotation inner = (IAnnotation)((Object[])pair.getValue())[0];
    String qName = Utilities.resolveType(context, inner.getElementName());
    return rels.findRelation(qName);
  }
View Full Code Here

    if (match.getAccuracy() == SearchMatch.A_INACCURATE)
      return;
    TypeReferenceMatch refMatch = (TypeReferenceMatch)match;
   
    IMethod methodType = (IMethod) refMatch.getElement();     
    IAnnotation callback = (IAnnotation) refMatch.getLocalElement();
   
    if (parsed.contains(callback))
      return; //SCREW YOU ECLIPSE!!!!
   
    parseCallback(callback, methodType);
View Full Code Here

      }

      JUnitTest test = new JUnitTest();
      test.setName(JavaUtils.getFullyQualifiedName(src));
      if (method != null){
        IAnnotation testAnnotation = method.getAnnotation("Test");
        if (testAnnotation == null || !testAnnotation.exists()){
          println(Services.getMessage(
                "junit.testing.test.method.not.annotated",
                method.getElementName()));
          return null;
        }
View Full Code Here

  }
}
private void findAnnotationChanges(IAnnotation[] oldAnnotations, IAnnotation[] newAnnotations, IJavaElement parent) {
  ArrayList annotationDeltas = null;
  for (int i = 0, length = newAnnotations.length; i < length; i++) {
    IAnnotation newAnnotation = newAnnotations[i];
    Object oldInfo = this.annotationInfos.remove(newAnnotation);
    if (oldInfo == null) {
      JavaElementDelta annotationDelta = new JavaElementDelta(newAnnotation);
      annotationDelta.added();
      if (annotationDeltas == null) annotationDeltas = new ArrayList();
      annotationDeltas.add(annotationDelta);
      continue;
    } else {
      AnnotationInfo newInfo = null;
      try {
        newInfo = (AnnotationInfo) ((JavaElement) newAnnotation).getElementInfo();
      } catch (JavaModelException npe) {
        return;
      }
      if (!Util.equalArraysOrNull(((AnnotationInfo) oldInfo).members, newInfo.members)) {
        JavaElementDelta annotationDelta = new JavaElementDelta(newAnnotation);
        annotationDelta.changed(IJavaElementDelta.F_CONTENT);
        if (annotationDeltas == null) annotationDeltas = new ArrayList();
        annotationDeltas.add(annotationDelta);
      }
    }
  }
  for (int i = 0, length = oldAnnotations.length; i < length; i++) {
    IAnnotation oldAnnotation = oldAnnotations[i];
    if (this.annotationInfos.remove(oldAnnotation) != null) {
      JavaElementDelta annotationDelta = new JavaElementDelta(oldAnnotation);
      annotationDelta.removed();
      if (annotationDeltas == null) annotationDeltas = new ArrayList();
      annotationDeltas.add(annotationDelta);    }
View Full Code Here

 
  //
 
  public static IMemberValuePair[] getAnnotationValuePairs(IJavaElement javaElement, String annotationName) {
    if (javaElement instanceof IAnnotatable) {
      IAnnotation annotation = ((IAnnotatable) javaElement).getAnnotation(annotationName);
      if (annotation != null) {
        try {
          return annotation.getMemberValuePairs();
        } catch (JavaModelException e) {
          System.err.println("Couldn't get annotation value pairs for " + annotation + " of " + javaElement + ": " + e);
        }
      }
    }
View Full Code Here

          String runMode) {
    launchMethodConfiguration(javaProject, imethod, runMode, null);
  }

  private static boolean methodHasDependencies(IMethod method) throws JavaModelException {
    IAnnotation annotation = method.getAnnotation("Test");
    return annotation != null &&
        (contains(annotation.getMemberValuePairs(), "dependsOnGroups")
         || contains(annotation.getMemberValuePairs(), "dependsOnMethods"));
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.IAnnotation

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.