hudson.plugins.covcomplplot.analyzer
Class AbstractMethodInfoHandler

java.lang.Object
  extended by hudson.plugins.covcomplplot.analyzer.AbstractMethodInfoHandler
Direct Known Subclasses:
CloverBranchCoverageMethodHandler, CloverMethodHandler, CoberturaMethodHandler

public abstract class AbstractMethodInfoHandler
extends Object

Abstract handler which is the superclass of Jenkins plugin handlers.

Author:
junoyoon@gmail.com

Constructor Summary
AbstractMethodInfoHandler()
           
 
Method Summary
abstract  void checkBuild(hudson.model.AbstractBuild<?,?> build)
          Check if passed AbstractBuild contains valid plugin result for this handler processing.
protected  void checkBuildContainningBuildAction(hudson.model.AbstractBuild<?,?> build, String buildActionName)
           
 org.dom4j.Document getBuildArtifact(hudson.model.AbstractBuild<?,?> build, String fileName, Analyzer forWhat)
          Get build xml artifact
 String getCustomJavaScript()
           
 hudson.model.Action getCustomSourceViewBuildAction(hudson.model.AbstractBuild<?,?> build)
           
abstract  String getDescription()
          Get the description of Jenkins plugin from which this handler get information
abstract  String getMethodUrlLocation(hudson.model.AbstractBuild<?,?> build, MethodInfo methodInfo)
          Get method content URL.
protected  boolean isGetterSetter(MethodInfo method)
          Check if the give method is valid
protected  boolean isMethodValid(MethodInfo method, boolean excludeGetterSetter)
          Check if the method is valid.
abstract  List<MethodInfo> process(hudson.model.AbstractBuild<?,?> build, boolean excludeGetterSetter, String rootDir, LoggerWrapper logger, Analyzer analyzer)
          Parse the plugin result and return the MethodInfo list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMethodInfoHandler

public AbstractMethodInfoHandler()
Method Detail

process

public abstract List<MethodInfo> process(hudson.model.AbstractBuild<?,?> build,
                                         boolean excludeGetterSetter,
                                         String rootDir,
                                         LoggerWrapper logger,
                                         Analyzer analyzer)
                                  throws InvalidHudsonProjectException
Parse the plugin result and return the MethodInfo list.

Parameters:
build - build info
excludeGetterSetter - whether getter/setter methods are included or not.
rootDir - base directory of build.
logger - logger to be used
analyzer - information which analyzer is used.
Returns:
MethodInfo list parsed.
Throws:
InvalidHudsonProjectException

getBuildArtifact

public org.dom4j.Document getBuildArtifact(hudson.model.AbstractBuild<?,?> build,
                                           String fileName,
                                           Analyzer forWhat)
                                    throws InvalidHudsonProjectException
Get build xml artifact

Parameters:
build - build
fileName - file to be retrieve
forWhat - analyzer enum to be used for logging.
Returns:
xml document
Throws:
InvalidHudsonProjectException

isMethodValid

protected boolean isMethodValid(MethodInfo method,
                                boolean excludeGetterSetter)
Check if the method is valid.

Parameters:
method - method to checked. if it's null, it's valid.
excludeGetterSetter - true if the getter/setter should be excluded.
Returns:
true if the method is valid

isGetterSetter

protected boolean isGetterSetter(MethodInfo method)
Check if the give method is valid

Parameters:
method - method to be checked
Returns:
true if given method is valid

getCustomJavaScript

public String getCustomJavaScript()

getMethodUrlLocation

public abstract String getMethodUrlLocation(hudson.model.AbstractBuild<?,?> build,
                                            MethodInfo methodInfo)
Get method content URL. Each handler should implements this method to get the appropriate URL for each method source code.

Parameters:
build - AbstractBuild instance against each methodInfo.
methodInfo - method.
Returns:
URL string from each Jenkins job URL base.

checkBuild

public abstract void checkBuild(hudson.model.AbstractBuild<?,?> build)
                         throws InvalidHudsonProjectException
Check if passed AbstractBuild contains valid plugin result for this handler processing. This method is invoked before the process method is called.

Parameters:
build -
Throws:
InvalidHudsonProjectException

getDescription

public abstract String getDescription()
Get the description of Jenkins plugin from which this handler get information

Returns:
description string

checkBuildContainningBuildAction

protected void checkBuildContainningBuildAction(hudson.model.AbstractBuild<?,?> build,
                                                String buildActionName)
                                         throws InvalidHudsonProjectException
Throws:
InvalidHudsonProjectException

getCustomSourceViewBuildAction

public hudson.model.Action getCustomSourceViewBuildAction(hudson.model.AbstractBuild<?,?> build)


Copyright © 2004-2011. All Rights Reserved.