private String[] getSchemesList(){ if (getSchemes() == null) { return null; } String [] list = getSchemes().split(","); String [] resp = new String [list.length]; for (int i = 0; i < list.length; i++) { resp[i] = list[i].trim(); } return resp; }
public void restoreState(FacesContext facesContext, Object state) { Object[] values = (Object[])state; super.restoreState(facesContext,values[0]); _schemes = (java.lang.String) values[1]; _allow2Slashes = ((Boolean) values[2]).booleanValue(); _allow2SlashesSet = ((Boolean) values[3]).booleanValue(); _allowAllSchemas = ((Boolean) values[4]).booleanValue(); _allowAllSchemasSet = ((Boolean) values[5]).booleanValue(); } }
public Object saveState(FacesContext facesContext) { Object[] values = new Object[6]; values[0] = super.saveState(facesContext); values[1] = _schemes; values[2] = Boolean.valueOf(_allow2Slashes); values[3] = Boolean.valueOf(_allow2SlashesSet); values[4] = Boolean.valueOf(_allowAllSchemas); values[5] = Boolean.valueOf(_allowAllSchemasSet); return values; }
private org.apache.commons.validator.UrlValidator initValidator() { int options = 0; if (isAllow2Slashes()) { options = options | org.apache.commons.validator.UrlValidator.ALLOW_2_SLASHES; } if (isAllowAllSchemas()) { options = options | org.apache.commons.validator.UrlValidator.ALLOW_ALL_SCHEMES; } String [] schemesList = getSchemesList(); org.apache.commons.validator.UrlValidator urlValidator = null; if (schemesList == null){ urlValidator = new org.apache.commons.validator.UrlValidator(options); } else { urlValidator = new org.apache.commons.validator.UrlValidator(schemesList,options); } return urlValidator; }
/** * method that validates an url address. * it uses the commons-validator */ public void validate( FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException { if (facesContext == null) throw new NullPointerException("facesContext"); if (uiComponent == null) throw new NullPointerException("uiComponent"); if (value == null) { return; } org.apache.commons.validator.UrlValidator urlValidator = initValidator(); if (!urlValidator.isValid(value.toString())) { Object[] args = {value.toString()}; throw new ValidatorException(getFacesMessage(URL_MESSAGE_ID, args)); } }
private org.apache.commons.validator.UrlValidator initValidator() { int options = 0; if (isAllow2Slashes()) { options = options | org.apache.commons.validator.UrlValidator.ALLOW_2_SLASHES; } if (isAllowAllSchemas()) { options = options | org.apache.commons.validator.UrlValidator.ALLOW_ALL_SCHEMES; } String [] schemesList = getSchemesList(); org.apache.commons.validator.UrlValidator urlValidator = null; if (schemesList == null){ urlValidator = new org.apache.commons.validator.UrlValidator(options); } else { urlValidator = new org.apache.commons.validator.UrlValidator(schemesList,options); } return urlValidator; }
/** * method that validates an url address. * it uses the commons-validator */ public void validate( FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException { if (facesContext == null) throw new NullPointerException("facesContext"); if (uiComponent == null) throw new NullPointerException("uiComponent"); if (value == null) { return; } org.apache.commons.validator.UrlValidator urlValidator = initValidator(); if (!urlValidator.isValid(value.toString())) { Object[] args = {value.toString()}; throw new ValidatorException(getFacesMessage(URL_MESSAGE_ID, args)); } }
private org.apache.commons.validator.UrlValidator initValidator() { int options = 0; if (isAllow2Slashes()) { options = options | org.apache.commons.validator.UrlValidator.ALLOW_2_SLASHES; } if (isAllowAllSchemas()) { options = options | org.apache.commons.validator.UrlValidator.ALLOW_ALL_SCHEMES; } String [] schemesList = getSchemesList(); org.apache.commons.validator.UrlValidator urlValidator = null; if (schemesList == null) { urlValidator = new org.apache.commons.validator.UrlValidator(options); } else { urlValidator = new org.apache.commons.validator.UrlValidator(schemesList,options); } return urlValidator; }
org.apache.commons.validator.UrlValidator urlValidator = initValidator(); throw new ValidatorException(getFacesMessage(URL_MESSAGE_ID, args));
private String[] getSchemesList(){ if (getSchemes() == null) { return null; } String [] list = getSchemes().split(","); String [] resp = new String [list.length]; for (int i = 0; i < list.length; i++) { resp[i] = list[i].trim(); } return resp; }
public Object saveState(FacesContext facesContext) { Object[] values = new Object[6]; values[0] = super.saveState(facesContext); values[1] = _schemes; values[2] = Boolean.valueOf(_allow2Slashes); values[3] = Boolean.valueOf(_allow2SlashesSet); values[4] = Boolean.valueOf(_allowAllSchemas); values[5] = Boolean.valueOf(_allowAllSchemasSet); return values; }
public void restoreState(FacesContext facesContext, Object state) { Object[] values = (Object[])state; super.restoreState(facesContext,values[0]); _schemes = (java.lang.String) values[1]; _allow2Slashes = ((Boolean) values[2]).booleanValue(); _allow2SlashesSet = ((Boolean) values[3]).booleanValue(); _allowAllSchemas = ((Boolean) values[4]).booleanValue(); _allowAllSchemasSet = ((Boolean) values[5]).booleanValue(); } }
private String[] getSchemesList() { if (getSchemes() == null) { return null; } String [] list = getSchemes().split(","); String [] resp = new String [list.length]; for (int i = 0; i < list.length; i++) { resp[i] = list[i].trim(); } return resp; }