Created
December 28, 2016 00:46
-
-
Save RainWarrior/5e9cd7d2eebe8600f54c1606f33ce9da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private class T extends ClassLoader { | |
@Override | |
protected Class<?> findClass(String name) throws ClassNotFoundException | |
{ | |
ClassNode node = readClassNode(name); | |
// better actual set of default composable contexts | |
for (MethodNode m: node.methods) { | |
// set in the list, you know what I mean | |
m = transform(new WholeMethodContext(m)); | |
} | |
for (FieldNode f : node.fields) { | |
f = transform(new WholeFieldContext(f)); | |
} | |
node = transform(new FullClassContext(node)); | |
return makeClass(node); | |
} | |
void transform(IContext c) { | |
if(moreThan1Transformer(c)) { | |
throw new IllegalStateException(); | |
} | |
if(oneTransformer(c)) { | |
getTransformer(c).run(c); | |
} | |
} | |
} | |
class FancyPredicateMethodContext implements ITransformer { | |
// defines its own set of sub-method contexts, loads all of them and does things to manage conflicts inside run() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment