Package it.eng.qbe.serializer

Examples of it.eng.qbe.serializer.SerializationException


        logger.debug("Deserializing string [" + (String)o + "]");
        try {
          workSheetDefinitionJSON = new JSONObject( (String)o );
        } catch(Throwable t) {
          logger.debug("Object to be deserialized must be string encoding a JSON object");
          throw new SerializationException("An error occurred while deserializing query: " + (String)o, t);
        }
      } else if(o instanceof JSONObject) {
        workSheetDefinitionJSON = (JSONObject)o;
      } else {
        Assert.assertUnreachable("Object to be deserialized must be of type string or of type JSONObject, not of type [" + o.getClass().getName() + "]");
      }
     
      workSheetDefinition  = new WorkSheetDefinition();
     
      try {
        deserializeSheets(workSheetDefinitionJSON, workSheetDefinition);
      } catch (Exception e) {
        throw new SerializationException("An error occurred while deserializing worksheet: " + workSheetDefinitionJSON.toString(), e);
      }

    } finally {
      logger.debug("OUT");
    }
View Full Code Here


      workSheetDefinition = (WorkSheetDefinition)o;
     
      JSONArray sheets = serializeSheets(workSheetDefinition.getWorkSheet());
      toReturn.put(WorkSheetSerializationCostants.SHEETS, sheets);
    } catch (Throwable t) {
      throw new SerializationException("An error occurred while serializing object: " + o, t);
    } finally {
      logger.debug("OUT");
    }
    logger.debug("Worksheet serialized");
    return toReturn;
View Full Code Here

      jsonSheet.put(WorkSheetSerializationCostants.CONTENT, sheet.getContent());
      jsonSheet.put(WorkSheetSerializationCostants.FOOTER, sheet.getFooter());
     
    } catch (Exception e) {
      logger.error("Error serializing the sheet "+sheet.getName(),e);
      throw new SerializationException("Error serializing the sheet "+sheet.getName(),e);
    } finally{
      logger.debug("OUT");
    }
    logger.debug("Serialized the sheet "+sheet.getName());
    return jsonSheet;
View Full Code Here

      // measures
      JSONArray measures = this.serializeMeasures(crosstabDefinition);
      toReturn.put(CrosstabSerializationConstants.MEASURES, measures);

    } catch (Throwable t) {
      throw new SerializationException("An error occurred while serializing object: " + o, t);
    } finally {
     
    }
   
    return toReturn;
View Full Code Here

        logger.debug("Deserializing string [" + (String)o + "]");
        try {
          crosstabDefinitionJSON = new JSONObject( (String)o );
        } catch(Throwable t) {
          logger.debug("Object to be deserialized must be string encoding a JSON object");
          throw new SerializationException("An error occurred while deserializing query: " + (String)o, t);
        }
      } else if(o instanceof JSONObject) {
        crosstabDefinitionJSON = (JSONObject)o;
      } else {
        Assert.assertUnreachable("Object to be deserialized must be of type string or of type JSONObject, not of type [" + o.getClass().getName() + "]");
      }
     
      crosstabDefinition  = new CrosstabDefinition();
     
      try {
        deserializeRows(crosstabDefinitionJSON, crosstabDefinition);
        deserializeColumns(crosstabDefinitionJSON, crosstabDefinition);
        deserializeMeasures(crosstabDefinitionJSON, crosstabDefinition);
       
        // config (measures on rows/columns, totals/subototals on rows/columns) remains a JSONObject
        JSONObject config = crosstabDefinitionJSON.optJSONObject(CrosstabSerializationConstants.CONFIG);
        crosstabDefinition.setConfig(config);
       
        JSONArray calculatedFields = crosstabDefinitionJSON.optJSONArray(CrosstabSerializationConstants.CALCULATED_FIELDS);
        crosstabDefinition.setCalculatedFields(calculatedFields);
       
      } catch (Exception e) {
        throw new SerializationException("An error occurred while deserializing query: " + crosstabDefinitionJSON.toString(), e);
      }

    } finally {
      logger.debug("OUT");
    }
View Full Code Here

     
   
     
     
    } catch(Throwable t) {
      throw new SerializationException("An unpredicted error occurred while serializing dataStore", t);
    } finally {
     
    }
   
    return result;
View Full Code Here

     
      result.put(QuerySerializationConstants.HAVINGS, havingsJSON);
     
      result.put(QuerySerializationConstants.SUBQUERIES, subqueriesJSON);
    } catch (Throwable t) {
      throw new SerializationException("An error occurred while serializing object: " + query, t);
    } finally {
     
    }
   
    return result;
View Full Code Here

          }
         
          fieldJSON.put(QuerySerializationConstants.FIELD_NATURE, nature)
         
        } catch(Throwable t) {
          throw new SerializationException("An error occurred while serializing field: " + field.getAlias(), t);
        }
        logger.debug("Filed [" + field.getAlias() + "] serialized succesfully: [" + fieldJSON.toString() + "]");
        result.put(fieldJSON);
      }
     
    }catch (Throwable t) {
      throw new SerializationException("An error occurred while serializing select clause of query: " + query.getId(), t);
    } finally {
      logger.debug("OUT");
    }
   
    return result;
View Full Code Here

        filterJSON.put(QuerySerializationConstants.FILTER_RO_LAST_VALUE, JSONUtils.asJSONArray(operand.lastValues));
       
        filterJSON.put(QuerySerializationConstants.FILTER_BOOLEAN_CONNETOR, filter.getBooleanConnector());
       
      } catch(JSONException e) {
        throw new SerializationException("An error occurred while serializing filter: " + filter.getName(), e);
      }
      filtersJOSN.put(filterJSON);
    }
   
    return filtersJOSN;
View Full Code Here

        havingJSON.put(QuerySerializationConstants.FILTER_RO_LAST_VALUE, JSONUtils.asJSONArray(operand.lastValues));
       
        havingJSON.put(QuerySerializationConstants.FILTER_BOOLEAN_CONNETOR, filter.getBooleanConnector());
       
      } catch(JSONException e) {
        throw new SerializationException("An error occurred while serializing filter: " + filter.getName(), e);
      }
      havingsJSON.put(havingJSON);
    }
   
    return havingsJSON;
View Full Code Here

TOP

Related Classes of it.eng.qbe.serializer.SerializationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.