Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD


Class COM.stevesoft.pat.Validator

java.lang.Object
  |
  +--COM.stevesoft.pat.Validator

public class Validator
extends java.lang.Object

This class makes it easy to create your own patterns and integrate them into Regex. For more detail, see the example file deriv2.java or deriv3.java.



Method Summary
Validator arg(java.lang.String s)
           
patInt maxChars()
          For optimization it is helpful, but not necessary, that you define the maximum number of characters this validator will allow to match.
patInt minChars()
          For optimization it is helpful, but not necessary, that you define the minimum number of characters this validator will allow to match.
int validate(java.lang.String src, int start, int end)
          This method does extra checking on a matched section of a String beginning at position start and ending at end.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait

 

Method Detail

validate

public int validate(java.lang.String src,
                    int start,
                    int end)
This method does extra checking on a matched section of a String beginning at position start and ending at end. The idea is that you can do extra checking with this that you don't know how to do with a standard Regex. If this method is successful, it returns the location of the end of this pattern element -- that may be the value end provided or some other value. A negative value signifies that a match failure. By default, this method just returns end and thus does nothing.
See Also:
COM.stevesoft.pat.Regex#define(java.lang.String,java.lang.String,COM.stevsoft.pat.Validator)

arg

public Validator arg(java.lang.String s)

minChars

public patInt minChars()
For optimization it is helpful, but not necessary, that you define the minimum number of characters this validator will allow to match. To do this return new patInt(number) where number is the smallest number of characters that can match.

maxChars

public patInt maxChars()
For optimization it is helpful, but not necessary, that you define the maximum number of characters this validator will allow to match. To do this either return new patInt(number), or new patInf() if an infinite number of characters may match.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD