public static < T extends Publisher > T getPublisher ( AbstractProject < ? , ? > project , Class < T > type ) { // Search for a publisher of the given type in the project and return it if found: T publisher = new PublisherFindImpl < T > ( ) . find ( project , type ) ; if ( publisher != null ) { return publisher ; } // If not found, the publisher might be wrapped by a "Flexible Publish" publisher. The below searches for it inside the // Flexible Publisher: publisher = new PublisherFlexible < T > ( ) . find ( project , type ) ; return publisher ; }
Search for a publisher of the given type in a project and return it or null if it is not found .