class GenericPropertyEditor extends PropertyEditorSupport {

    private Object val;

    @Override
    public Object getValue() {
        return val;
    }

    @Override
    public void setValue(Object value) {
        this.val = value;
    }

    @Override
    public String getAsText() {
        if (val != null) {
            ByteArrayOutputStream bos = null;
            ObjectOutputStream oos = null;
            //FIXME: using java serialization is a bit dangerous, change this but keep compatibility with old saved files
            try {
                bos = new ByteArrayOutputStream();
                oos = new ObjectOutputStream(bos);
                oos.writeObject(val);
            } catch (Exception e) {
                Exceptions.printStackTrace(e);
            } finally {
                if (oos != null) {
                    try {
                        oos.close();
                    } catch (IOException ex) {
                    }
                }
                if (bos != null) {
                    try {
                        bos.close();
                    } catch (IOException ex) {
                    }
                }
            }
            if (bos != null) {
                return Base64.encodeBase64String(bos.toByteArray());
            }
        }
        return "null";
    }

    @Override
    public void setAsText(String text) throws IllegalArgumentException {<FILL_FUNCTION_BODY>}
}

        if (!text.equals("null")) {
            ByteArrayInputStream bis = null;
            ObjectInputStream ois = null;
            try {
                bis = new ByteArrayInputStream(Base64.decodeBase64(text));
                ois = new ObjectInputStream(bis);
                val = ois.readObject();
            } catch (Exception e) {
                Exceptions.printStackTrace(e);
            } finally {
                if (ois != null) {
                    try {
                        ois.close();
                    } catch (IOException ex) {
                    }
                }
                if (bis != null) {
                    try {
                        bis.close();
                    } catch (IOException ex) {
                    }
                }
            }
        }
    
<methods>public void <init>() ,public void <init>(java.lang.Object) ,public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener) ,public void firePropertyChange() ,public java.lang.String getAsText() ,public java.awt.Component getCustomEditor() ,public java.lang.String getJavaInitializationString() ,public java.lang.Object getSource() ,public java.lang.String[] getTags() ,public java.lang.Object getValue() ,public boolean isPaintable() ,public void paintValue(java.awt.Graphics, java.awt.Rectangle) ,public synchronized void removePropertyChangeListener(java.beans.PropertyChangeListener) ,public void setAsText(java.lang.String) throws java.lang.IllegalArgumentException,public void setSource(java.lang.Object) ,public void setValue(java.lang.Object) ,public boolean supportsCustomEditor() <variables>private Vector<java.beans.PropertyChangeListener> listeners,private java.lang.Object source,private java.lang.Object value