org.eclipse.jetty.annotations

## Class AnnotationParser

- java.lang.Object
- - org.eclipse.jetty.annotations.AnnotationParser

-     public class AnnotationParser
      extends Object

  AnnotationParser Use asm to scan classes for annotations. A SAX-style parsing is done, with a handler being able to be registered to handle each annotation type.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `AnnotationParser.ClassHandler`
    `static interface` | `AnnotationParser.DiscoverableAnnotationHandler`
    `static interface` | `AnnotationParser.FieldHandler`
    `class` | `AnnotationParser.ListValue`
    `static interface` | `AnnotationParser.MethodHandler`
    `class` | `AnnotationParser.MyAnnotationVisitor`
    `class` | `AnnotationParser.MyClassVisitor` MyClassVisitor ASM visitor for a class.
    `class` | `AnnotationParser.SimpleValue`
    `class` | `AnnotationParser.Value`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Map<String,List<AnnotationParser.DiscoverableAnnotationHandler>>` | `_annotationHandlers`
    `protected List<AnnotationParser.ClassHandler>` | `_classHandlers`
    `protected List<AnnotationParser.FieldHandler>` | `_fieldHandlers`
    `protected List<AnnotationParser.MethodHandler>` | `_methodHandlers`
    `protected Set<String>` | `_parsedClassNames`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AnnotationParser()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<AnnotationParser.DiscoverableAnnotationHandler>` | `getAnnotationHandlers()`
    `List<AnnotationParser.DiscoverableAnnotationHandler>` | `getAnnotationHandlers(String annotationName)`
    `boolean` | `isParsed(String className)`
    `static String` | `normalize(String name)`
    `void` | `parse(Class clazz, ClassNameResolver resolver, boolean visitSuperClasses)`
    `void` | `parse(ClassLoader loader, boolean visitParents, boolean nullInclusive, ClassNameResolver resolver)` Find annotations on classes in the supplied classloader.
    `void` | `parse(List<String> classNames, ClassNameResolver resolver)`
    `void` | `parse(Resource dir, ClassNameResolver resolver)`
    `void` | `parse(String[] classNames, ClassNameResolver resolver)`
    `void` | `parse(String className, ClassNameResolver resolver)`
    `void` | `parse(URI[] uris, ClassNameResolver resolver)` Find annotations in classes in the supplied url of jar files.
    `void` | `parse(URI uri, ClassNameResolver resolver)` Parse a single jar file for classes.
    `void` | `registerAnnotationHandler(String annotationName, AnnotationParser.DiscoverableAnnotationHandler handler)` Register a handler that will be called back when the named annotation is encountered on a class.
    `void` | `registerClassHandler(AnnotationParser.ClassHandler handler)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### _parsedClassNames

          protected Set<String> _parsedClassNames

    - #### _annotationHandlers

          protected Map<String,List<AnnotationParser.DiscoverableAnnotationHandler>> _annotationHandlers

    - #### _classHandlers

          protected List<AnnotationParser.ClassHandler> _classHandlers

    - #### _methodHandlers

          protected List<AnnotationParser.MethodHandler> _methodHandlers

    - #### _fieldHandlers

          protected List<AnnotationParser.FieldHandler> _fieldHandlers

  - ### Constructor Detail

    - #### AnnotationParser

          public AnnotationParser()

  - ### Method Detail

    - #### normalize

          public static String normalize(String name)

    - #### registerAnnotationHandler

          public void registerAnnotationHandler(String annotationName,
                                       AnnotationParser.DiscoverableAnnotationHandler handler)

      Register a handler that will be called back when the named annotation is encountered on a class.
      Parameters:
        `annotationName` -
        `handler` -

    - #### getAnnotationHandlers

          public List<AnnotationParser.DiscoverableAnnotationHandler> getAnnotationHandlers(String annotationName)

    - #### getAnnotationHandlers

          public List<AnnotationParser.DiscoverableAnnotationHandler> getAnnotationHandlers()

    - #### registerClassHandler

          public void registerClassHandler(AnnotationParser.ClassHandler handler)

    - #### isParsed

          public boolean isParsed(String className)

    - #### parse

          public void parse(String className,
                   ClassNameResolver resolver)
                     throws Exception

      Throws:
        `Exception`

    - #### parse

          public void parse(Class clazz,
                   ClassNameResolver resolver,
                   boolean visitSuperClasses)
                     throws Exception

      Throws:
        `Exception`

    - #### parse

          public void parse(String[] classNames,
                   ClassNameResolver resolver)
                     throws Exception

      Throws:
        `Exception`

    - #### parse

          public void parse(List<String> classNames,
                   ClassNameResolver resolver)
                     throws Exception

      Throws:
        `Exception`

    - #### parse

          public void parse(Resource dir,
                   ClassNameResolver resolver)
                     throws Exception

      Throws:
        `Exception`

    - #### parse

          public void parse(ClassLoader loader,
                   boolean visitParents,
                   boolean nullInclusive,
                   ClassNameResolver resolver)
                     throws Exception

      Find annotations on classes in the supplied classloader. Only class files in jar files will be scanned.
      Parameters:
        `loader` -
        `visitParents` -
        `nullInclusive` -
        `resolver` -
      Throws:
        `Exception`

    - #### parse

          public void parse(URI[] uris,
                   ClassNameResolver resolver)
                     throws Exception

      Find annotations in classes in the supplied url of jar files.
      Parameters:
        `uris` -
        `resolver` -
      Throws:
        `Exception`

    - #### parse

          public void parse(URI uri,
                   ClassNameResolver resolver)
                     throws Exception

      Parse a single jar file for classes.
      Parameters:
        `uri` -
        `resolver` -
      Throws:
        `Exception`

Copyright © 1995-2016 Mort Bay Consulting. All Rights Reserved.