If you want to add your own error object anytime through the Java API, just instantiate an UserError object and add it to the ErrorController. Be sure you also implement the inverse action to remove the error again.
com.jaxfront.demo.api.AddUserError
public class AddUserError implements Action {
public void perform(Type target) {
Error myError = new UserError("test-identifier", target, "message",Error.CLASSIFICATION_WARNING);
target.getDOM().getController().getErrorController().addError(myError);
}
}
com.jaxfront.demo.api.RemoveUserError
public class RemoveUserError implements Action {
public void perform(Type target) {
target.getDOM().getController().getErrorController().removeUserError("test-identifier", target);
}
}