public void validate(String preprocessorCmd) throws FrontendException {
if (pigContext == null) {
return;
}
final BlackAndWhitelistFilter filter = new BlackAndWhitelistFilter(pigContext);
final String declareToken = "%declare";
final String defaultToken = "%default";
if (preprocessorCmd.equals(declareToken)) {
filter.validate(PigCommandFilter.Command.DECLARE);
} else if (preprocessorCmd.equals(defaultToken)) {
filter.validate(PigCommandFilter.Command.DEFAULT);
} else {
throw new IllegalArgumentException("Pig Internal Error. Invalid preprocessor command specified : "
+ preprocessorCmd);
}
}