public abstract class KlassNavigator<C> extends Object
Implementations should be stateless and typically a singleton.
Modifier and Type | Field and Description |
---|---|
static KlassNavigator<Class> |
JAVA |
Constructor and Description |
---|
KlassNavigator() |
Modifier and Type | Method and Description |
---|---|
abstract Iterable<Klass<?>> |
getAncestors(C clazz)
Lists up all the ancestor classes, from specific to general, without any duplicate.
|
abstract List<MethodRef> |
getDeclaredMethods(C clazz)
List methods of this class, regardless of access modifier.
|
abstract URL |
getResource(C clazz,
String resourceName)
Loads the resources associated with this class.
|
abstract Klass<?> |
getSuperClass(C clazz)
Gets the super class.
|
abstract Class |
toJavaClass(C clazz)
For backward compatibility, map the given class to the closest Java equivalent.
|
public static final KlassNavigator<Class> JAVA
public abstract URL getResource(C clazz, String resourceName)
In stapler, the convention is that the "associated" resources live in the directory named after
the fully qualified class name (as opposed to the behavior of Class.getResource(String)
,
that looks for resources in the same package as the class.)
But other languages can choose their own conventions if it makes more sense to do so. For example, stapler-jruby uses camelized class name.
Implementation must consult MetaClassLoader.debugLoader
if it's available. Implementation
must not look for resources in the base type. That operation is performed by the caller when
needed.
public abstract Iterable<Klass<?>> getAncestors(C clazz)
public abstract Klass<?> getSuperClass(C clazz)
public abstract Class toJavaClass(C clazz)
Copyright © 2016. All rights reserved.