Tabnine Logo
ClassNode.setAnnotated
Code IndexAdd Tabnine to your IDE (free)

How to use
setAnnotated
method
in
org.codehaus.groovy.ast.ClassNode

Best Java code snippets using org.codehaus.groovy.ast.ClassNode.setAnnotated (Showing top 5 results out of 315)

origin: org.codehaus.groovy/groovy

  return;
this.currentClass.setAnnotated(true);
if (!isAnnotationCompatible()) {
  addError("Annotations are not supported in the current runtime. " + JVM_ERROR_MESSAGE, node);
origin: org.codehaus.groovy/groovy-all-minimal

protected void visitAnnotations(AnnotatedNode node, int target) {
  if(node.getAnnotations().isEmpty()) {
    return;
  }
  
  this.currentClass.setAnnotated(true);
  
  if(!isAnnotationCompatible()) {
    addError("Annotations are not supported in the current runtime." + JVM_ERROR_MESSAGE,
        node);
    return;
  }
  
  Collection annotations = node.getAnnotations().values();
  for(Iterator it = annotations.iterator(); it.hasNext(); ) {
    AnnotationNode an = (AnnotationNode) it.next();
    AnnotationNode annotation = visitAnnotation(an);
    if(!annotation.isValid()) {
      return;
    }
    if(!annotation.isTargetAllowed(target)) {
      addError("Annotation @" + annotation.getClassNode().getName()
          + " is not allowed on element " + AnnotationNode.targetToName(target),
          annotation);
    }
  }
}
 
origin: org.kohsuke.droovy/groovy

protected void visitAnnotations(AnnotatedNode node, int target) {
  if (node.getAnnotations().isEmpty()) {
    return;
  }
  this.currentClass.setAnnotated(true);
  if (!isAnnotationCompatible()) {
    addError("Annotations are not supported in the current runtime. " + JVM_ERROR_MESSAGE, node);
    return;
  }
  Collection annotations = node.getAnnotations();
  for (Iterator it = annotations.iterator(); it.hasNext();) {
    AnnotationNode annotation = visitAnnotation((AnnotationNode) it.next());
    boolean isTargetAnnotation = annotation.getClassNode().isResolved() &&
      annotation.getClassNode().getTypeClass() == Target.class;
    // Check if the annotation target is correct, unless it's the target annotating an annotation definition
    // defining on which target elements the annotation applies
    if (!isTargetAnnotation && !annotation.isTargetAllowed(target)) {
      addError("Annotation @" + annotation.getClassNode().getName()
          + " is not allowed on element " + AnnotationNode.targetToName(target),
          annotation);
    }
  }
}
origin: org.codehaus.groovy/groovy-jdk14

protected void visitAnnotations(AnnotatedNode node, int target) {
  if (node.getAnnotations().isEmpty()) {
    return;
  }
  this.currentClass.setAnnotated(true);
  if (!isAnnotationCompatible()) {
    addError("Annotations are not supported in the current runtime. " + JVM_ERROR_MESSAGE, node);
    return;
  }
  Collection annotations = node.getAnnotations();
  for (Iterator it = annotations.iterator(); it.hasNext();) {
    AnnotationNode annotation = visitAnnotation((AnnotationNode) it.next());
    boolean isTargetAnnotation = annotation.getClassNode().isResolved() &&
      annotation.getClassNode().getTypeClass() == Target.class;
    // Check if the annotation target is correct, unless it's the target annotating an annotation definition
    // defining on which target elements the annotation applies
    if (!isTargetAnnotation && !annotation.isTargetAllowed(target)) {
      addError("Annotation @" + annotation.getClassNode().getName()
          + " is not allowed on element " + AnnotationNode.targetToName(target),
          annotation);
    }
    visitDeprecation(node, annotation);
  }
}
origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

protected void visitAnnotations(AnnotatedNode node, int target) {
  if (node.getAnnotations().isEmpty()) {
    return;
  }
  this.currentClass.setAnnotated(true);
  if (!isAnnotationCompatible()) {
    addError("Annotations are not supported in the current runtime. " + JVM_ERROR_MESSAGE, node);
    return;
  }
  for (AnnotationNode unvisited : node.getAnnotations()) {
    AnnotationNode visited = visitAnnotation(unvisited);
    boolean isTargetAnnotation = visited.getClassNode().isResolved() &&
        visited.getClassNode().getName().equals("java.lang.annotation.Target");
    // Check if the annotation target is correct, unless it's the target annotating an annotation definition
    // defining on which target elements the annotation applies
    if (!isTargetAnnotation && !visited.isTargetAllowed(target)) {
      addError("Annotation @" + visited.getClassNode().getName()
          + " is not allowed on element " + AnnotationNode.targetToName(target),
          visited);
    }
    visitDeprecation(node, visited);
  }
}
org.codehaus.groovy.astClassNodesetAnnotated

Javadoc

Marks if the current class uses annotations or not

Popular methods of ClassNode

  • getName
  • getMethods
    This methods creates a list of all methods with this name of the current class and of all super clas
  • <init>
    Constructor used by makeArray() if no real class is available
  • getSuperClass
  • equals
  • addMethod
  • getAnnotations
  • addField
  • getFields
    Returns a list containing FieldNode objects for each field in the class represented by this ClassNod
  • getPlainNodeReference
  • getField
    Finds a field matching the given name in this class or a parent class.
  • getMethod
    Finds a method matching the given name and parameters in this class or any parent class.
  • getField,
  • getMethod,
  • isInterface,
  • getNameWithoutPackage,
  • isScript,
  • getDeclaredMethod,
  • getGenericsTypes,
  • getDeclaredConstructors,
  • getModifiers,
  • getTypeClass

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (Timer)
  • compareTo (BigDecimal)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now