Package io.jenkins.plugins.casc
Class Attribute<Owner,Type>
java.lang.Object
io.jenkins.plugins.casc.Attribute<Owner,Type>
- Direct Known Subclasses:
DescribableAttribute
,MultivaluedAttribute
,PersistedListAttribute
One attribute of
Configurator
.- Author:
- Nicolas De Loof
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Abstracts away how to retrieve attribute value from a 'target' Jenkins object.static interface
Abstracts away how to assign a value to a 'target' Jenkins object. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
calculateIfSecret
(Class<?> targetClass, String fieldName) This is a method which tries to guess whether an attribute isSecret
.deprecated
(boolean deprecated) describe
(Owner instance, ConfigurationContext context) describeForSchema
(Owner instance, ConfigurationContext context) This function is for the JSONSchemaGenerationboolean
boolean
getName()
Class<? extends org.kohsuke.accmod.AccessRestriction>[]
getter
(Attribute.Getter<Owner, Type> getter) getType()
int
hashCode()
boolean
boolean
Attribute is actually a Collection of documented typeboolean
boolean
Checks whether an attribute is considered a secret one.multiple
(boolean multiple) static <T,
V> Attribute.Setter<T, V> noop()
If this attribute is constrained to a limited set of value, here they arepreferredName
(String preferredName) restrictions
(Class<? extends org.kohsuke.accmod.AccessRestriction>[] restrictions) secret
(boolean secret) Sets whether the attribute is secret.void
setJsonSchema
(boolean jsonSchema) Set jsonSchema is used to tell the describe function to call the describe structure so that it supports and returns a nested structuresetter
(Attribute.Setter<Owner, Type> setter) void
toString()
-
Field Details
-
name
-
type
-
multiple
protected boolean multiple -
preferredName
-
aliases
-
-
Constructor Details
-
Attribute
-
Attribute
-
-
Method Details
-
get
-
toString
-
getName
-
getType
-
isDeprecated
public boolean isDeprecated() -
getRestrictions
-
setJsonSchema
public void setJsonSchema(boolean jsonSchema) Set jsonSchema is used to tell the describe function to call the describe structure so that it supports and returns a nested structure -
isRestricted
public boolean isRestricted() -
isMultiple
public boolean isMultiple()Attribute is actually a Collection of documented type- Returns:
- boolean indicating if this attribute is a list of multiple items of documented type
-
multiple
-
preferredName
-
setter
-
alias
-
getter
-
secret
Sets whether the attribute is secret. If so, various outputs will be suppressed (exports, logging).- Parameters:
secret
-true
to make an attribute secret- Since:
- 1.25
-
deprecated
-
restrictions
-
getSetter
-
getGetter
-
getAliases
-
possibleValues
If this attribute is constrained to a limited set of value, here they are- Returns:
- A list of possible types
-
isSecret
Checks whether an attribute is considered a secret one.- Parameters:
target
- Target object. Ifnull
, only the attribute metadata is checked- Returns:
true
if the attribute is secret- Since:
- 1.25
-
setValue
- Throws:
Exception
-
getValue
- Throws:
Exception
-
describe
- Throws:
ConfiguratorException
-
describeForSchema
This function is for the JSONSchemaGeneration- Parameters:
instance
- Owner Instancecontext
- Context to be passed- Returns:
- CNode object describing the structure of the node
-
equals
- Throws:
Exception
-
calculateIfSecret
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static boolean calculateIfSecret(@CheckForNull Class<?> targetClass, @NonNull String fieldName) This is a method which tries to guess whether an attribute isSecret
.- Parameters:
targetClass
- Class of the target object.null
if unknownfieldName
- Field name- Returns:
true
if the attribute is secretfalse
if not or if there is no conclusive answer.
-
equals
-
hashCode
public int hashCode() -
noop
-