com.townleyenterprises.command
Class OptionConstraint

java.lang.Object
  extended bycom.townleyenterprises.command.OptionConstraint
Direct Known Subclasses:
MutexOptionConstraint, RequiredOptionConstraint, RequiresAnyOptionConstraint

public abstract class OptionConstraint
extends java.lang.Object

This is the base class for all option constraints.

Since:
3.0
Version:
$Id: OptionConstraint.java,v 1.1 2004/07/30 16:20:22 atownley Exp $
Author:
Andrew S. Townley

Constructor Summary
protected OptionConstraint(int status, CommandOption option, java.lang.String msg)
          The constructor initializes the option being constrained, an exit status and message to be used during failure.
 
Method Summary
 int getExitStatus()
           
 java.lang.String getMessage()
           
 CommandOption getOption()
           
abstract  boolean isOK()
          This method should be implemented by derived classes to perform the constraint check.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OptionConstraint

protected OptionConstraint(int status,
                           CommandOption option,
                           java.lang.String msg)
The constructor initializes the option being constrained, an exit status and message to be used during failure.

Parameters:
status - the status code
msg - the message to report
Method Detail

getExitStatus

public int getExitStatus()

getOption

public CommandOption getOption()

isOK

public abstract boolean isOK()
This method should be implemented by derived classes to perform the constraint check.

Returns:
true if the constraint is valid; false otherwise

getMessage

public java.lang.String getMessage()


Copyright © 2002-2004, Andrew S. Townley and Townley Enterprises. All Rights Reserved.
This project is hosted on http://te-code.sourceforge.net.