Components that inherit the AbstractComponent have a built-in error indicator that can be set with setComponentError().
AbstractComponent
setComponentError()