Java Annotation Indexer 1.0.0.Final

org.jboss.jandex
Class ClassInfo

java.lang.Object
  extended by org.jboss.jandex.ClassInfo
All Implemented Interfaces:
AnnotationTarget

public final class ClassInfo
extends Object
implements AnnotationTarget

Represents a class entry in an index. A ClassInfo is only a partial view of a Java class, it is not intended as a complete replacement for Java reflection. Only the methods and fields which are references by an annotation are stored.

Global information including the parent class, implemented interfaces, and access flags are also provided since this information is often necessary.

Note that a parent class and interface may exist outside of the scope of the index (e.g. classes in a different jar) so the references are stored as names instead of direct references. It is expected that multiple indexes may need to be queried to assemble a full hierarchy in a complex multi-jar environment (e.g. an application server).

Thread-Safety

This class is immutable and can be shared between threads without safe publication.

Author:
Jason T. Greene

Method Summary
 Map<DotName,List<AnnotationInstance>> annotations()
           
static ClassInfo create(DotName name, DotName superName, short flags, DotName[] interfaces, Map<DotName,List<AnnotationInstance>> annotations)
          Constructs a "mock" ClassInfo using the passed values.
 short flags()
           
 DotName[] interfaces()
           
 DotName name()
           
 DotName superName()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

create

public static final ClassInfo create(DotName name,
                                     DotName superName,
                                     short flags,
                                     DotName[] interfaces,
                                     Map<DotName,List<AnnotationInstance>> annotations)
Constructs a "mock" ClassInfo using the passed values. All passed values MUST NOT BE MODIFIED AFTER THIS CALL. Otherwise the resulting object would not conform to the contract outlined above.

Parameters:
name - the name of this class
superName - the name of the parent class
flags - the class attributes
interfaces - the interfaces this class implements
annotations - the annotations on this class
Returns:
a new mock class representation

toString

public String toString()
Overrides:
toString in class Object

name

public final DotName name()

flags

public final short flags()

superName

public final DotName superName()

interfaces

public final DotName[] interfaces()

annotations

public final Map<DotName,List<AnnotationInstance>> annotations()

Java Annotation Indexer 1.0.0.Final

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.