Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*-
  * See the file LICENSE for redistribution information.
  *
  * Copyright (c) 2002, 2013 Oracle and/or its affiliates.  All rights reserved.
  *
  */
 
 package com.sleepycat.persist.impl;
 
Format for a non-persistent class that is only used for declared field types and arrays. Currently used only for Object and interface types.

Author(s):
Mark Hayes
class NonPersistentFormat extends Format {
    private static final long serialVersionUID = -7488355830875148784L;
    NonPersistentFormat(Catalog catalogClass type) {
        super(catalogtype);
    }
    @Override
    void initialize(Catalog catalogEntityModel modelint initVersion) {
    }
    @Override
    void collectRelatedFormats(Catalog catalog,
                               Map<StringFormatnewFormats) {
    }
    @Override
    Object newArray(int len) {
        return Array.newInstance(getType(), len);
    }
    @Override
    public Object newInstance(EntityInput inputboolean rawAccess) {
        throw DbCompat.unexpectedState
            ("Cannot instantiate non-persistent class: " + getClassName());
    }
    @Override
    public Object readObject(Object oEntityInput inputboolean rawAccess) {
        throw DbCompat.unexpectedState();
    }
    @Override
    void writeObject(Object oEntityOutput outputboolean rawAccess) {
        throw DbCompat.unexpectedState();
    }
    @Override
    void skipContents(RecordInput input) {
        throw DbCompat.unexpectedState();
    }
    @Override
    boolean evolve(Format newFormatEvolver evolver) {
        evolver.useOldFormat(thisnewFormat);
        return true;
    }
New to GrepCode? Check out our FAQ X