Class DescribableHelper
- java.lang.Object
-
- org.jenkinsci.plugins.workflow.structs.DescribableHelper
-
public class DescribableHelper extends Object
Deprecated.Moved to the structs plugin. SeeDescribableModel
Utility for converting betweenDescribable
s (and some other objects) and map-like representations. Ultimately should live in Jenkins core (or Stapler).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DescribableHelper.ArrayType
Deprecated.static class
DescribableHelper.AtomicType
Deprecated.static class
DescribableHelper.EnumType
Deprecated.static class
DescribableHelper.ErrorType
Deprecated.static class
DescribableHelper.HeterogeneousObjectType
Deprecated.A parameter (or array element) which could take any of the indicated concrete object types.static class
DescribableHelper.HomogeneousObjectType
Deprecated.static class
DescribableHelper.ParameterType
Deprecated.A type of a parameter to a class.static class
DescribableHelper.Schema
Deprecated.Definition of how a particular class may be configured.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <T> T
instantiate(Class<? extends T> clazz, Map<String,?> arguments)
Deprecated.Creates an instance of a class viaDataBoundConstructor
andDataBoundSetter
.static DescribableHelper.Schema
schemaFor(Class<?> clazz)
Deprecated.Loads a definition of the structure of a class: what kind of data you might get back fromuninstantiate(java.lang.Object)
on an instance, or might want to pass toinstantiate(java.lang.Class<? extends T>, java.util.Map<java.lang.String, ?>)
.static Map<String,Object>
uninstantiate(Object o)
Deprecated.Computes arguments suitable to pass toinstantiate(java.lang.Class<? extends T>, java.util.Map<java.lang.String, ?>)
to reconstruct this object.
-
-
-
Field Detail
-
CLAZZ
public static final String CLAZZ
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
instantiate
public static <T> T instantiate(Class<? extends T> clazz, Map<String,?> arguments) throws Exception
Deprecated.Creates an instance of a class viaDataBoundConstructor
andDataBoundSetter
.The arguments may be primitives (as wrappers) or
String
s if that is their declared type.Character
s,Enum
s, andURL
s may be represented byString
s. Other object types may be passed in “raw” as well, but JSON-like structures are encouraged instead. Specifically aList
may be used to represent any list- or array-valued argument. AMap
withString
keys may be used to represent any class which is itself data-bound. In that case the special keyCLAZZ
is used to specify theClass.getName()
; or it may be omitted if the argument is declared to take a concrete type; orClass.getSimpleName()
may be used in case the argument type isDescribable
and only one subtype is registered (as aDescriptor
) with that simple name.- Throws:
Exception
-
uninstantiate
public static Map<String,Object> uninstantiate(Object o) throws UnsupportedOperationException
Deprecated.Computes arguments suitable to pass toinstantiate(java.lang.Class<? extends T>, java.util.Map<java.lang.String, ?>)
to reconstruct this object.- Parameters:
o
- a data-bound object- Returns:
- constructor and/or setter parameters
- Throws:
UnsupportedOperationException
- if the class does not follow the expected structure
-
schemaFor
public static DescribableHelper.Schema schemaFor(Class<?> clazz)
Deprecated.Loads a definition of the structure of a class: what kind of data you might get back fromuninstantiate(java.lang.Object)
on an instance, or might want to pass toinstantiate(java.lang.Class<? extends T>, java.util.Map<java.lang.String, ?>)
.
-
-