Package org.apache.maven.doxia.macro

Examples of org.apache.maven.doxia.macro.MacroExecutionException


                macroParameters = new HashMap<String, Object>();
            }

            if ( StringUtils.isEmpty( macroName ) )
            {
                throw new MacroExecutionException( "The '" + Attribute.NAME.toString()
                        + "' attribute for the '" + MACRO_TAG.toString() + "' tag is required." );
            }
        }
    }
View Full Code Here


                    executeMacro( macroName, request, sink );
                    sink.close();
                    buffer.append( sw.toString() );
                } catch ( MacroNotFoundException me )
                {
                    throw new MacroExecutionException( "Macro not found: " + macroName, me );
                }
            }
        }

        // Reinit macro
View Full Code Here

                String paramValue = parser.getAttributeValue( null,
                        Attribute.VALUE.toString() );

                if ( StringUtils.isEmpty( paramName ) || StringUtils.isEmpty( paramValue ) )
                {
                    throw new MacroExecutionException( "'" + Attribute.NAME.toString()
                            + "' and '" + Attribute.VALUE.toString() + "' attributes for the '" + PARAM.toString()
                            + "' tag are required inside the '" + MACRO_TAG.toString() + "' tag." );
                }

                macroParameters.put( paramName, paramValue );
View Full Code Here

        {
            snippet = getSnippet( url, encoding, id );
        }
        catch ( IOException e )
        {
            throw new MacroExecutionException( "Error reading snippet", e );
        }

        if ( verbatim )
        {
            sink.verbatim( SinkEventAttributeSet.BOXED );
View Full Code Here

        HtmlTemplateSnippet snippet;
       
        try {
            snippet = new HtmlTemplateSnippet(id, htmlUrl, paramUrl, encoding, missingValuesToEmptyStrings != null);
        } catch (IOException e) {
            throw new MacroExecutionException("Error while processing HTML snippet with template URL " + htmlUrl + " and parameter values URL " + paramUrl, e);
        }
       
        sink.rawText(snippet.toString());
    }
View Full Code Here

        CodeSnippet snippet;
       
        try {
            snippet = new CodeSnippet(id, url, encoding);
        } catch (IOException e) {
            throw new MacroExecutionException("Error while processing code snippet with source URL " + url, e);
        }
       
        if (brush != null) {
            StringBuilder params = new StringBuilder();
            params.append("brush: ").append(brush);
View Full Code Here

    @SuppressWarnings("unchecked")
    protected <T> T getParameterValue(MacroRequest request, String paramName, boolean required) throws MacroExecutionException {
        T value = (T) request.getParameter(paramName);
       
        if (required && value == null)
            throw new MacroExecutionException("'" + paramName + "' macro parameter needs to be specified");
       
        return value;
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.doxia.macro.MacroExecutionException

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.