Class UninstantiatedDescribable
java.lang.Object
org.jenkinsci.plugins.structs.describable.UninstantiatedDescribable
- All Implemented Interfaces:
Serializable
A reflection-like view of a particular
Describable
instance.- Author:
- Kohsuke Kawaguchi
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
As a short-hand, if aDescribableModel
has only one required parameter,instantiate(Class)
accepts a single-item map whose key is this magic token. -
Constructor Summary
ConstructorsConstructorDescriptionUninstantiatedDescribable
(String symbol, String klass, Map<String, ?> arguments) UninstantiatedDescribable
(Map<String, ?> arguments) -
Method Summary
Modifier and TypeMethodDescriptionboolean
static UninstantiatedDescribable
All the nested arguments to this object.getKlass()
"$class" is an alternative means to specify the class in case there's no symbol.getModel()
Returns the model associated with this object.If this nested describable has a suitable symbol name, this method returns one.int
hashCode()
boolean
Returns true if and only if the arguments is one and that is the only required parameter from the model.Deprecated.instantiate
(TaskListener listener) Instantiates an actualDescribable
through the model, unlessklass
orsymbol
will be set to specify a specific type, in which case that takes a precedence.<T> T
instantiate
(Class<T> base) Deprecated.instead useinstantiate(Class, TaskListener)
<T> T
instantiate
(Class<T> base, TaskListener listener) Instantiates an actualDescribable
object from the specified arguments.void
void
setModel
(DescribableModel model) void
toMap()
For legacy use, we need to blow up this into a map form.Converts thisUninstantiatedDescribable
to a literal map expression without recursively doing so for children.toString()
Debug assistance.withArguments
(Map<String, ?> arguments) Makes a copy of this struct with an alternate argument map.
-
Field Details
-
ANONYMOUS_KEY
As a short-hand, if aDescribableModel
has only one required parameter,instantiate(Class)
accepts a single-item map whose key is this magic token.To avoid clients from needing to special-case this key,
from(Object)
does not producearguments
that contains this magic token. Clients who want to take advantages of this should look atDescribableModel.hasSingleRequiredParameter()
- See Also:
-
-
Constructor Details
-
UninstantiatedDescribable
-
UninstantiatedDescribable
-
-
Method Details
-
withArguments
Makes a copy of this struct with an alternate argument map.- Parameters:
arguments
- a replacement forgetArguments()
- Returns:
- a new object with the same
getSymbol()
,getKlass()
, andgetModel()
-
getSymbol
If this nested describable has a suitable symbol name, this method returns one.Either this or
getKlass()
has to return a non-null value. -
setSymbol
-
getKlass
"$class" is an alternative means to specify the class in case there's no symbol. Can be a short name if it's contextually unambiguous, or a FQCN.Either this or
getSymbol()
has to return a non-null value. -
setKlass
-
getModel
Returns the model associated with this object. If this object was created from a model (viafrom(Object)
) this method returns that model. -
setModel
-
getArguments
All the nested arguments to this object. -
hasSoleRequiredArgument
public boolean hasSoleRequiredArgument()Returns true if and only if the arguments is one and that is the only required parameter from the model.This usually signals a short-hand syntax to write down the instantiation syntax.
-
toMap
For legacy use, we need to blow up this into a map form. This requires recursively blowing up any nestedUninstantiatedDescribable
s. -
toShallowMap
Converts thisUninstantiatedDescribable
to a literal map expression without recursively doing so for children. -
instantiate
Deprecated.instead useinstantiate(TaskListener)
- Throws:
Exception
-
instantiate
Instantiates an actualDescribable
through the model, unlessklass
orsymbol
will be set to specify a specific type, in which case that takes a precedence.- Parameters:
listener
- Listener to record any instantiation warnings- Returns:
- The instantiated object
- Throws:
Exception
-
instantiate
Deprecated.instead useinstantiate(Class, TaskListener)
- Throws:
Exception
-
instantiate
Instantiates an actualDescribable
object from the specified arguments.- Parameters:
base
- The expected type of the instance. The interpretation of the symbol and $class depends on this parameter.listener
- Listener to record any instantiation warnings- Returns:
- The instantiated object
- Throws:
Exception
-
from
-
equals
-
hashCode
public int hashCode() -
toString
Debug assistance. The output might change.
-
instantiate(TaskListener)