org.apache.myfaces.commons.validator
Class AbstractUrlValidator

java.lang.Object
  extended by org.apache.myfaces.commons.validator.ValidatorBase
      extended by org.apache.myfaces.commons.validator.AbstractUrlValidator
All Implemented Interfaces:
EventListener, javax.faces.component.StateHolder, javax.faces.validator.Validator

@JSFValidator(name="mcv:validateUrl",
              clazz="org.apache.myfaces.commons.validator.UrlValidator",
              tagClass="org.apache.myfaces.commons.validator.ValidateUrlTag",
              serialuidtag="6041422002721046221L")
public abstract class AbstractUrlValidator
extends ValidatorBase

A custom validator for url format, based upons Jakarta Commons.

Version:
$Revision: 1021618 $ $Date: 2010-10-11 23:08:53 -0500 (Mon, 11 Oct 2010) $
Author:
Fabian Frederick

Field Summary
static String URL_MESSAGE_ID
          The message identifier of the FacesMessage to be created if the maximum length check fails.
static String VALIDATOR_ID
          The standard converter id for this converter.
 
Fields inherited from interface javax.faces.validator.Validator
NOT_IN_RANGE_MESSAGE_ID
 
Constructor Summary
AbstractUrlValidator()
           
 
Method Summary
abstract  String getSchemes()
          CSV values that indicates the set of schemes to check this url.
abstract  boolean isAllow2Slashes()
          Allow two slashes in the path component of the URL.
abstract  boolean isAllowAllSchemas()
          Allows all validly formatted schemes to pass validation instead of supplying a set of valid schemes.
abstract  void setAllow2Slashes(boolean _allow2Slashes)
           
abstract  void setAllowAllSchemas(boolean _allowAllSchemas)
           
abstract  void setSchemes(String _schemes)
           
 void validate(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent, Object value)
          method that validates an url address.
 
Methods inherited from class org.apache.myfaces.commons.validator.ValidatorBase
getDetailMessage, getFacesContext, getFacesMessage, getMessage, getStringValue, getSummaryMessage, getValueBinding, isTransient, restoreAttachedState, restoreState, saveAttachedState, saveState, setDetailMessage, setMessage, setSummaryMessage, setTransient, setValueBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALIDATOR_ID

public static final String VALIDATOR_ID

The standard converter id for this converter.

See Also:
Constant Field Values

URL_MESSAGE_ID

public static final String URL_MESSAGE_ID

The message identifier of the FacesMessage to be created if the maximum length check fails.

See Also:
Constant Field Values
Constructor Detail

AbstractUrlValidator

public AbstractUrlValidator()
Method Detail

validate

public void validate(javax.faces.context.FacesContext facesContext,
                     javax.faces.component.UIComponent uiComponent,
                     Object value)
              throws javax.faces.validator.ValidatorException
method that validates an url address. it uses the commons-validator

Throws:
javax.faces.validator.ValidatorException

setSchemes

public abstract void setSchemes(String _schemes)

getSchemes

@JSFProperty
public abstract String getSchemes()
CSV values that indicates the set of schemes to check this url. If allowAllSchemas = true, the values of this field are ignored. If no schemes are provided, default to this set ("http", "https", "ftp").


setAllow2Slashes

public abstract void setAllow2Slashes(boolean _allow2Slashes)

isAllow2Slashes

@JSFProperty(defaultValue="false")
public abstract boolean isAllow2Slashes()
Allow two slashes in the path component of the URL.


setAllowAllSchemas

public abstract void setAllowAllSchemas(boolean _allowAllSchemas)

isAllowAllSchemas

@JSFProperty(defaultValue="false")
public abstract boolean isAllowAllSchemas()
Allows all validly formatted schemes to pass validation instead of supplying a set of valid schemes.



Copyright © 2007-2011 The Apache Software Foundation. All Rights Reserved.