1 8 9 package com.sleepycat.persist.impl; 10 11 import java.lang.reflect.Array ; 12 import java.util.Map ; 13 14 20 class NonPersistentFormat extends Format { 21 22 private static final long serialVersionUID = -7488355830875148784L; 23 24 NonPersistentFormat(Class type) { 25 super(type); 26 } 27 28 @Override 29 void initialize(Catalog catalog) { 30 } 31 32 @Override 33 void collectRelatedFormats(Catalog catalog, 34 Map <String ,Format> newFormats) { 35 } 36 37 @Override 38 Object newArray(int len) { 39 return Array.newInstance(getType(), len); 40 } 41 42 @Override 43 public Object newInstance(EntityInput input, boolean rawAccess) { 44 throw new UnsupportedOperationException 45 ("Cannot instantiate non-persistent class: " + getClassName()); 46 } 47 48 @Override 49 public Object readObject(Object o, EntityInput input, boolean rawAccess) { 50 throw new UnsupportedOperationException (); 51 } 52 53 @Override 54 void writeObject(Object o, EntityOutput output, boolean rawAccess) { 55 throw new UnsupportedOperationException (); 56 } 57 58 @Override 59 void skipContents(RecordInput input) { 60 throw new UnsupportedOperationException (); 61 } 62 63 @Override 64 boolean evolve(Format newFormat, Evolver evolver) { 65 evolver.useOldFormat(this, newFormat); 66 return true; 67 } 68 } 69 | Popular Tags |