com.izforge.izpack.installer
Class CompileResult

java.lang.Object
  extended by com.izforge.izpack.installer.CompileResult

public class CompileResult
extends java.lang.Object

This class describes the result of the compilation. This class is here because error handling is not straight-forward with regard to compilation. The error condition consists of an error message, the full command line which failed to execute plus it's stdout and stderr. The reason for this class to exist is that there are three possible reactions to the error (chosen by the user).

  1. abort
  2. ignore (continue anyway)
  3. reconfigure

Author:
Tino Schwarze

Field Summary
private  int action
           
static int ACTION_ABORT
           
static int ACTION_CONTINUE
           
static int ACTION_RECONFIGURE
           
private  java.lang.String[] cmdline
          the command line
static int FAILED
           
private  java.lang.String message
          the error message
private  int status
           
private  java.lang.String stderr
          the stderr of the command
private  java.lang.String stdout
          the stdout of the command
static int SUCCESS
           
 
Constructor Summary
CompileResult()
          constructor, create a new successful result
CompileResult(java.lang.String message, java.lang.String[] cmdline, java.lang.String stdout, java.lang.String stderr)
          creates a new CompileResult with status FAILED
 
Method Summary
 int getAction()
           
 java.lang.String getCmdline()
          get command line of failed command as a string
 java.lang.String[] getCmdlineArray()
          get command line of failed command as an array of strings
 java.lang.String getMessage()
          return error message
 int getStatus()
           
 java.lang.String getStderr()
           
 java.lang.String getStdout()
           
 boolean isAbort()
          check whether to abort (convenience function)
 boolean isContinue()
          check whether to continue (convenience function)
 boolean isReconfigure()
          check whether to reconfigure (convenience function)
 boolean isSuccess()
          check for success (convenience function)
 void setAction(int action)
           
 void setStatus(int status)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUCCESS

public static final int SUCCESS
See Also:
Constant Field Values

FAILED

public static final int FAILED
See Also:
Constant Field Values

ACTION_ABORT

public static final int ACTION_ABORT
See Also:
Constant Field Values

ACTION_CONTINUE

public static final int ACTION_CONTINUE
See Also:
Constant Field Values

ACTION_RECONFIGURE

public static final int ACTION_RECONFIGURE
See Also:
Constant Field Values

status

private int status

action

private int action

message

private java.lang.String message
the error message


cmdline

private java.lang.String[] cmdline
the command line


stdout

private java.lang.String stdout
the stdout of the command


stderr

private java.lang.String stderr
the stderr of the command

Constructor Detail

CompileResult

public CompileResult()
constructor, create a new successful result


CompileResult

public CompileResult(java.lang.String message,
                     java.lang.String[] cmdline,
                     java.lang.String stdout,
                     java.lang.String stderr)
creates a new CompileResult with status FAILED

Parameters:
message - description of the exception
cmdline - full command line of failed command
stdout - standard output of failed command
stderr - standard error of failed command
Method Detail

setStatus

public void setStatus(int status)

getStatus

public int getStatus()

setAction

public void setAction(int action)

getAction

public int getAction()

isSuccess

public boolean isSuccess()
check for success (convenience function)


isAbort

public boolean isAbort()
check whether to abort (convenience function)


isContinue

public boolean isContinue()
check whether to continue (convenience function)

Returns:
true if status is SUCCESS or action is CONTINUE

isReconfigure

public boolean isReconfigure()
check whether to reconfigure (convenience function)


getMessage

public java.lang.String getMessage()
return error message

Returns:
the error message describing the action that failed (might be null)

getCmdline

public java.lang.String getCmdline()
get command line of failed command as a string

Returns:
command line of failed command

getCmdlineArray

public java.lang.String[] getCmdlineArray()
get command line of failed command as an array of strings

Returns:
command line of failed command

getStdout

public java.lang.String getStdout()

getStderr

public java.lang.String getStderr()