1 /*-
2  * Copyright (c) 2002, 2020 Oracle and/or its affiliates.  All rights reserved.
3  *
4  * See the file LICENSE for license information.
5  *
6  */
7 
8 package com.sleepycat.persist.impl;
9 
10 import java.io.Serializable;
11 
12 import com.sleepycat.persist.model.EntityModel;
13 
14 /**
15  * Interface to the "read object" methods of the Format class.  For the
16  * latest version format, the Format object provides the implementation of
17  * these methods.  For an older version format, an evolver object implements
18  * this interface to convert from the old to new format.
19  *
20  * See {@link Format} for a description of each method.
21  * @author Mark Hayes
22  */
23 interface Reader extends Serializable {
24 
initializeReader(Catalog catalog, EntityModel model, int initVersion, Format oldFormat)25     void initializeReader(Catalog catalog,
26                           EntityModel model,
27                           int initVersion,
28                           Format oldFormat);
29 
newInstance(EntityInput input, boolean rawAccess)30     Object newInstance(EntityInput input, boolean rawAccess)
31         throws RefreshException;
32 
readPriKey(Object o, EntityInput input, boolean rawAccess)33     void readPriKey(Object o, EntityInput input, boolean rawAccess)
34         throws RefreshException;
35 
readObject(Object o, EntityInput input, boolean rawAccess)36     Object readObject(Object o, EntityInput input, boolean rawAccess)
37         throws RefreshException;
38 
getAccessor(boolean rawAccess)39     Accessor getAccessor(boolean rawAccess);
40 }
41