com.gridsystems.config.tools
Class PatternVerifier

java.lang.Object
  extended by javax.swing.InputVerifier
      extended by com.gridsystems.config.tools.TextVerifier
          extended by com.gridsystems.config.tools.PatternVerifier
Direct Known Subclasses:
MemSizeVerifier

public class PatternVerifier
extends TextVerifier

Performs a validation based on the pattern specified on construction.

The pattern follows the syntax specified in the Pattern documentation.

Version:
1.0
Author:
Rodrigo Ruiz Aguayo

Field Summary
protected  java.lang.String id
          Identifier of the error detected by this verifier.
static java.lang.String ID_ERROR
          Identifier for errors detected by this verifier.
 
Fields inherited from class com.gridsystems.config.tools.TextVerifier
support
 
Constructor Summary
PatternVerifier(ErrorSupport support, java.lang.String id, java.util.regex.Pattern pattern)
          Creates a new instance with the specified pattern.
PatternVerifier(ErrorSupport support, java.lang.String id, java.lang.String pattern)
          Creates a new instance with the specified pattern string and default flags.
PatternVerifier(ErrorSupport support, java.lang.String id, java.lang.String pattern, int flags)
          Creates an instance.
 
Method Summary
 void cleanErrors()
          Removes from the error support manager the list of errors of this verifier.
 boolean verify(java.lang.String text)
          Validates a text string.
 
Methods inherited from class com.gridsystems.config.tools.TextVerifier
updateError, verify
 
Methods inherited from class javax.swing.InputVerifier
shouldYieldFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID_ERROR

public static final java.lang.String ID_ERROR
Identifier for errors detected by this verifier.

See Also:
Constant Field Values

id

protected java.lang.String id
Identifier of the error detected by this verifier.

Constructor Detail

PatternVerifier

public PatternVerifier(ErrorSupport support,
                       java.lang.String id,
                       java.lang.String pattern)
Creates a new instance with the specified pattern string and default flags.

Parameters:
support - The ErrorSupport instance
id - The error id
pattern - The pattern string to use

PatternVerifier

public PatternVerifier(ErrorSupport support,
                       java.lang.String id,
                       java.lang.String pattern,
                       int flags)
Creates an instance.

Parameters:
support - The error support instance
id - The error id
pattern - The pattern string to use
flags - The flags for pattern compilation

PatternVerifier

public PatternVerifier(ErrorSupport support,
                       java.lang.String id,
                       java.util.regex.Pattern pattern)
Creates a new instance with the specified pattern.

Parameters:
support - The error support instance
id - The error id
pattern - The pattern to use
Method Detail

verify

public boolean verify(java.lang.String text)
Validates a text string.

Specified by:
verify in class TextVerifier
Parameters:
text - The string to validate
Returns:
true if the text is valid

cleanErrors

public void cleanErrors()
Description copied from class: TextVerifier
Removes from the error support manager the list of errors of this verifier.

This method will be used on field deactivation.

Specified by:
cleanErrors in class TextVerifier
See Also:
TextVerifier.cleanErrors()


Copyright © 2007-2008 Grid Systems, S.A.. All Rights Reserved.