1 19 package org.netbeans.api.mdr; 20 21 import org.openide.util.Lookup; 22 import javax.jmi.reflect.RefBaseObject; 23 import java.io.IOException ; 24 import java.util.Collection ; 25 26 31 public abstract class JMIMapper { 32 33 43 public abstract void generate(JMIStreamFactory sf, RefBaseObject object) throws IOException ; 44 45 48 public static synchronized JMIMapper getDefault() { 49 Lookup.Result result = Lookup.getDefault().lookup( 51 new Lookup.Template(JMIMapper.class) 52 ); 53 Collection instances = result.allInstances(); 54 return (instances.size() > 0 ? (JMIMapper) result.allInstances().iterator().next() : null); 55 } 56 } 57 58 | Popular Tags |