Class SnippetReader
java.lang.Object
org.apache.maven.doxia.macro.snippet.SnippetReader
Utility class for reading snippets.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSnippetReader(URL src) Constructor.SnippetReader(URL src, String encoding) Constructor. -
Method Summary
Modifier and TypeMethodDescription(package private) intReturns the indent of the given line.protected static booleanisDemarcator(String snippetId, String what, String line) Determines if the given line is a demarcator.protected booleanDetermines if the given line is an end demarcator.protected booleanDetermines if the given line is a start demarcator.(package private) intReturns the minimal indent of all the lines in the given List.Reads the snippet and returns the lines in a List.readSnippet(String snippetId) Reads the snippet with given id.
-
Field Details
-
EOL
System-dependent EOL. -
source
The source. -
encoding
The encoding of the source.
-
-
Constructor Details
-
SnippetReader
-
SnippetReader
-
-
Method Details
-
readSnippet
Reads the snippet with given id.- Parameters:
snippetId- The id of the snippet.- Returns:
- The snippet.
- Throws:
IOException- if something goes wrong.
-
minIndent
-
indent
Returns the indent of the given line.- Parameters:
line- A line.- Returns:
- the indent.
-
readLines
Reads the snippet and returns the lines in a List.- Parameters:
snippetId- The id of the snippet.- Returns:
- A List of lines.
- Throws:
IOException- if something goes wrong.
-
isStart
-
isDemarcator
-
isEnd
-