1 19 20 package org.netbeans.spi.settings; 21 22 import org.openide.util.Lookup; 23 24 29 public abstract class Convertor { 30 31 36 public abstract void write (java.io.Writer w, Object inst) throws java.io.IOException ; 37 38 44 public abstract Object read (java.io.Reader r) throws java.io.IOException , ClassNotFoundException ; 45 46 52 public abstract void registerSaver (Object inst, Saver s); 53 54 59 public abstract void unregisterSaver (Object inst, Saver s); 60 61 67 protected static org.openide.util.Lookup findContext(java.io.Reader r) { 68 if (r instanceof Lookup.Provider) { 69 return ((Lookup.Provider) r).getLookup(); 70 } else { 71 return Lookup.EMPTY; 72 } 73 } 74 75 81 protected static org.openide.util.Lookup findContext(java.io.Writer w) { 82 if (w instanceof Lookup.Provider) { 83 return ((Lookup.Provider) w).getLookup(); 84 } else { 85 return Lookup.EMPTY; 86 } 87 } 88 89 } 90 | Popular Tags |