2
I’m creating a converter and it’s giving me this mistake:
Method does not Override or implement a method from a supertype
Converter code:
package com.mycompany.conversor;
import com.mycompany.entidades.agendaTipo;
import com.mycompany.repositorio.agendaTipoRepositorio;
import java.lang.annotation.Annotation;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.FacesConverter;
import javax.inject.Inject;
import javax.persistence.Converter;
@FacesConverter(forClass = agendaTipo.class)
public class agendaTipoConverter implements Converter{
@Inject
private agendaTipoRepositorio agendaTipoRepositorio;
@Override
public Object getAsObject(FacesContext context,
UIComponent component, String value) {
agendaTipo retorno = null;
if (value != null && !"".equals(value)) {
retorno = this.agendaTipoRepositorio.porId(new Long(value));
}
return retorno;
}
@Override
public String getAsString(FacesContext context,
UIComponent component, Object value) {
if (value != null) {
agendaTipo agendaTipo = ((agendaTipo) value);
return agendaTipo.getId() == null ? null : agendaTipo.getId().toString();
}
return null;
}
}
Post the full stacktrace and other, do your classes start with lowercase letter? That’s out of the pattern but it’s another story.
– Roknauta
Douglas the error is giving in netbeans still, because when I started with Java was so minuscula first letter second upper but anyway. Error gives inside netbeans
– Rodrigo De Almeida Padilha