@Override public void generateMethodClone( BlockSourceCodeVisitor mv ) { mv.visitIns("initFcClone(clone)"); } }
@Override public void generateMethodInitFcController( BlockSourceCodeVisitor mv ) { mv.visitln(" initIntentHandlersMap(METHODS);"); }
@Override protected void generateExtraCode( ClassSourceCodeVisitor cv ) { BlockSourceCodeVisitor mv = cv.visitMethod( Modifier.PRIVATE, null, "Object", "getFcInterface", new String[]{Component.class.getName()+" c","String name"}, new String[]{InstantiationException.class.getName()} ); mv.visitln(" try {"); mv.visitln(" return c.getFcInterface(name);"); mv.visitln(" }"); mv.visitln(" catch( "+NoSuchInterfaceException.class.getName()+" nsie ) {"); mv.visit (" throw new "+ChainedInstantiationException.class.getName()); mv.visitln("(nsie,null,\"No such interface: \"+nsie.getMessage());"); mv.visitln(" }"); mv.visitEnd(); } }
@Override public void generateConstructors( ClassSourceCodeVisitor cv ) { super.generateConstructors(cv); // public constructor() BlockSourceCodeVisitor mv = cv.visitConstructor(Modifier.PUBLIC,null,null,null); mv.visitEnd(); // public constructor(Component,String,Type,boolean,Object) String[] parameters = new String[]{ Component.class.getName()+" component", "String s", Type.class.getName()+" type", "boolean flag", "Object obj" }; mv = cv.visitConstructor(Modifier.PUBLIC,null,parameters,null); mv.visitIns("super(component,s,type,flag,obj);"); mv.visitEnd(); }
protected void generateNewFcInitializationContextMethod( ClassSourceCodeVisitor cv ) { BlockSourceCodeVisitor mv = cv.visitMethod( Modifier.PUBLIC, null, InitializationContext.class.getName(), "newFcInitializationContext", new String[]{"Object content"}, new String[]{InstantiationException.class.getName()} ); generateNewFcInitializationContextMethod(mv); mv.visitEnd(); }
@Override public void generateInitializationContextForContent( BlockSourceCodeVisitor mv ) { mv.visitSet( "ic.content", contentDesc==null ? "null" : (contentDesc.toString()+".class") ); }
protected void generateNewFcControllerInstantiationMethod( ClassSourceCodeVisitor cv ) { BlockSourceCodeVisitor mv = cv.visitMethod( Modifier.PUBLIC, null, Component.class.getName(), "newFcControllerInstantiation", new String[]{InitializationContext.class.getName()+" ic"}, new String[]{InstantiationException.class.getName()} ); generateNewFcControllerInstantiationMethod(mv); mv.visitEnd(); }
@Override public void generateMethodInitFcController( BlockSourceCodeVisitor mv ) { mv.visitIns("super.initFcController(ic)"); }
@Override public void generateMethodClone( BlockSourceCodeVisitor mv ) { mv.visitln(" clone.initIntentHandlersMap(METHODS);"); }
@Override protected void generateNewFcContentMethod( BlockSourceCodeVisitor mv ) { mv.visitIns("return null"); }
@Override protected void generateNCICMProxyCreation( BlockSourceCodeVisitor mv, boolean typedef, String fcitfClassname, String delegate, String itname, InterfaceType it ) { super.generateNCICMProxyCreation( mv,typedef,fcitfClassname,delegate,itname,it); mv.visitIns( "((",TinfiComponentInterceptor.class.getName(), ")intercept).setFcItf(proxy)"); } }