fluid-api/src/main/java/com/fluidbpm/program/api/vo/attachment/Attachment.java
@Override
    public JSONObject toJsonObject() throws JSONException {

        JSONObject returnVal = super.toJsonObject();

        //Attachment Data...
        if (this.getAttachmentDataBase64() != null) {
            returnVal.put(JSONMapping.ATTACHMENT_DATA_BASE64,
                    this.getAttachmentDataBase64());
        }

        //Content Type...
        if (this.getContentType() != null) {
            returnVal.put(JSONMapping.CONTENT_TYPE, this.getContentType());
        }

        //Form Id...
        if (this.getFormId() != null) {
            returnVal.put(JSONMapping.FORM_ID, this.getFormId());
        }

        //Name...
        if (this.getName() != null) {
            returnVal.put(JSONMapping.NAME, this.getName());
        }

        //Path...
        if (this.getPath() != null) {
            returnVal.put(JSONMapping.PATH, this.getPath());
        }

        //Version...
        if (this.getVersion() != null) {
            returnVal.put(JSONMapping.VERSION, this.getVersion());
        }

        //Date Created...
        if (this.getDateCreated() != null) {
            returnVal.put(JSONMapping.DATE_CREATED,
                    this.getDateCreated().getTime());
        }

        //Date Last Updated...
        if (this.getDateLastUpdated() != null) {
            returnVal.put(JSONMapping.DATE_LAST_UPDATED,
                    this.getDateLastUpdated().getTime());
        }

        return returnVal;
    }
@Override
    public JSONObject toJsonObject() throws JSONException {

        JSONObject returnVal = super.toJsonObject();

        //Attachment Data...
        if (this.getAttachmentDataBase64() != null) {
            returnVal.put(JSONMapping.ATTACHMENT_DATA_BASE64,
                    this.getAttachmentDataBase64());
        }

        //Content Type...
        if (this.getContentType() != null) {
            returnVal.put(JSONMapping.CONTENT_TYPE, this.getContentType());
        }

        //Form Id...
        if (this.getFormId() != null) {
            returnVal.put(JSONMapping.FORM_ID, this.getFormId());
        }

        //Name...
        if (this.getName() != null) {
            returnVal.put(JSONMapping.NAME, this.getName());
        }

        //Path...
        if (this.getPath() != null) {
            returnVal.put(JSONMapping.PATH, this.getPath());
        }

        //Version...
        if (this.getVersion() != null) {
            returnVal.put(JSONMapping.VERSION, this.getVersion());
        }

        //Date Created...
        if (this.getDateCreated() != null) {
            returnVal.put(JSONMapping.DATE_CREATED,
                    this.getDateCreated().getTime());
        }

        //Date Last Updated...
        if (this.getDateLastUpdated() != null) {
            returnVal.put(JSONMapping.DATE_LAST_UPDATED,
                    this.getDateLastUpdated().getTime());
        }

        return returnVal;
    }
Conversion to {@code JSONObject} from Java Object.

@return {@code JSONObject} representation of {@code Attachment}
@throws JSONException If there is a problem with the JSON Body.

@see ABaseFluidJSONObject#toJsonObject()