org.eclipse.jetty.annotations

## Class AnnotationParser

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

-     public class AnnotationParser
      extends java.lang.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 java.util.Map<java.lang.String,java.util.List<AnnotationParser.DiscoverableAnnotationHandler>>` | `_annotationHandlers`
    `protected java.util.List<AnnotationParser.ClassHandler>` | `_classHandlers`
    `protected java.util.List<AnnotationParser.FieldHandler>` | `_fieldHandlers`
    `protected java.util.List<AnnotationParser.MethodHandler>` | `_methodHandlers`
    `protected java.util.List<java.lang.String>` | `_parsedClassNames`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AnnotationParser()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.List<AnnotationParser.DiscoverableAnnotationHandler>` | `getAnnotationHandlers()`
    `java.util.List<AnnotationParser.DiscoverableAnnotationHandler>` | `getAnnotationHandlers(java.lang.String annotationName)`
    `boolean` | `isParsed(java.lang.String className)`
    `static java.lang.String` | `normalize(java.lang.String name)`
    `void` | `parse(java.lang.Class clazz, ClassNameResolver resolver, boolean visitSuperClasses)`
    `void` | `parse(java.lang.ClassLoader loader, boolean visitParents, boolean nullInclusive, ClassNameResolver resolver)` Find annotations on classes in the supplied classloader.
    `void` | `parse(java.util.List<java.lang.String> classNames, ClassNameResolver resolver)`
    `void` | `parse(Resource dir, ClassNameResolver resolver)`
    `void` | `parse(java.lang.String[] classNames, ClassNameResolver resolver)`
    `void` | `parse(java.lang.String className, ClassNameResolver resolver)`
    `void` | `parse(java.net.URI[] uris, ClassNameResolver resolver)` Find annotations in classes in the supplied url of jar files.
    `void` | `parse(java.net.URI uri, ClassNameResolver resolver)`
    `void` | `registerAnnotationHandler(java.lang.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 java.util.List<java.lang.String> _parsedClassNames

    - #### _annotationHandlers

          protected java.util.Map<java.lang.String,java.util.List<AnnotationParser.DiscoverableAnnotationHandler>> _annotationHandlers

    - #### _classHandlers

          protected java.util.List<AnnotationParser.ClassHandler> _classHandlers

    - #### _methodHandlers

          protected java.util.List<AnnotationParser.MethodHandler> _methodHandlers

    - #### _fieldHandlers

          protected java.util.List<AnnotationParser.FieldHandler> _fieldHandlers

  - ### Constructor Detail

    - #### AnnotationParser

          public AnnotationParser()

  - ### Method Detail

    - #### normalize

          public static java.lang.String normalize(java.lang.String name)

    - #### registerAnnotationHandler

          public void registerAnnotationHandler(java.lang.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 java.util.List<AnnotationParser.DiscoverableAnnotationHandler> getAnnotationHandlers(java.lang.String annotationName)

    - #### getAnnotationHandlers

          public java.util.List<AnnotationParser.DiscoverableAnnotationHandler> getAnnotationHandlers()

    - #### registerClassHandler

          public void registerClassHandler(AnnotationParser.ClassHandler handler)

    - #### isParsed

          public boolean isParsed(java.lang.String className)

    - #### parse

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

      Throws:
        `java.lang.Exception`

    - #### parse

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

      Throws:
        `java.lang.Exception`

    - #### parse

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

      Throws:
        `java.lang.Exception`

    - #### parse

          public void parse(java.util.List<java.lang.String> classNames,
                   ClassNameResolver resolver)
                     throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### parse

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

      Throws:
        `java.lang.Exception`

    - #### parse

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

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

    - #### parse

          public void parse(java.net.URI[] uris,
                   ClassNameResolver resolver)
                     throws java.lang.Exception

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

    - #### parse

          public void parse(java.net.URI uri,
                   ClassNameResolver resolver)
                     throws java.lang.Exception

      Throws:
        `java.lang.Exception`

Copyright © 2013 FuseSource, Corp.. All Rights Reserved.