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
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAbstracts away how to retrieve attribute value from a 'target' Jenkins object.static interfaceAbstracts away how to assign a value to a 'target' Jenkins object. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancalculateIfSecret(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 JSONSchemaGenerationbooleanbooleangetName()Class<? extends org.kohsuke.accmod.AccessRestriction>[]getter(Attribute.Getter<Owner, Type> getter) getType()inthashCode()booleanbooleanAttribute is actually a Collection of documented typebooleanbooleanChecks 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.voidsetJsonSchema(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) voidtoString()
-
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-trueto 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:
trueif 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.nullif unknownfieldName- Field name- Returns:
trueif the attribute is secretfalseif not or if there is no conclusive answer.
-
equals
-
hashCode
public int hashCode() -
noop
-