Return-Path: Delivered-To: apmail-jakarta-bcel-user-archive@www.apache.org Received: (qmail 12321 invoked from network); 23 Dec 2005 08:53:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Dec 2005 08:53:12 -0000 Received: (qmail 14634 invoked by uid 500); 23 Dec 2005 08:53:12 -0000 Delivered-To: apmail-jakarta-bcel-user-archive@jakarta.apache.org Received: (qmail 14390 invoked by uid 500); 23 Dec 2005 08:53:10 -0000 Mailing-List: contact bcel-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "BCEL Users List" Reply-To: "BCEL Users List" Delivered-To: mailing list bcel-user@jakarta.apache.org Received: (qmail 14379 invoked by uid 99); 23 Dec 2005 08:53:10 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Dec 2005 00:53:10 -0800 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,MSGID_FROM_MTA_HEADER X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [202.54.124.145] (HELO rediffmail.com) (202.54.124.145) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 23 Dec 2005 00:53:09 -0800 Received: (qmail 5240 invoked by uid 510); 23 Dec 2005 08:52:35 -0000 Date: 23 Dec 2005 08:52:35 -0000 Message-ID: <20051223085235.5239.qmail@webmail30.rediffmail.com> Received: from unknown (59.93.244.36) by rediffmail.com via HTTP; 23 dec 2005 08:52:35 -0000 MIME-Version: 1.0 From: "chinmoy chakraborty" Reply-To: "chinmoy chakraborty" To: "BCEL Users List" Subject: Re: Re: [SPAM] New to BCEL - Please help Content-type: multipart/alternative; boundary="Next_1135327955---0-202.54.124.145-5211" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --Next_1135327955---0-202.54.124.145-5211 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline =A0=0AHi Dave,=0A=0AThank you very much for your reply. Now I am trying to= generate following code dynamically,=0A=0A.......=0A....=0Apublic int getN= um()=0A{ return num; //num is a private class variable=0A}=0A...=0Ai have w= ritten following BCEL code to genarate that,=0A......=0AFieldGen fg =3D new= FieldGen(Constants.ACC_PRIVATE, Type.INT, "Num", cp ); //class variable=0A= =0AMethodGen mg1 =3D new MethodGen(Constants.ACC_PUBLIC,=0A = Type.INT, Type.NO_ARGS, new String[] {}, "getNum", "Num", i1, cp); //i1= -instruction list, cp - //constantpoolgen=0A=0Ai1.append(factory.createLoad= (fg.getField().getType(), fg.getField().getNameIndex()));=0Ai1.append(facto= ry.createReturn(fg.getField().getType()));=0Ai1.append(InstructionConstants= .RETURN);=0A...=0A=0AIt generates following code through BCEL,=0A=0Apublic = int getNum()=0A {=0A =0A return ;=0A }=0A = =0Awhy is it so?? why the variable name is missing??=0A=0A=0AThanks,=0AChin= moy=0A=0A=0A=0A=0A=0A=0A=0A=0A=0AOn Fri, 23 Dec 2005 Dave Brosius wrote := =0A>There is a tool in BCEL called BCELifier, which will show you the code = to generate a class, given that class.=0A>=0A>That is an ideal way to learn= how to do what you want.=0A>=0A>----- Original Message ----- From: "chinmo= y chakraborty" =0A>To: =0A>Sent: Wednesday, December 21, 2005 11:15 PM=0A>Subject: [SPAM] New t= o BCEL - Please help=0A>=0A>=0A>=0A>Hello,=0A>=0A>I am new to BCEL nad stil= l struggling to get used to it. Could you please tell me where I can get so= me tutorial of BCEL. I have gone through the BCEL Manual but I want somethi= ng more. Could you please tell me what will be the BCEL equivalent code for= the following.=0A>=0A>public class Num=0A>{=0A> private int num;=0A> pub= lic int getNum()=0A> { return num;}=0A> public void setNum(int num)=0A> = { this.num =3D num;}=0A> private static org.apache.axis.description.TypeDe= sc typeDesc =3D=0A> new org.apache.axis.description.TypeDesc(Num.cla= ss);=0A>=0A> public static org.apache.axis.encoding.Serializer getSerializ= er (java.lang.String mechType,java.lang.Class _javaType, javax.xml.namespac= e.QName _xmlType)=0A> {return new org.apache.axis.encoding.ser.BeanSeri= alizer (_javaType, _xmlType,typeDesc);=0A>=0A> }=0A>}=0A>=0A>=0A>Thanks= ,=0A>Chinmoy=0A>=0A>=0A>=0A>-----------------------------------------------= ----------------------=0A>To unsubscribe, e-mail: bcel-user-unsubscribe@jak= arta.apache.org=0A>For additional commands, e-mail: bcel-user-help@jakarta.= apache.org=0A>=0A --Next_1135327955---0-202.54.124.145-5211--