Package org.kohsuke.stapler.lang
Class Klass<C>
java.lang.Object
org.kohsuke.stapler.lang.Klass<C>
- Type Parameters:
C
- Variable that represents the type ofClass
like object in this language.
Abstraction of class-like object, agnostic to languages.
To support other JVM languages that use their own specific types to represent a class
(such as JRuby and Jython), we now use this object instead of Class
. This allows
us to reuse much of the logic of class traversal/resource lookup across different languages.
But after the removal of JRuby support, in practice this is used only for Class
.
This is a convenient tuple so that we can pass around a single argument instead of two.
- Author:
- Kohsuke Kawaguchi
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
getArrayElement
(Object o, int index) Gets list of fields declared by the class.Gets all the public fields defined in this type, including super types.Reports all the methods that can be used for routing requests on this class.getMapElement
(Object o, String key) getResource
(String resourceName) Klass<?>
int
hashCode()
boolean
isArray()
boolean
isMap()
toString()
-
Field Details
-
clazz
-
-
Constructor Details
-
Method Details
-
getResource
-
getAncestors
-
getSuperClass
-
toJavaClass
-
getDeclaredMethods
- Since:
- 1.220
-
getDeclaredFields
Gets list of fields declared by the class.- Returns:
- List of fields.
May return empty list in the case of obsolete
navigator
, which does not offer the method. - Since:
- 1.246
-
getFields
Gets all the public fields defined in this type, including super types.- See Also:
-
getFunctions
Reports all the methods that can be used for routing requests on this class.- Returns:
- List of functions.
May return empty list in the case of obsolete
navigator
, which does not offer the method. - Since:
- 1.246
-
isArray
public boolean isArray() -
getArrayElement
- Throws:
IndexOutOfBoundsException
-
isMap
public boolean isMap() -
getMapElement
-
equals
-
hashCode
public int hashCode() -
toString
-
java
-