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
Abstract base class to execute
Macro
.- Since:
- 1.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
enableLogging
(Log log) Enable aDoxia
logger for thisDoxia
component.protected static SinkEventAttributes
getAttributesFromMap
(Map<?, ?> parameters) Convert the Map of macro parameters to an AttributeSet.protected Log
getLog()
Returns a logger for this macro.protected void
Check if the given parameter is required.
-
Field Details
-
logger
Log instance.
-
-
Constructor Details
-
AbstractMacro
public AbstractMacro()
-
-
Method Details
-
enableLogging
Enable aDoxia
logger for thisDoxia
component.- Specified by:
enableLogging
in interfaceLogEnabled
- Parameters:
log
- a 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
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
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.
-