org.apache.commons.classscan.model
Interface MetaClass

All Superinterfaces:
HasName, MetaType
All Known Subinterfaces:
SpiMetaClass
All Known Implementing Classes:
BcelClass, PrimitiveClass

public interface MetaClass
extends HasName, MetaType

Metadata about a class or primitive type


Method Summary
 MetaAnnotation getAnnotation(String annotationName)
          Get metadata about a particular annotation on the corresponding Class.
 Set<? extends MetaAnnotation> getAnnotations()
          Get metadata about the annotations on the corresponding Class.
 MetaClassPathElement getClassLocation()
          Get the ClassLocation from which the corresponding class came.
 Set<? extends MetaField> getFields()
          Get metadata about the corresponding Class's methods and constructors.
 Set<? extends MetaClass> getInterfaces()
          Get metadata about the interfaces which the corresponding Class implements.
 Set<? extends MetaMethod> getMethods()
          Get metadata about the corresponding Class's methods and constructors.
 String getName()
          Get the canonical name of the corresponding Class.
 MetaClass getParent()
          Get metadata about the corresponding Class's parent
 boolean isAssignableFrom(MetaClass assignor)
          Is the associated Class assignable from the class associated with the given MetaClass.
 

Method Detail

getClassLocation

MetaClassPathElement getClassLocation()
Get the ClassLocation from which the corresponding class came. For primitive types, this will return null.


getName

String getName()
Get the canonical name of the corresponding Class. For primitive types, this will be the primitive type name. e.g. char

Specified by:
getName in interface HasName

getParent

MetaClass getParent()
Get metadata about the corresponding Class's parent

Returns:
The MetaClass, or null if the corresponding Class is a primitive type or Object.class

getInterfaces

Set<? extends MetaClass> getInterfaces()
Get metadata about the interfaces which the corresponding Class implements. No inherited interfaces will be in the set.

Returns:
A read-only set of the interface information

getAnnotations

Set<? extends MetaAnnotation> getAnnotations()
Get metadata about the annotations on the corresponding Class.

Returns:
A read-only set of the annotation information

getAnnotation

MetaAnnotation getAnnotation(String annotationName)
Get metadata about a particular annotation on the corresponding Class.

Parameters:
annotationName - The name of the annotation desired
Returns:
The annotation information, or null if not specified on the corresponding Class

getMethods

Set<? extends MetaMethod> getMethods()
Get metadata about the corresponding Class's methods and constructors. No inherited methods will be in the set.

Returns:
A read-only set of the method information

getFields

Set<? extends MetaField> getFields()
Get metadata about the corresponding Class's methods and constructors. No inherited fields will be in the set.

Returns:
A read-only set of the field information

isAssignableFrom

boolean isAssignableFrom(MetaClass assignor)
Is the associated Class assignable from the class associated with the given MetaClass.

Parameters:
assignor - The non-null MetaClass (associated with class or interface)
Returns:
true, if and only if instances represented by implementor can be assigned to instances represented by this MetaClass


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.