@Override public JExpression injectMagic( TreeLogger logger, JMethodCall methodCall, JMethod currentMethod, Context context, UnifyAstView ast) throws UnableToCompleteException { if (methodCall.getArgs().size() != 1) { logger.log( Type.ERROR, "X_Reflect.magicClass accepts one and only one argument: a class literal."); throw new UnableToCompleteException(); } if (!(methodCall.getArgs().get(0) instanceof JClassLiteral)) { logger.log( Type.ERROR, "X_Reflect.magicClass accepts one and only one argument: a class literal." + " You sent a " + methodCall.getArgs().get(0).getClass() + " : " + methodCall.getArgs().get(0).toSource()); throw new UnableToCompleteException(); } JClassLiteral clazz = (JClassLiteral) methodCall.getArgs().get(0); return mappedClasses.get( clazz.getRefType().getName(), new ReflectionGeneratorContext(logger, clazz, methodCall, currentMethod, context, ast)); }
public String GetInitCommand(String req) { return InitMap.get(req); }