com.townleyenterprises.command
Class RequiredOptionConstraint

java.lang.Object
  extended bycom.townleyenterprises.command.OptionConstraint
      extended bycom.townleyenterprises.command.RequiredOptionConstraint

public class RequiredOptionConstraint
extends OptionConstraint

This class provides an implementation of a constraint which requires the specific option to be matched.

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

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

Constructor Detail

RequiredOptionConstraint

public RequiredOptionConstraint(int status,
                                CommandOption opt)
The constructor initializes the option being constrained and an exit status.

Parameters:
status - the status code
opt - the option being constrained

RequiredOptionConstraint

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

Parameters:
status - the status code
opt - the option being constrained
Method Detail

getMessage

public java.lang.String getMessage()
Overrides:
getMessage in class OptionConstraint

isOK

public boolean isOK()
Description copied from class: OptionConstraint
This method should be implemented by derived classes to perform the constraint check.

Specified by:
isOK in class OptionConstraint
Returns:
true if the constraint is valid; false otherwise


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