Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * JBoss, Home of Professional Open Source
  * Copyright 2010, Red Hat, Inc., and individual contributors
  * by the @authors tag. See the copyright.txt in the distribution for a
  * full listing of individual contributors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,  
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package javax.enterprise.inject.spi;

Represents a Java program element that can be annotated.

Author(s):
Gavin King
Pete Muir
Clint Popetz
See also:
java.lang.reflect.AnnotatedElement
public interface Annotated {

    

Get the type of the annotated program element.

Returns:
the type of the annotated program element
    public Type getBaseType();

    

Get all types to which the base type should be considered assignable.

Returns:
a set of all types to which the base type should be considered assignable
    public Set<TypegetTypeClosure();

    

Get program element annotation of a certain annotation type.

Parameters:
<T> the type of the annotation
annotationType the class of the annotation type
Returns:
the program element annotation of the given annotation type, or a null value
    public <T extends Annotation> T getAnnotation(Class<T> annotationType);

    

Get all annotations of the program element.

Returns:
all annotations of the program element, or an empty set if no annotations are present
    public Set<AnnotationgetAnnotations();

    

Determine if the program element has an annotation of a certain annotation type.

Parameters:
annotationType the annotation type to check for
Returns:
true if the program element has an annotation of the given annotation type, or false otherwise
    public boolean isAnnotationPresent(Class<? extends AnnotationannotationType);
New to GrepCode? Check out our FAQ X