How to discover all names of class of  a package

Hello!
Ineed to developer a class that discover all class name and all method name of a package and put it into a database.
Anyone have an Idea how to make this?
Thanks for help-me.
Ricardo
[email protected]

Sure. Given a source or classes directory, go to the directory indicated by the package name. Get all the files in the directory (*.java or *.class depending), using a File object. You may also need a FilenameFilter. BTW, the source file method would not catch multiple classes in one file, while the class file method would.

Similar Messages

  • How to bundle all files and directories in a package?

    how to bundle all files and directories in a package?
    i plan to put all image files, .class files and some other files together.and then double click the package to execute the program.
    should i use jar?is there a link for tutorial or example?
    thanks in advance

    http://java.sun.com/docs/books/tutorial/jar/

  • How to discover all available font styles for a given family?

    I'm using InDesign CS3 and need to discover all of the available styles for any given font. I've found Application.Fonts.itemByName(), but this only returns a single font by the full name. Using ExtentScript in CS3 How can I ask for ALL font styles for any given font family (as displayed in the styles drop-down?)
    Thanks!

    hey,
    I was just searching the web trying to find why this piece of code:
    for (var i = 0; i <app.fonts.length;i++) {
         app.fonts[i]..... some other code
    take 4+ minutes to execute.
    app.fonts.everyItem().getElements(); did the trick, sweet!!
    However, I would like to ask you whether you know if there is some handout or some guide (possibly online page) for such advanced scripting...
    or how did you find this solution?
    thank you very much for this post, anyway
    regards
    jenda

  • How to return a list of class from a package

    Hi,
    I'm trying to create a RPG game with 50 characters. There will be a superclass, and each character is a subclass that extends from the superclass. Each will have unique abilities that will be functions. These classes will be thrown into a package.
    I would like to know the code for returning the list of classes in that package. That way, I can present them as a list for the player to choose just a handful of characters to start out with.
    Thanks in advance         

    Hi u can use the this class
    flash.utils.describeType;
    Regards
    Sumit Agrawal

  • How i discover all work-group computer in sccm 2012

    how i can make  discovery for  all work-group computer in sccm 2012 

    Jason - true but some environments don't always have this luxury. I've worked with clients recently whereby they weren't able to add all devices into AD but yet still wanted to managed them in ConfigMgr. It does add complexity and extra work and I wouldn't
    recommend, as I'm sure you wouldn't, running Network Discovery on a frequent basis.
    Cheers
    Paul | sccmentor.wordpress.com

  • How to list all names in JNDI?

    Hi,
    the following program does work with J2EE, but does not work with
    iPlanet. I am very disappointed with iPlanet, it has many bugs, some
    functions in the tools provided are still not implemented (try to delete
    something you have deployed, thins brings up a window, saying "Not
    implemented yet"), things, that work with other J2EE-Servers do not work
    with iPlanet.
    public class Ctx {
    public static final void main(String[] args) {
    InitialContext ctx = null;
    if (args.length != 1) {
    System.err.println("Please specify naming root, e.g.
    java:comp/env/");
    } else {
    String root = args[0];
    System.out.println("NamingRoot: " + root);
    try {
              // only for iplanet
    Hashtable env = new Hashtable();
    env.put("java.naming.provider.url",
    "iiop://localhost:9010");
    env.put("java.naming.factory.initial",
    "com.sun.jndi.cosnaming.CNCtxFactory");
              // only for iplanet
    ctx = new InitialContext(env);
    NamingEnumeration enum = ctx.list(root);
    while (enum.hasMore()) {
    System.out.println(enum.next().toString());
    } catch (Exception e) {
    System.out.println(e);
    A.
    Andre Fuechsel, Senior Consultant Phone: +49 221 8299 228
    SchlumbergerSema, Sema CGTec GmbH Fax: +49 221 8299 288
    Kaltenbornweg 3, 50679 Koeln, Germany Mobile: +49 175 580 76 56
    E-Mail: [email protected]

    Hi,
    the following program does work with J2EE, but does not work with
    iPlanet. I am very disappointed with iPlanet, it has many bugs, some
    functions in the tools provided are still not implemented (try to delete
    something you have deployed, thins brings up a window, saying "Not
    implemented yet"), things, that work with other J2EE-Servers do not work
    with iPlanet.
    public class Ctx {
    public static final void main(String[] args) {
    InitialContext ctx = null;
    if (args.length != 1) {
    System.err.println("Please specify naming root, e.g.
    java:comp/env/");
    } else {
    String root = args[0];
    System.out.println("NamingRoot: " + root);
    try {
              // only for iplanet
    Hashtable env = new Hashtable();
    env.put("java.naming.provider.url",
    "iiop://localhost:9010");
    env.put("java.naming.factory.initial",
    "com.sun.jndi.cosnaming.CNCtxFactory");
              // only for iplanet
    ctx = new InitialContext(env);
    NamingEnumeration enum = ctx.list(root);
    while (enum.hasMore()) {
    System.out.println(enum.next().toString());
    } catch (Exception e) {
    System.out.println(e);
    A.
    Andre Fuechsel, Senior Consultant Phone: +49 221 8299 228
    SchlumbergerSema, Sema CGTec GmbH Fax: +49 221 8299 288
    Kaltenbornweg 3, 50679 Koeln, Germany Mobile: +49 175 580 76 56
    E-Mail: [email protected]

  • How to find the name of calling procedure or package?

    Hi all..
    Is it possible to find the name of the calling procedure or package?
    I mean..if proc_1 is calling proc_2 How can i find in proc_2 that proc_1 is calling?
    Proc_2 is being called from different procedures? I need to write to small code which needs to fire depends on the Proc it is calling?
    Please help me to solve this.
    Thanks

    Not sure, if this is what you're looking for
    SQL> create or replace procedure p0 as
      2  begin
      3    dbms_output.put_line(dbms_utility.format_call_stack);
      4  end;
      5  /
    Procedure created.
    SQL> create or replace procedure p1 as
      2  begin
      3    p0;
      4  end;
      5  /
    Procedure created.
    SQL> create or replace procedure p2 as
      2  begin
      3    p1;
      4  end;
      5  /
    Procedure created.
    SQL> set serveroutput on
    SQL> begin
      2    p2;
      3  end;
      4  /
    ----- PL/SQL Call Stack -----
      object      line  object
      handle    number  name
    3a7f2d618         3  procedure INV_ADM.P0
    39abfeef0         3  procedure INV_ADM.P1
    39c5ae7a0         3  procedure INV_ADM.P2
    3a0f3a538         2  anonymous block
    PL/SQL procedure successfully completed.
    SQL>

  • How to discover private field using reflect?

    Hi, all:
    i learned discover fields of a class by using reflect
    getClass().getFields()
    but it only works for public fields. how to discover all
    fields of a class?
    thank you in advance.
    kevin.

    I would not think that you would be able to use reflection to obtain private fields as even if you could get them, you cannot access them outside of the intansiated object of that type.
    what do you want them for?

  • How to recognize the name of invoked classes&methods&fields in a class

    I am now doing some programming used to recognize the name of all classes, methods, constructors and fields invoked from other classes in a given class. This recognition is required automatical. Now I really have no idea how to realize it. Can anyone please give me some suggestions how to programme it?
    Now I show you a specific example to make sure you understand my question.
    From the following example, firstly I've no idea what outer classes, methods and fields are used in class "PointShadowProtocol". However, the expected functionality of realization is to find out: 1, the name of two used outer classes: Shadow, Point; 2, invoked constructor: Shadow s=new Shadow(int x,int y); 3, invoked methods: Point.getX()&#65292; Point.getY()&#65292; Point.printPosition()&#65292;Shadow.offset&#65292;Shadow.printPosition(); and 4, invoked field: Point.x,Point.y,Shadow.x,Shadow.y
    public class PointShadowProtocol{
    private int shadowCount=0;
    public static Shadow getShadow(Point p){
    Shadow s=new Shadow(p.x,p.y);
    return s;
    public void setting(Point p){
    Shadow s=new Shadow(p.x,p.y);
    shadowCount++;
    public void settingX(Point p){
    Shadow s=getShadow(p);
    s.x=p.getX()+Shadow.offset;
    p.printPosition();
    s.printPosition();
    public void settingY(Point p){
    Shadow s=getShadow(p);
    s.y=p.getY()+Shadow.offset;
    p.printPosition();
    s.printPosition();
    Actually, after realizing this functionality, I will use these results to automatically generate the related class stub, method stub, field stub, which can be used to test the given class "PointShadowProtocol", probably equivalent to unit test.
    Any suggestions are welcome. Thank you in advance for your reply.

    Using BCEL sounds a good idea for a class in Java. Actually, I want to target an aspect, which is from AspectJ, without knowing any invoked classes, class methods and fields inside an aspect in the first place (examples of an aspect is as showed below). An aspect in AspectJ is just like a class in Java. But an aspect can't be compiled if the invoked outer classes and methods don't exist. (In fact, the weaving of an aspect into classes happens in the compile time, an aspect can't be compiled if the woven classes (or invoked classes) don't exist, which means I have to find out the all the invoked classes, class methods and fields in that aspect before the compile time) So BCEL could not apply into an aspect in AspectJ.
    I am sorry to introduce new concepts here. However,the solution to find out all the invoked outer classes, class methods and fields in a given class before the compile time can be applied to an aspect as well.
    Thank you for your time to think about my question.
    public aspect PointShadowProtocolAspect {
         private int shadowCount=0;
         public static Shadow getShadow(Point p){
              Shadow s=new Shadow(p.x,p.y);
              return s;
         pointcut setting(Point p): target(p)&&call(Point.new(int,int));
         pointcut settingX(Point p):target(p)&&call(void Point.setX(int));
         pointcut settingY(Point p):target(p)&&call(void Point.setY(int));
         after(Point p): setting(p){
              Shadow s=new Shadow(p.x,p.y);
              shadowCount++;
         after(Point p):settingX(p){
              Shadow s=getShadow(p);
              s.x=p.getX()+Shadow.offset;
              p.printPosition();
              s.printPosition();
         after(Point p):settingY(p){
              Shadow s=getShadow(p);
              s.y=p.getY()+Shadow.offset;
              p.printPosition();
              s.printPosition();

  • I have added a 5 songs from a single album and in Ipod it comes as enigma album and in that one song is available and another album named enigma and another song. IT happens for 5 songs also. How to make all the 5 songs in one album name Enigma

    I have added a 5 songs from a single album and in Ipod it comes as enigma album and in that one song is available and another album named enigma and another song. IT happens for 5 songs also. How to make all the 5 songs in one album name Enigma???

    I am working on a friend of mine's 15g ipod(W/dock connector)and I am having the same trouble except it does it to all the songs. I have tried reseting it multiple times, but to no avail.
    I am not sure that this runs on windows XP, it is absolutly archaic (compared to my 5th gen. 30g video).
    Help?
    15g ipod (w/dock connector)   Windows XP  
      Windows XP  

  • What are "Name$1.class" files and how do I generate them in Eclipse

    I have the source code of a rather large java application and I want to set up an Eclipse project for it.
    After diffing the WEB-INF directory generated by Eclipse with the one generated by the original maven build script I noticed that there are several files of the form "Name$1.class" which do not exist in the Eclipse output.
    My questions are, what is the purpose of this $1 string in the class file name and how do I generate those in Eclipse?

    ok, but why are they generated in the Maven environment but not in the Eclipse environment?
    To be exact, Eclipse does create inner class files, however when diffing both output directories I have some extra inner class files generated by Maven that are not there in the Eclipse output.
    Maybe there are some java compiler settings for this?

  • If I know a name of class , how can I get it's attribute and methods

    If I know a name of class , how can I get it's attribute and methods as well as it's detail information by ABAP code ?
    Best regards ,

    HI, Chandra ,
    Thank you very much , I can get the result
    Best regards,
    DATA lo_class TYPE REF TO cl_oo_class.
    DATA lt_attribs TYPE seo_attributes.
    FIELD-SYMBOLS: <attrib> TYPE vseoattrib.
    TRY.
        CREATE OBJECT lo_class
          EXPORTING
            clsname = 'CLASS_NAME'.
      CATCH cx_class_not_existent .
    ENDTRY.
    lt_attribs = lo_class->get_attributes( ).
    BREAK-POINT.

  • HT6154 I lost all names to my contacts numbers. How do I get them back?

    I lost all names to my contacts numbers. How do I get them back?

    Restore from your last backup.

  • How to extract all the list of reports names available in the WEBI public?

    can anyone please help me how  to extract all the list of reports names which are available in the WEBI Public folder?
    I ran the VB macro downloaded from net but that is extracting all crystal,deski & webi reports..
    but i want only webi list of reports..
    Please help me to achieve this?
    Thanks
    Radha

    Is this about Business Objects WEBI? You might want to post in the BOBJ forums instead.[BOBJ Forums|/community [original link is broken];

  • How to find Ledger, LE, Op units, Org(All) names and IDs ?????

    How to find Ledger, LE, Op units, Org(All) names and IDs ?????
    Regards:
    Shahzad M. Saleem

    Dear Rajen!!
    How can i link GL_SETS_OF_BOOKS  & XLE_ENTITY_PROFILES ??? as Gl Sets of books has ledger ID whereas XLE_ENTITY_PROFILES has legal entity id???
    I want All LE and all of there ledgers, units and orgs.
    Regards:
    Shahzad M. Saleem

Maybe you are looking for

  • Office Web Apps - working in other browsers but not Internet Explorer

    Hi there, I have office web apps on my SharePoint 2013 environment.  The previews work file when hovering next to a document but if I try to open it, I get "Sorry, we ran into a problem".  It looks as though Excel files open okay but I have tested Wo

  • I did the Downgrade to 10.7 / How to fix the 42408 error?

    I did the downgrade iTunes to 10.7 (Because everybody who is into organizing the library knows that iTunes11 *****) And im getting this 42408 error? How to fix it? i really need to Authorize the computer. I want to sync my iPod and all the Apps. I di

  • Use of assertion

    will any body plz tell me the practical use of assertion, coz already made 5 or 6 projects on core, 1 chat messanger on swing + now i m going to prepare editor. But i don't c any practical usage of assertion. will i have to wait untill i got big proj

  • Lightroom 2.7 not responding

    Hi, I use Windows 7 - 64 bit OS and Lightroom 2.7. Frequently, when I'm on develop module, I get a message (on title bar in parenthesis) "not responding", which is usually followed by flickering of screen and sometimes screen gets frozen. Any suggest

  • Samsung N150 Verizon mini + adding Virgin mobile broadband 3g USB

    I got the Verizon mini notebook 2 days ago and am having a heck of a time connecting my Virgin mobile broadband 3g USB adapter. I disabled the laptop network card and I followed Virgin's directions and still no internet access. I cannot get a hold of