You might be able to use Spring Asserts for this. Assert api (http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/util/Assert.html) runs the provided expression against the specified parameters, and if the expression is false, it throws an exception .
Example: Assert.isTrue (system.equals ("ValidSystemName"), "You must provide a valid system");
It also contains functions to verify that the parameters are not null or are not empty strings, etc.
source share