Class Attribute<Owner,​Type>

    • Field Detail

      • name

        protected final String name
      • type

        protected final Class type
      • multiple

        protected boolean multiple
      • preferredName

        protected String preferredName
    • Method Detail

      • getName

        public String getName()
      • getType

        public Class getType()
      • isDeprecated

        public boolean isDeprecated()
      • getRestrictions

        public Class<? extends org.kohsuke.accmod.AccessRestriction>[] 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
      • secret

        public Attribute<Owner,​Type> secret​(boolean 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

        public Attribute deprecated​(boolean deprecated)
      • restrictions

        public Attribute restrictions​(Class<? extends org.kohsuke.accmod.AccessRestriction>[] restrictions)
      • possibleValues

        public List<String> possibleValues()
        If this attribute is constrained to a limited set of value, here they are
        Returns:
        A list of possible types
      • isSecret

        public boolean isSecret​(@CheckForNull
                                Owner target)
        Checks whether an attribute is considered a secret one.
        Parameters:
        target - Target object. If null, only the attribute metadata is checked
        Returns:
        true if the attribute is secret
        Since:
        1.25
      • describeForSchema

        public CNode describeForSchema​(Owner instance,
                                       ConfigurationContext context)
        This function is for the JSONSchemaGeneration
        Parameters:
        instance - Owner Instance
        context - Context to be passed
        Returns:
        CNode object describing the structure of the node
      • 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 is Secret.
        Parameters:
        targetClass - Class of the target object. null if unknown
        fieldName - Field name
        Returns:
        true if the attribute is secret false if not or if there is no conclusive answer.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object