hi,I am green head for javassist
I read the tutorial,but my pool.insertClassPath(String) not work
why?

package test;
  | import javassist.ClassClassPath;
  | import javassist.ClassPool;
  | import javassist.CtClass;
  | import javassist.CtField;
  | 
  | /*
  |  * Created on 2005-6-2
  |  */
  | 
  | /**
  |  * @author Niko
  |  */
  | public class Test {    
  |     public Test(){
  |         
  |     }    
  |     public static void main(String[] args)throws Exception {
  |         ClassPool pool = ClassPool.getDefault();
  |         System.out.println(Test.class.getResource("").getPath());
  |         //pool.insertClassPath(Test.class.getResource("").getPath());
  |         pool.insertClassPath("D:/Eclipse/workspace/test/bin/test/");
  |         CtClass cc = pool.makeClass("Rectangle");
  |         cc.addField(new CtField(CtClass.intType, "userOld", cc));
  |         cc.writeFile();
  |     }
  | }
then I think the Rectangle.class file should in dir 
"D:/Eclipse/workspace/test/bin/test/" or "D:/Eclipse/workspace/test/bin/",but I 
find in dir "D:/Eclipse/workspace/test/" ?and 

D:\ECLIPSE\WORKSPACE\TEST
  | ?  .classpath
  | ?  .project
  | ?  Rectangle.class
  | ?  
  | ??bin
  | ?  ??test
  | ?          Test.class
  | ?          
  | ??src
  |     ??test
  |             Test.java

why?
thx

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3879966#3879966

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3879966


-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to