Package com.orientechnologies.orient.core.exception

Examples of com.orientechnologies.orient.core.exception.OSerializationException


        // BYTES
        final ORecordBytes record = (ORecordBytes) iRecord;
        json.writeAttribute(indentLevel + 1, true, "value", OBase64Utils.encodeBytes(record.toStream()));
      } else

        throw new OSerializationException("Error on marshalling record of type '" + iRecord.getClass()
            + "' to JSON. The record type can't be exported to JSON");

      json.endObject(indentLevel);
      parsedRecords.clear();

      iOutput.append(buffer);
      return iOutput;
    } catch (IOException e) {
      throw new OSerializationException("Error on marshalling of record to JSON", e);
    }
  }
View Full Code Here


    final ByteArrayInputStream is = new ByteArrayInputStream(iStream);
    final ObjectInputStream in = new ObjectInputStream(is);
    try {
      return in.readObject();
    } catch (ClassNotFoundException e) {
      throw new OSerializationException("Can't unmarshall Java serialized object", e);
    } finally {
      in.close();
      is.close();
    }
  }
View Full Code Here

  public byte[] toStream(final ODatabaseRecord iDatabase, final Object iObject) throws IOException {
    if (iObject == null)
      return null;

    if (((ORecord<?>) iObject).getIdentity() == null)
      throw new OSerializationException("Can't serialize record without identity. Store it before to serialize.");

    return ((ORecord<?>) iObject).getIdentity().toStream();
  }
View Full Code Here

          // DETERMINE TYPE BY REFLECTION
          type = getFieldType(iUserObject, iFieldName);
        }

        if (type == null)
          throw new OSerializationException("Linked type of field " + iFieldName + " in class " + iRoot.getClassName() + " is null");

        Object fieldValue = null;
        Class<?> fieldClass;
        boolean propagate = false;
View Full Code Here

          iFieldValue = toStream(iFieldValue, linkedDocument, iEntityManager, linkedDocument.getSchemaClass(), iObj2RecHandler, db,
              iSaveOnlyDirty);

        } else
          throw new OSerializationException("Linked type [" + iFieldValue.getClass() + ":" + iFieldValue
              + "] can't be serialized because is not part of registered entities. To fix this error register this class");
      }
    }
    return iFieldValue;
  }
View Full Code Here

      // VALUES WILL BE LOADED LAZY
      values = (V[]) new Object[pageSize];

      return this;
    } catch (IOException e) {
      throw new OSerializationException("Can't unmarshall RB+Tree node", e);
    } finally {
      OProfiler.getInstance().stopChrono("OMVRBTreeEntryP.fromStream", timer);
    }
  }
View Full Code Here

      // VALUES WILL BE LOADED LAZY
      values = (V[]) new Object[pageSize];

      return this;
    } catch (IOException e) {
      throw new OSerializationException("Can't unmarshall RB+Tree node", e);
    } finally {
      OProfiler.getInstance().stopChrono("OMVRBTreeEntryP.fromStream", timer);
    }
  }
View Full Code Here

      record.fromStream(buffer);
      return buffer;

    } catch (IOException e) {
      throw new OSerializationException("Can't marshall RB+Tree node", e);
    } finally {
      marshalledRecords.remove(identityRecord);

      checkEntryStructure();
View Full Code Here

      record.fromStream(buffer);
      return buffer;

    } catch (IOException e) {
      throw new OSerializationException("Can't marshall RB+Tree node", e);
    } finally {
      marshalledRecords.remove(identityRecord);

      checkEntryStructure();
View Full Code Here

        if (c == COLLECTION_BEGIN)
          insideCollection++;
        else if (c == COLLECTION_END) {
          if (!isCharPresent(c, iRecordSeparator)) {
            if (insideCollection == 0)
              throw new OSerializationException("Found invalid " + COLLECTION_END
                  + " character. Assure to open and close correctly.");
            insideCollection--;
          }

        } else if (c == PARENTHESIS_BEGIN) {
          insideParenthesis++;
        } else if (c == PARENTHESIS_END) {
          if (!isCharPresent(c, iRecordSeparator)) {
            if (insideParenthesis == 0)
              throw new OSerializationException("Found invalid " + PARENTHESIS_END
                  + " character. Assure to open and close correctly.");
            insideParenthesis--;
          }

        } else if (c == MAP_BEGIN) {
          insideMap++;
        } else if (c == MAP_END) {
          if (!isCharPresent(c, iRecordSeparator)) {
            if (insideMap == 0)
              throw new OSerializationException("Found invalid " + MAP_END + " character. Assure to open and close correctly.");
            insideMap--;
          }
        }

        else if (c == LINK)
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.exception.OSerializationException

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.