/** * Ensure a property doesn't occur in the specified list. * @param propertyName the name of a property * @param properties a list of properties * @throws ValidationException thrown when the specified property * is found in the list of properties */ public void assertNone(final String propertyName, final PropertyList properties) throws ValidationException { if (properties.getProperty(propertyName) != null) { throw new ValidationException(ASSERT_NONE_MESSAGE, new Object[] {propertyName}); } }
/** * @param componentName a component name used in the assertion * @param components a list of components * @throws ValidationException where the assertion fails */ public static void assertNone(String componentName, ComponentList<?> components) throws ValidationException { if (components.getComponent(componentName) != null) { throw new ValidationException(ASSERT_NONE_MESSAGE, new Object[] {componentName}); } }
/** * Ensure a property doesn't occur in the specified list. * @param propertyName the name of a property * @param properties a list of properties * @throws ValidationException thrown when the specified property * is found in the list of properties */ public void assertNone(final String propertyName, final PropertyList properties) throws ValidationException { if (properties.getProperty(propertyName) != null) { throw new ValidationException(ASSERT_NONE_MESSAGE, new Object[] {propertyName}); } }
/** * @param componentName a component name used in the assertion * @param components a list of components * @throws ValidationException where the assertion fails */ public static void assertNone(String componentName, ComponentList<?> components) throws ValidationException { if (components.getComponent(componentName) != null) { throw new ValidationException(ASSERT_NONE_MESSAGE, new Object[] {componentName}); } }
/** * Ensure a parameter doesn't occur in the specified list. * @param paramName the name of a parameter * @param parameters a list of parameters * @throws ValidationException thrown when the specified property * is found in the list of properties */ public void assertNone(final String paramName, final ParameterList parameters) throws ValidationException { if (parameters.getParameter(paramName) != null) { throw new ValidationException(ASSERT_NONE_MESSAGE, new Object[] {paramName}); } }
/** * Ensure a property doesn't occur in the specified list. * @param propertyName the name of a property * @param properties a list of properties * @throws ValidationException thrown when the specified property * is found in the list of properties */ public void assertNone(final String propertyName, final PropertyList properties) throws ValidationException { if (properties.getProperty(propertyName) != null) { throw new ValidationException(ASSERT_NONE_MESSAGE, new Object[] {propertyName}); } }
/** * Ensure a parameter doesn't occur in the specified list. * @param paramName the name of a parameter * @param parameters a list of parameters * @throws ValidationException thrown when the specified property * is found in the list of properties */ public void assertNone(final String paramName, final ParameterList parameters) throws ValidationException { if (parameters.getParameter(paramName) != null) { throw new ValidationException(ASSERT_NONE_MESSAGE, new Object[] {paramName}); } }
/** * Ensure a parameter doesn't occur in the specified list. * @param paramName the name of a parameter * @param parameters a list of parameters * @throws ValidationException thrown when the specified property * is found in the list of properties */ public void assertNone(final String paramName, final ParameterList parameters) throws ValidationException { if (parameters.getParameter(paramName) != null) { throw new ValidationException(ASSERT_NONE_MESSAGE, new Object[] {paramName}); } }
/** * @param componentName a component name used in the assertion * @param components a list of components * @throws ValidationException where the assertion fails */ public static void assertNone(String componentName, ComponentList<?> components) throws ValidationException { if (components.getComponent(componentName) != null) { throw new ValidationException(ASSERT_NONE_MESSAGE, new Object[] {componentName}); } }
/** * {@inheritDoc} */ public final void validate() throws ValidationException { if (percentage < 0 || percentage > 100) { throw new ValidationException(getName() + " with invalid value: " + percentage); } }
public void validate() throws ValidationException { throw new ValidationException(); } };
/** * {@inheritDoc} */ public final void validate() throws ValidationException { if (percentage < 0 || percentage > 100) { throw new ValidationException(getName() + " with invalid value: " + percentage); } }
/** * {@inheritDoc} */ public final void validate() throws ValidationException { if (percentage < 0 || percentage > 100) { throw new ValidationException(getName() + " with invalid value: " + percentage); } }
/** * @param componentName a component name used in the assertion * @param components a list of components * @throws ValidationException where the assertion fails */ public static void assertOneOrLess(String componentName, ComponentList<?> components) throws ValidationException { if (components.getComponents(componentName).size() > 1) { throw new ValidationException(ASSERT_ONE_OR_LESS_MESSAGE, new Object[] {componentName}); } } }
/** * @param componentName a component name used in the assertion * @param components a list of components * @throws ValidationException where the assertion fails */ public static void assertOneOrLess(String componentName, ComponentList<?> components) throws ValidationException { if (components.getComponents(componentName).size() > 1) { throw new ValidationException(ASSERT_ONE_OR_LESS_MESSAGE, new Object[] {componentName}); } } }
/** * {@inheritDoc} */ @Override public void validate() throws ValidationException { for (Parameter param : getParameters()) { final Parameter.Id id = param.getId(); if (!Parameter.Id.EXTENDED.equals(id)) { throw new ValidationException(MessageFormat.format(ILLEGAL_PARAMETER_MESSAGE, id)); } } }
/** * @param param a parameter to validate * @throws ValidationException where the specified parameter is not a Pref parameter */ protected final void assertPrefParameter(final Parameter param) throws ValidationException { if (!Parameter.Id.PREF.equals(param.getId())) { throw new ValidationException(MessageFormat.format(ILLEGAL_PARAMETER_MESSAGE, param.getId())); } }
/** * @param param a parameter instance * @param parameters a list of parameters * @throws ValidationException where the assertion fails */ public void assertNullOrEqual(final Parameter param, final ParameterList parameters) throws ValidationException { final Parameter p = parameters.getParameter(param.getName()); if (p != null && !param.equals(p)) { throw new ValidationException(ASSERT_NULL_OR_EQUAL_MESSAGE, new Object[] {p}); } }
/** * @param param a parameter instance * @param parameters a list of parameters * @throws ValidationException where the assertion fails */ public void assertNullOrEqual(final Parameter param, final ParameterList parameters) throws ValidationException { final Parameter p = parameters.getParameter(param.getName()); if (p != null && !param.equals(p)) { throw new ValidationException(ASSERT_NULL_OR_EQUAL_MESSAGE, new Object[] {p}); } }
/** * @param param a parameter instance * @param parameters a list of parameters * @throws ValidationException where the assertion fails */ public void assertNullOrEqual(final Parameter param, final ParameterList parameters) throws ValidationException { final Parameter p = parameters.getParameter(param.getName()); if (p != null && !param.equals(p)) { throw new ValidationException(ASSERT_NULL_OR_EQUAL_MESSAGE, new Object[] {p}); } }