public void traverse()

in doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java [2392:2433]


        public void traverse() throws AptParseException {
            if (isSecondParsing()) {
                return;
            }

            final int start = text.indexOf('{');
            final int end = text.indexOf('}');

            String s = text.substring(start + 1, end);

            s = escapeForMacro(s);

            String[] params = StringUtils.split(s, "|");

            String macroId = params[0];

            Map<String, Object> parameters = new LinkedHashMap<>();

            for (int i = 1; i < params.length; i++) {
                String[] param = StringUtils.split(params[i], "=");

                if (param.length == 1) {
                    throw new AptParseException("Missing 'key=value' pair for macro parameter: " + params[i]);
                }

                String key = unescapeForMacro(param[0]);
                String value = unescapeForMacro(param[1]);

                parameters.put(key, value);
            }

            // getBasedir() does not work in multi-module builds, see DOXIA-373
            // the basedir should be injected from here, see DOXIA-224
            MacroRequest request = new MacroRequest(sourceContent, new AptParser(), parameters, getBasedir());
            try {
                AptParser.this.executeMacro(macroId, request, sink);
            } catch (MacroExecutionException e) {
                throw new AptParseException("Unable to execute macro in the APT document", e);
            } catch (MacroNotFoundException e) {
                throw new AptParseException("Unable to find macro used in the APT document", e);
            }
        }