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

20
LINES

< > BotCompany Repo | #1027775 // metaTransformer_transformableAndList

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2635L/17K).

1  
// MetaTransformer that understands Transformable and List
2  
static MetaTransformer metaTransformer_transformableAndList() {
3  
  ret new MetaTransformer(new MetaTransformer.StructureHandler() {
4  
    public O transform(O o, IF1 recurse) {
5  
      if (o cast Transformable)
6  
        ret o.transformUsing(recurse);
7  
      if (o cast L)
8  
        ret map_ping(recurse, o);
9  
      null;
10  
    }
11  
    
12  
    public void visit(O o, IVF1 recurse) {
13  
      if (o cast Visitable)
14  
        o.visitUsing(recurse);
15  
      else if (o cast L)
16  
        for ping (O x : o)
17  
          recurse.get(x);
18  
    }
19  
  });
20  
}

Author comment

Began life as a copy of #1027751

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1027775
Snippet name: metaTransformer_transformableAndList
Eternal ID of this version: #1027775/13
Text MD5: 79a51adc4e5b9b1257a0c0b2cebcb227
Transpilation MD5: 8d36b60364efe72af7c6ba92521a9ff2
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-04-17 00:32:21
Source code size: 593 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 289 / 448
Version history: 12 change(s)
Referenced in: [show references]