Class AbstractProjectReference.ProjectReferenceDescriptor

    • Constructor Detail

      • ProjectReferenceDescriptor

        protected ProjectReferenceDescriptor()
        Infers the type of the corresponding AbstractProjectReference.ProjectReferenceDescriptor from the outer class. This version works when you follow the common convention, where a descriptor is written as the static nested class of the describable class.
    • Method Detail

      • getValuePage

        public String getValuePage()
      • doCheckName

        public FormValidation doCheckName​(@QueryParameter
                                          String targetJob,
                                          @RelativePath("..") @QueryParameter
                                          String parents,
                                          @AncestorInPath
                                          InheritanceProject localJob)
        Checks whether the "name" field is sensible.

        Do note that the field is 'name', but the JSON/Form name is 'targetJob'. This is due to historical reasons, where the field was given the generic name, until this collided with the QueryParameter assignment in the InheritableStringParameterReferenceDefinition class, which can be added to ParameterizedProjectReference instances.

        This verification is only valid, if the APR is used in the context of the definition of parents. Since project reference can be used elsewhere, care has to be taken for this verification to return FormValidation.ok() in these cases, and/or ensure that a subclass descriptor overrides this method.

        Parameters:
        targetJob - the name of the job that is referenced.
        parents - a CSV list, containing all parents defined on the page.
        localJob - the job in which this reference is created
        Returns:
        a valid, non-null FormValidation instance
      • internalFillNameItems

        public ListBoxModel internalFillNameItems​(String targetJob,
                                                  IProjectReferenceFilter filter)
        Internal listing of permissible references.

        Public, instead of protected/private, because the Unittests make use of this one.

        Parameters:
        targetJob - the job under configuration
        filter - the filter of the list of jobs
        Returns:
        a list of names of compatible jobs. May be empty, but never null.
      • doFillNameItems

        public ListBoxModel doFillNameItems​(@QueryParameter
                                            String targetJob,
                                            @QueryParameter
                                            String filterKey)
      • projectIsCompatible

        public boolean projectIsCompatible​(Project p)