@Override public void setAsText(@Nullable String text) { setValue(text != null ? text.getBytes() : null); }
@Override public String getAsText() { byte[] value = (byte[]) getValue(); return (value != null ? new String(value) : ""); }
this.defaultEditors.put(byte[].class, new ByteArrayPropertyEditor()); this.defaultEditors.put(char[].class, new CharArrayPropertyEditor());
this.defaultEditors.put(byte[].class, new ByteArrayPropertyEditor()); this.defaultEditors.put(char[].class, new CharArrayPropertyEditor());
@Override public void setValue(@Nullable Object value) { if (value instanceof MultipartFile) { MultipartFile multipartFile = (MultipartFile) value; try { super.setValue(multipartFile.getBytes()); } catch (IOException ex) { throw new IllegalArgumentException("Cannot read contents of multipart file", ex); } } else if (value instanceof byte[]) { super.setValue(value); } else { super.setValue(value != null ? value.toString().getBytes() : null); } }
@Override public String getAsText() { byte[] value = (byte[]) getValue(); return (value != null ? new String(value) : ""); }
this.defaultEditors.put(byte[].class, new ByteArrayPropertyEditor()); this.defaultEditors.put(char[].class, new CharArrayPropertyEditor());
@Override public void setAsText(@Nullable String text) { setValue(text != null ? text.getBytes() : null); }
@Override public String getAsText() { byte[] value = (byte[]) getValue(); return (value != null ? new String(value) : ""); }
this.defaultEditors.put(byte[].class, new ByteArrayPropertyEditor()); this.defaultEditors.put(char[].class, new CharArrayPropertyEditor());
@Override public void setValue(@Nullable Object value) { if (value instanceof MultipartFile) { MultipartFile multipartFile = (MultipartFile) value; try { super.setValue(multipartFile.getBytes()); } catch (IOException ex) { throw new IllegalArgumentException("Cannot read contents of multipart file", ex); } } else if (value instanceof byte[]) { super.setValue(value); } else { super.setValue(value != null ? value.toString().getBytes() : null); } }
@Override public String getAsText() { byte[] value = (byte[]) getValue(); return (value != null ? new String(value) : ""); }
this.defaultEditors.put(byte[].class, new ByteArrayPropertyEditor()); this.defaultEditors.put(Class.class, new ClassEditor()); this.defaultEditors.put(File.class, new FileEditor());
@Override public void setAsText(String text) { setValue(text != null ? text.getBytes() : null); }
public String getAsText() { byte[] value = (byte[]) getValue(); return (value != null ? new String(value) : ""); }
@Override public void setAsText(String text) { setValue(text != null ? text.getBytes() : null); }
public void setAsText(String text) { setValue(text.getBytes()); }
@Override public void setValue(@Nullable Object value) { if (value instanceof MultipartFile) { MultipartFile multipartFile = (MultipartFile) value; try { super.setValue(multipartFile.getBytes()); } catch (IOException ex) { throw new IllegalArgumentException("Cannot read contents of multipart file", ex); } } else if (value instanceof byte[]) { super.setValue(value); } else { super.setValue(value != null ? value.toString().getBytes() : null); } }
@Override public void setValue(@Nullable Object value) { if (value instanceof MultipartFile) { MultipartFile multipartFile = (MultipartFile) value; try { super.setValue(multipartFile.getBytes()); } catch (IOException ex) { throw new IllegalArgumentException("Cannot read contents of multipart file", ex); } } else if (value instanceof byte[]) { super.setValue(value); } else { super.setValue(value != null ? value.toString().getBytes() : null); } }
public void setValue(Object value) { if (value instanceof MultipartFile) { MultipartFile multipartFile = (MultipartFile) value; try { super.setValue(multipartFile.getBytes()); } catch (IOException ex) { logger.error("Cannot read contents of multipart file", ex); throw new IllegalArgumentException("Cannot read contents of multipart file: " + ex.getMessage()); } } else if (value instanceof byte[]) { super.setValue(value); } else { super.setValue(value != null ? value.toString().getBytes() : null); } }