Class AbstractProjectReference
- java.lang.Object
-
- hudson.plugins.project_inheritance.projects.references.AbstractProjectReference
-
- All Implemented Interfaces:
Describable<AbstractProjectReference>
- Direct Known Subclasses:
SimpleProjectReference
@ExportedBean(defaultVisibility=3) public abstract class AbstractProjectReference extends Object implements Describable<AbstractProjectReference>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractProjectReference.ProjectReferenceDescriptor
-
Constructor Summary
Constructors Constructor Description AbstractProjectReference(String targetJob)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DescriptorExtensionList<AbstractProjectReference,AbstractProjectReference.ProjectReferenceDescriptor>
all()
static DescriptorExtensionList<AbstractProjectReference,AbstractProjectReference.ProjectReferenceDescriptor>
all(Class<AbstractProjectReference> clazz)
static List<AbstractProjectReference.ProjectReferenceDescriptor>
all(String classNameExp)
AbstractProjectReference.ProjectReferenceDescriptor
getDescriptor()
static AbstractProjectReference.ProjectReferenceDescriptor
getDescriptor(Class<? extends AbstractProjectReference> clazz)
String
getName()
InheritanceProject
getProject()
Returns the project associated with this reference.static void
onJenkinsStop()
This method makes sure the name lookup does not survive Jenkins tear-down in-between Unittests or Jenkins soft-restarts.void
switchProject(InheritanceProject project)
void
switchProject(String name)
String
toString()
-
-
-
Field Detail
-
name
protected String name
-
-
Constructor Detail
-
AbstractProjectReference
public AbstractProjectReference(String targetJob)
-
-
Method Detail
-
onJenkinsStop
@Terminator(before=COMPLETED) public static void onJenkinsStop()
This method makes sure the name lookup does not survive Jenkins tear-down in-between Unittests or Jenkins soft-restarts.
-
getProject
public InheritanceProject getProject()
Returns the project associated with this reference. In contrast to the public fieldgetProject()
, this will try to make sure that the object is actually assigned.- Returns:
- the associated
InheritanceProject
, or null in case the name could not be resolved at this moment.
-
getName
public String getName()
-
switchProject
public void switchProject(InheritanceProject project)
-
switchProject
public void switchProject(String name)
-
all
public static DescriptorExtensionList<AbstractProjectReference,AbstractProjectReference.ProjectReferenceDescriptor> all()
- Returns:
- all the registered
ParameterDefinition
descriptors that construct classes derived from this abstract base class.
-
all
public static DescriptorExtensionList<AbstractProjectReference,AbstractProjectReference.ProjectReferenceDescriptor> all(Class<AbstractProjectReference> clazz)
- Parameters:
clazz
- the class to filter for- Returns:
- all the registered
ParameterDefinition
descriptors that construct classes derived from this abstract base class.
-
all
public static List<AbstractProjectReference.ProjectReferenceDescriptor> all(String classNameExp)
- Parameters:
classNameExp
- the regular expression for the class name- Returns:
- the same list as
all()
, with all those classes removed that do not match the given regular expression on the class name.
-
getDescriptor
public static AbstractProjectReference.ProjectReferenceDescriptor getDescriptor(Class<? extends AbstractProjectReference> clazz)
-
getDescriptor
public AbstractProjectReference.ProjectReferenceDescriptor getDescriptor()
- Specified by:
getDescriptor
in interfaceDescribable<AbstractProjectReference>
-
-