Top Description Inners Methods
jakarta.enterprise.inject

public @Interface Typed

extends Annotation
Known Direct Implementers
jakarta.enterprise.inject.Typed.Literal
Annotations
@Target:FIELD, METHOD, TYPE
@Retention:RUNTIME
@Documented
Static Imports
java.lang.annotation.ElementType.FIELD, .ElementType.METHOD, .ElementType.TYPE, .RetentionPolicy.RUNTIME

Restricts the bean types of a bean. May be applied to a bean class or producer method or field.

@Typed(Shop.class)
public class BookShop
      extends Business
      implements Shop<Book> {
   ...
}

When a @Typed annotation is specified, only the types whose classes are explicitly listed using the value member, along with java.lang.Object, are bean types of the bean.

Authors
Pete Muir, Gavin King

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Typed.Literal

Supports inline instantiation of the Typed annotation.

Method Summary

Modifier and TypeMethod and Description
public Class<?>[]

Returns:

the classes corresponding to the bean types of the bean
value
()

Selects the bean types of the bean.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

valueback to summary
public Class<?>[] value()

Selects the bean types of the bean. Every class must correspond to a type in the unrestricted set of bean types of a bean.

Returns:Class<?>[]

the classes corresponding to the bean types of the bean

jakarta.enterprise.inject back to summary

public final Class Typed.Literal

extends AnnotationLiteral<Typed>
implements Typed
Class Inheritance
All Implemented Interfaces
jakarta.enterprise.inject.Typed, java.lang.annotation.Annotation

Supports inline instantiation of the Typed annotation.
Author
Martin Kouba
Since
2.0

Field Summary

Modifier and TypeField and Description
public static final Typed.Literal
INSTANCE

Default Typed literal

private static final long
private final Class<?>[]
value

The classes corresponding to the bean types of the bean

Constructor Summary

AccessConstructor and Description
private
Literal(Class<?>[] value)

Method Summary

Modifier and TypeMethod and Description
public static Typed.Literal

Returns:

a new Literal value for the provided classes
of
(Class<?>[]
the classes corresponding to the bean types of the bean
value
)

Obtain the Typed literal for the provided bean types

public Class<?>[]

Returns:

the classes corresponding to the bean types of the bean
value
()

Implements jakarta.enterprise.inject.Typed.value.

Selects the bean types of the bean.

Inherited from jakarta.enterprise.util.AnnotationLiteral:
annotationTypeequalshashCodetoString

Field Detail

INSTANCEback to summary
public static final Typed.Literal INSTANCE

Default Typed literal

serialVersionUIDback to summary
private static final long serialVersionUID

Hides jakarta.enterprise.util.AnnotationLiteral.serialVersionUID.

valueback to summary
private final Class<?>[] value

The classes corresponding to the bean types of the bean

Constructor Detail

Literalback to summary
private Literal(Class<?>[] value)

Method Detail

ofback to summary
public static Typed.Literal of(Class<?>[] value)

Obtain the Typed literal for the provided bean types

Parameters
value:Class<?>[]

the classes corresponding to the bean types of the bean

Returns:Typed.Literal

a new Literal value for the provided classes

valueback to summary
public Class<?>[] value()

Implements jakarta.enterprise.inject.Typed.value.

Doc from jakarta.enterprise.inject.Typed.value.

Selects the bean types of the bean. Every class must correspond to a type in the unrestricted set of bean types of a bean.

Returns:Class<?>[]

the classes corresponding to the bean types of the bean