javax.enterprise.inject.spi

## Interface ProcessSyntheticAnnotatedType<X>

- Type Parameters:
    `X` - The class being annotated
  All Superinterfaces:
    ProcessAnnotatedType<X>

      public interface ProcessSyntheticAnnotatedType<X>
      extends ProcessAnnotatedType<X>

  The container fires an event of this type for each Java class or interface added by `BeforeBeanDiscovery.addAnnotatedType(AnnotatedType)`, `BeforeBeanDiscovery.addAnnotatedType(AnnotatedType, String)` or `AfterTypeDiscovery.addAnnotatedType(AnnotatedType, String)`

  Any observer of this event is permitted to wrap and/or replace the `AnnotatedType`. The container must use the final value of this property, after all observers have been called, to discover the types and read the annotations of the program elements.

  For example, the following observer decorates the `AnnotatedType` for every class that is added by `BeforeBeanDiscovery.addAnnotatedType(AnnotatedType)`.

       public <T> void decorateAnnotatedType(@Observes ProcessSyntheticAnnotatedType<T> pat) {
           pat.setAnnotatedType(decorate(pat.getAnnotatedType()));
       }

  If any observer method of a `ProcessSyntheticAnnotatedType` event throws an exception, the exception is treated as a definition error by the container.

  Since:
    1.1
  Author:
    David Allen, Pete Muir
  See Also:
    `AnnotatedType`, `ProcessAnnotatedType`

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Extension` | `getSource()` Get the extension instance which added the `AnnotatedType` for which this event is being fired.

    - ### Methods inherited from interface javax.enterprise.inject.spi.ProcessAnnotatedType

      `getAnnotatedType, setAnnotatedType, veto`

- - ### Method Detail

    - #### getSource

          Extension getSource()

      Get the extension instance which added the `AnnotatedType` for which this event is being fired.
      Returns:
        the extension instance
      Throws:
        `IllegalStateException` - if called outside of the observer method invocation

Copyright © 1996-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.