org.xnap.util.prefs
Class PortRangeValidator

java.lang.Object
  extended by org.xnap.util.prefs.PortRangeValidator
All Implemented Interfaces:
Validator

public class PortRangeValidator
extends java.lang.Object
implements Validator

A port range validator. Port ranges are used to specify on ore more tcp ports. The format is: [([:number:]*|[:number:]*-[:number:]*);]*


Field Summary
static PortRangeValidator DEFAULT
          The default validator that allows ranges between PortRange.MIN_PORT and PortRange.MAX_PORT.
 
Constructor Summary
PortRangeValidator()
           
PortRangeValidator(int min, int max)
           
 
Method Summary
 void check(int i)
          Checks if i is in range.
 void validate(java.lang.String value)
          Checks if value is a valid port range string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

public static final PortRangeValidator DEFAULT
The default validator that allows ranges between PortRange.MIN_PORT and PortRange.MAX_PORT.

Constructor Detail

PortRangeValidator

public PortRangeValidator(int min,
                          int max)

PortRangeValidator

public PortRangeValidator()
Method Detail

validate

public void validate(java.lang.String value)
Checks if value is a valid port range string.

Specified by:
validate in interface Validator
Throws:
java.lang.IllegalArgumentException - if string format is invalid

check

public void check(int i)
Checks if i is in range.

Throws:
java.lang.IllegalArgumentException - thrown if i is not in range


Copyright © 2001-2005 XNap Team. All Rights Reserved.