|
Oracle Fusion Middleware Java API Reference for Oracle WebLogic Server 12c (12.1.3) Part Number E41849-02 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface JAnnotation
Represents a metadata that is associated with a particular JElement. Note that JAnnoations are JElements, which means that they themselves can have annotations, and can be treated as nodes in a JAM hierarchy.
Annotations can be simple or complex. Values of simple annotations can be retrieved via the various get...Value() methods. Complex attributes can be navigated via the getAnnotations() method which exposes nested attributes (which may in turn be either simple or complex.
Field Summary | |
---|---|
static String |
SINGLE_VALUE_NAME
|
Method Summary | |
---|---|
Object |
getAnnotationInstance()
If this JAnnotation corresponds to metadata that is stored in a JSR175 annotation (i.e. |
String |
getJavadocTagText()
If this JAnnotation represents a javadoc tag, returns the raw, untrimmed contents of the tag. |
String |
getSimpleName()
Returns a simple name of this abstraction. |
JAnnotationValue |
getValue(String named)
Returns a structure which provides untyped, "by-name" access to the value of the named annotation member. |
JAnnotationValue[] |
getValues()
Returns an array of this annotation's member values. |
Methods inherited from interface com.bea.util.jam.JElement |
---|
accept, getArtifact, getParent, getQualifiedName, getSourcePosition, isSourceAvailable, toString |
Field Detail |
---|
static final String SINGLE_VALUE_NAME
Method Detail |
---|
String getSimpleName()
JElement
Returns a simple name of this abstraction. The exact format of the name depends on the particular abstraction (see javadoc). Please refer to the JAM package documentation for more details on naming conventions.
getSimpleName
in interface JElement
JAnnotationValue[] getValues()
Returns an array of this annotation's member values.
JAnnotationValue getValue(String named)
Returns a structure which provides untyped, "by-name" access to the value of the named annotation member.
String getJavadocTagText()
If this JAnnotation represents a javadoc tag, returns the raw, untrimmed contents of the tag. Otherwise, returns null. You shouldn't use this method without a really good reason - you normally should call one of the getMember() methods to get at the tag contents. You can call getMember(SINGLE_MEMBER_NAME) to get a JAnnotationValue representing the contents of a simple javadoc tag (e.g. @mytag myvalue).
Object getAnnotationInstance()
If this JAnnotation corresponds to metadata that is stored in a JSR175 annotation (i.e. an instance of java.lang.annotation.Annotation), returns that annotation object. Returns null if the annotation does not exist or is otherwise unavailable.
Note that this is done only on a best-effort basis - the annotation object not be availble under pre-1.5 JREs and will generally only be available if the underlying annotation was view from a class file. Note that the retention policy of the annotation type usually must also be RUNTIME.
If this method does return something other than null, it is guaranteed
to be an instance of java.lang.annotation.Annotation
. It
is typed here as Object
simply to preserve API compatibility
with Java 1.4.
|
Copyright 1996, 2014, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Oracle Fusion Middleware Java API Reference for Oracle WebLogic Server 12c (12.1.3) Part Number E41849-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |