Class AbstractProjectReference.ProjectReferenceDescriptor
- java.lang.Object
-
- hudson.model.Descriptor<AbstractProjectReference>
-
- hudson.plugins.project_inheritance.projects.references.AbstractProjectReference.ProjectReferenceDescriptor
-
- Direct Known Subclasses:
SimpleParameterizedProjectReference.SimpleParameterizedReferenceDescriptor
,SimpleProjectReference.SimpleProjectReferenceDescriptor
- Enclosing class:
- AbstractProjectReference
public abstract static class AbstractProjectReference.ProjectReferenceDescriptor extends Descriptor<AbstractProjectReference>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
-
-
Field Summary
Fields Modifier and Type Field Description protected com.google.common.cache.Cache<String,IProjectReferenceFilter>
filters
-
Fields inherited from class hudson.model.Descriptor
clazz
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ProjectReferenceDescriptor()
Infers the type of the correspondingAbstractProjectReference.ProjectReferenceDescriptor
from the outer class.protected
ProjectReferenceDescriptor(Class<? extends AbstractProjectReference> klazz)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addReferenceFilter(String key, IProjectReferenceFilter filter)
FormValidation
doCheckName(String targetJob, String parents, InheritanceProject localJob)
Checks whether the "name" field is sensible.ListBoxModel
doFillNameItems(String targetJob, String filterKey)
String
getValuePage()
ListBoxModel
internalFillNameItems(String targetJob, IProjectReferenceFilter filter)
Internal listing of permissible references.boolean
projectIsCompatible(Project p)
-
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, calcAutoCompleteSettings, calcFillSettings, configure, configure, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getDisplayName, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
-
-
-
Field Detail
-
filters
protected final com.google.common.cache.Cache<String,IProjectReferenceFilter> filters
-
-
Constructor Detail
-
ProjectReferenceDescriptor
protected ProjectReferenceDescriptor(Class<? extends AbstractProjectReference> klazz)
-
ProjectReferenceDescriptor
protected ProjectReferenceDescriptor()
Infers the type of the correspondingAbstractProjectReference.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 theInheritableStringParameterReferenceDefinition
class, which can be added toParameterizedProjectReference
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 configurationfilter
- 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)
-
addReferenceFilter
public void addReferenceFilter(String key, IProjectReferenceFilter filter)
-
-