Class SnippetMacro
java.lang.Object
org.apache.maven.doxia.macro.AbstractMacro
org.apache.maven.doxia.macro.snippet.SnippetMacro
- All Implemented Interfaces:
Macro
A macro that prints out the (source code) content of a file or a URL.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
cacheSnippet
(URL url, String id, String content) Puts the given snippet into the cache.void
execute
(org.apache.maven.doxia.sink.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
getAttributesFromMap
-
Constructor Details
-
SnippetMacro
public SnippetMacro()
-
-
Method Details
-
execute
public void execute(org.apache.maven.doxia.sink.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
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.
-