Class SnippetReader
- java.lang.Object
-
- org.apache.maven.doxia.macro.snippet.SnippetReader
-
public class SnippetReader extends Object
Utility class for reading snippets.
-
-
Constructor Summary
Constructors Constructor Description SnippetReader(URL src)Constructor.SnippetReader(URL src, String encoding)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static booleanisDemarcator(String snippetId, String what, String line)Determines if the given line is a demarcator.protected booleanisEnd(String snippetId, String line)Determines if the given line is an end demarcator.protected booleanisStart(String snippetId, String line)Determines if the given line is a start demarcator.StringBufferreadSnippet(String snippetId)Reads the snippet with given id.
-
-
-
Method Detail
-
readSnippet
public StringBuffer readSnippet(String snippetId) throws IOException
Reads the snippet with given id.- Parameters:
snippetId- The id of the snippet.- Returns:
- The snippet.
- Throws:
IOException- if something goes wrong.
-
isStart
protected boolean isStart(String snippetId, String line)
Determines if the given line is a start demarcator.- Parameters:
snippetId- the id of the snippet.line- the line.- Returns:
- True, if the line is a start demarcator.
-
isDemarcator
protected static boolean isDemarcator(String snippetId, String what, String line)
Determines if the given line is a demarcator.- Parameters:
snippetId- the id of the snippet.what- Identifier for the demarcator.line- the line.- Returns:
- True, if the line is a start demarcator.
-
-