document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1.  @FacesConverter(forClass = Error1.class, value = "a")
  2.     public static class Error1ControllerConverter implements Converter {
  3.  
  4.         public Object getAsObject(FacesContext facesContext, UIComponent component, String value) {
  5.             if (value == null || value.length() == 0) {
  6.                 return null;
  7.             }
  8.             Error1Controller controller = (Error1Controller) facesContext.getApplication().getELResolver().
  9.                     getValue(facesContext.getELContext(), null, "error1Controller");
  10.             try {          
  11.                 return controller.ejbErrorAnulacion.find(getKey(value));
  12.             } catch (EntidadException ex) {
  13.                 Logger.getLogger(Error1Controller.class.getName()).log(Level.SEVERE, null, ex);
  14.                 return null;
  15.             }
  16.            
  17.         }
  18.  
  19.         java.lang.Integer getKey(String value) {
  20.             java.lang.Integer key;
  21.             key = Integer.valueOf(value);
  22.             return key;
  23.         }
  24.  
  25.         String getStringKey(java.lang.Integer value) {
  26.             StringBuffer sb = new StringBuffer();
  27.             sb.append(value);
  28.             return sb.toString();
  29.         }
  30.  
  31.         public String getAsString(FacesContext facesContext, UIComponent component, Object object) {
  32.             if (object == null) {
  33.                 return null;
  34.             }
  35.             if (object instanceof Error1) {
  36.                 Error1 o = (Error1) object;
  37.                 return getStringKey(o.getId());
  38.             } else {
  39.                 throw new IllegalArgumentException("object " + object + " is of type " + object.getClass().getName() + "; expected type: " + Error1.class.getName());
  40.             }
  41.         }
  42.     }
');