Package org.apache.maven.doxia.macro
Class AbstractMacro
- java.lang.Object
-
- org.apache.maven.doxia.macro.AbstractMacro
-
- All Implemented Interfaces:
LogEnabled,Macro
- Direct Known Subclasses:
EchoMacro,SnippetMacro,SsiMacro,SwfMacro,TocMacro
public abstract class AbstractMacro extends java.lang.Object implements Macro
Abstract base class to executeMacro.- Since:
- 1.0
- Version:
- $Id: AbstractMacro.java 1726411 2016-01-23 16:34:09Z hboutemy $
- Author:
- Jason van Zyl
-
-
Constructor Summary
Constructors Constructor Description AbstractMacro()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidenableLogging(Log log)Enable aDoxialogger for thisDoxiacomponent.protected static SinkEventAttributesgetAttributesFromMap(java.util.Map<?,?> parameters)Convert the Map of macro parameters to an AttributeSet.protected LoggetLog()Returns a logger for this macro.protected voidrequired(java.lang.String paramName, java.lang.String paramValue)Check if the given parameter is required.
-
-
-
Method Detail
-
enableLogging
public void enableLogging(Log log)
Enable aDoxialogger for thisDoxiacomponent.- Specified by:
enableLoggingin interfaceLogEnabled- Parameters:
log- a Log.
-
getLog
protected Log getLog()
Returns a logger for this macro. If no logger has been configured, a new SystemStreamLog is returned.- Returns:
- Log
- Since:
- 1.1
-
required
protected void required(java.lang.String paramName, java.lang.String paramValue)Check if the given parameter is required. Throws an IllegalArgumentException if paramValue is null or empty.- Parameters:
paramName- The name of the parameter to check.paramValue- The parameter value.- Since:
- 1.1
-
getAttributesFromMap
protected static SinkEventAttributes getAttributesFromMap(java.util.Map<?,?> parameters)
Convert the Map of macro parameters to an AttributeSet. No check of validity is done, all parameters are added.- Parameters:
parameters- the macro parameters.- Returns:
- a SinkEventAttributeSet containing the same parameters, or null if parameters is null.
- Since:
- 1.1.1.
-
-