Package org.jenkinsci.plugins.tokenmacro

Examples of org.jenkinsci.plugins.tokenmacro.TokenMacro


    }

    public Object methodMissing(String name, Object args)
            throws MacroEvaluationException, IOException, InterruptedException {
   
        TokenMacro macro = null;
        for(TokenMacro m : TokenMacro.all()) {
            if(m.acceptsMacroName(name)) {
                macro = m;
                break;
            }
        }

        if(macro == null) {
            for(TokenMacro m : ContentBuilder.getPrivateMacros()) {
                if(m.acceptsMacroName(name)) {
                    macro = m;
                    break;
                }
            }
        }

        if(macro != null) {               
            Map<String, String> argsMap = new HashMap<String, String>();
            ListMultimap<String, String> argsMultimap = ArrayListMultimap.create();
            populateArgs(args, argsMap, argsMultimap);

            // Get the build and listener from the binding.
            AbstractBuild<?, ?> build = (AbstractBuild<?, ?>)this.getBinding().getVariable("build");
            TaskListener listener = (TaskListener)this.getBinding().getVariable("listener");

            return macro.evaluate(build, listener, name, argsMap, argsMultimap);
        }
        return String.format("[Could not find content token (check your usage): %s]", name);
    }
View Full Code Here

TOP

Related Classes of org.jenkinsci.plugins.tokenmacro.TokenMacro

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.