ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(portletContext.getPortletHandle(), "portlet handle", "PortletContext");
ParameterValidation.throwIllegalArgExceptionIfNull(runtimeContext, "RuntimeContext");
ParameterValidation.throwIllegalArgExceptionIfNull(markupParams, "MarkupParams");
ParameterValidation.throwIllegalArgExceptionIfNull(eventParams, "EventParams");
HandleEvents handleEvents = new HandleEvents();
handleEvents.setRegistrationContext(registrationContext);
handleEvents.setPortletContext(portletContext);
handleEvents.setRuntimeContext(runtimeContext);
handleEvents.setUserContext(userContext);
handleEvents.setMarkupParams(markupParams);
handleEvents.setEventParams(eventParams);
return handleEvents;
}