it.eng.spago.validation.fieldvalidators
Class SpagoURLValidator

java.lang.Object
  extended byit.eng.spago.validation.fieldvalidators.AbstractFieldValidator
      extended byit.eng.spago.validation.fieldvalidators.UrlValidator
          extended byit.eng.spago.validation.fieldvalidators.SpagoURLValidator
All Implemented Interfaces:
FieldValidatorIFace

public class SpagoURLValidator
extends UrlValidator

N.B. This class contains code from Jakarta Commons Validator It'is implemented as a subclass of URLValidator to solve the bugs described in http://issues.apache.org/bugzilla/attachment.cgi?id=14369 so in Spago Validator we can use SpagoURLValidator to validate URL It's a patched version of URLValidator on the commons-validation framework


Field Summary
static int ALLOW_2_SLASHES
          Allow two slashes in the path component of the URL.
static int ALLOW_ALL_SCHEMES
          Allows all validly formatted schemes to pass validation instead of supplying a set of valid schemes.
static int NO_FRAGMENTS
          Enabling this options disallows any URL fragments.
 
Fields inherited from class it.eng.spago.validation.fieldvalidators.UrlValidator
ERRORE_CAMPO_SITO
 
Fields inherited from class it.eng.spago.validation.fieldvalidators.AbstractFieldValidator
TYPED_SERVICE_REQUEST
 
Constructor Summary
SpagoURLValidator()
           
 
Method Summary
 boolean isValid(java.lang.String value)
          Controls if a String at imput is a valid URL.
protected  boolean isValidPath(java.lang.String path)
          Controls if the input string represents a valid path.
 
Methods inherited from class it.eng.spago.validation.fieldvalidators.UrlValidator
validateField
 
Methods inherited from class it.eng.spago.validation.fieldvalidators.AbstractFieldValidator
getConfig, init, saveTypedValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALLOW_ALL_SCHEMES

public static final int ALLOW_ALL_SCHEMES
Allows all validly formatted schemes to pass validation instead of supplying a set of valid schemes.

See Also:
Constant Field Values

ALLOW_2_SLASHES

public static final int ALLOW_2_SLASHES
Allow two slashes in the path component of the URL.

See Also:
Constant Field Values

NO_FRAGMENTS

public static final int NO_FRAGMENTS
Enabling this options disallows any URL fragments.

See Also:
Constant Field Values
Constructor Detail

SpagoURLValidator

public SpagoURLValidator()
Method Detail

isValid

public boolean isValid(java.lang.String value)
Controls if a String at imput is a valid URL.

Parameters:
value - The input string
Returns:
True if the string is a valid URL, else false.

isValidPath

protected boolean isValidPath(java.lang.String path)
Controls if the input string represents a valid path.

Parameters:
path - The input string path
Returns:
True if the string represents a valid path, else false