Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

30
LINES

< > BotCompany Repo | #1001620 // Extract class from source snippet (developing)

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (1404L/10K/31K).

!747

m {
  static S snippetID = "#1001187", className = "Console";
  
  p {
    S text = loadSnippet(snippetID);
    S c = findClass(text, className);
    if (c == null)
      print(className + " not found in " + snippetID + ".");
    else {
      print("Found.");
      print();
      print(c);
    }
  }
  
  static S findClass(S text, S className) {
    for (L<S> c : allClasses(text)) {
      S name = getClassDeclarationName(c);
      if (eq(name, className))
        ret join(c);
        
      S result = findClass(join(getClassBody(c)), className);
      if (result != null) ret result;
    }
    
    ret null;
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, teubizvjbppd, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1001620
Snippet name: Extract class from source snippet (developing)
Eternal ID of this version: #1001620/1
Text MD5: 600d0de8de34c9b9763c538d8dacf530
Transpilation MD5: 6fbacfbe37bca74df63e6a772723b1b9
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-11-29 20:44:30
Source code size: 655 bytes / 30 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 545 / 580
Referenced in: [show references]