Class SnippetMacro
- java.lang.Object
-
- org.apache.maven.doxia.macro.AbstractMacro
-
- org.apache.maven.doxia.macro.snippet.SnippetMacro
-
- All Implemented Interfaces:
LogEnabled
,Macro
@Component(role=Macro.class, hint="snippet") public class SnippetMacro extends AbstractMacro
A macro that prints out the content of a file or a URL.- Version:
- $Id: SnippetMacro.java 1726411 2016-01-23 16:34:09Z hboutemy $
-
-
Constructor Summary
Constructors Constructor Description SnippetMacro()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cacheSnippet(java.net.URL url, java.lang.String id, java.lang.String content)
Puts the given snippet into the cache.void
execute(Sink sink, MacroRequest request)
Execute the current macro using the given MacroRequest, and emit events into the given sink.void
setCacheTimeout(int time)
Set the cache timeout.-
Methods inherited from class org.apache.maven.doxia.macro.AbstractMacro
enableLogging, getAttributesFromMap, getLog, required
-
-
-
-
Method Detail
-
execute
public void execute(Sink sink, MacroRequest request) throws MacroExecutionException
Execute the current macro using the given MacroRequest, and emit events into the given sink.- Parameters:
sink
- The sink to receive the events.request
- The corresponding MacroRequest.- Throws:
MacroExecutionException
- if an error occurred during execution.
-
cacheSnippet
public void cacheSnippet(java.net.URL url, java.lang.String id, java.lang.String content)
Puts the given snippet into the cache.- Parameters:
url
- The URL to parse.id
- The id of the snippet.content
- The content of the snippet.
-
setCacheTimeout
public void setCacheTimeout(int time)
Set the cache timeout.- Parameters:
time
- The timeout to set.
-
-