@Override protected void validate() { notEmpty(this, "name", name); }
protected void validate() { notEmpty(this, "expression", getExpression()); validPattern(this, "expression", getExpression()); greaterThanZero(this, "name-index", getNameIndex()); greaterThanZero(this, "value-index", getValueIndex()); }
public void validate() { notNegative(this, "database", getDatabase()); }
public static void validUrl(final Object xbean, final String name, final String value) { notEmpty(xbean, name, value); try { new URL(value); } catch (final MalformedURLException e) { throw new ConfigurationException("Attribute \"" + name + "\" of " + determineBeanName(xbean) + " is not a valid URL: " + e.getMessage()); } }
@Override protected void validate() { super.validate(); notEmpty(this, "username", getUsername()); notEmpty(this, "password", getPassword()); notEmpty(this, "url", getUrl()); notEmpty(this, "driver", getDriver()); notNegative(this, "min-size", getMinSize()); greaterThanZero(this, "max-size", getMaxSize()); notNegativeOptional(this, "login-timeout", getLoginTimeout()); if (options != null) { options.validate(); } }
@Override protected void validate() { super.validate(); if (isInstantiatable()) { notEmpty(this, "input", getInput()); notEmpty(this, "selectors", getSelectors()); if (initialResetTimeout != null) { greaterThanZero(this, "initial-reset-timeout", initialResetTimeout); } if (regularResetTimeout != null) { greaterThanZero(this, "regular-reset-timeout", regularResetTimeout); } } } @Override
@Override protected void validate() { super.validate(); greaterThanZero(this, "size", getSize()); }
public static void notNegativeOptional(final Object xbean, final String name, final Integer value) { if (value != null) { if (value < 0) { throw new ConfigurationException("Attribute \"" + name + "\" of " + determineBeanName(xbean) + " with value " + value + " is not a valid number greater than or equal to 0"); } } }
@Override protected void validate() { super.validate(); notEmpty(this, "username", getUsername()); notEmpty(this, "password", getPassword()); notEmpty(this, "url", getUrl()); notEmpty(this, "driver", getDriver()); notNegative(this, "min-size", getMinSize()); greaterThanZero(this, "max-size", getMaxSize()); notNegativeOptional(this, "login-timeout", getLoginTimeout()); if (options != null) { options.validate(); } }
@Override protected void validate() { super.validate(); if (isInstantiatable()) { notEmpty(this, "input", getInput()); notEmpty(this, "selectors", getSelectors()); if (initialResetTimeout != null) { greaterThanZero(this, "initial-reset-timeout", initialResetTimeout); } if (regularResetTimeout != null) { greaterThanZero(this, "regular-reset-timeout", regularResetTimeout); } } } @Override
public static void validUrl(final Object xbean, final String name, final String value) { notEmpty(xbean, name, value); try { new URL(value); } catch (final MalformedURLException e) { throw new ConfigurationException("Attribute \"" + name + "\" of " + determineBeanName(xbean) + " is not a valid URL: " + e.getMessage()); } }
@Override protected void validate() { super.validate(); greaterThanZero(this, "size", getSize()); }
public static void notNull(final Object xbean, final String name, final Object value) { if (value == null) { throw new ConfigurationException("Element \"" + name + "\" of " + determineBeanName(xbean) + " is mandatory"); } }
@Override protected void validate() { notEmpty(this, "name", name); }
@Override protected void validate() { super.validate(); if (isInstantiatable()) { greaterThanZero(this, "interval", getInterval()); } } }
public static void notEmpty(final Object xbean, final String name, final String value) { if (value == null || value.equals("")) { throw new ConfigurationException("Attribute \"" + name + "\" of " + determineBeanName(xbean) + " is mandatory"); } }