org.apache.maven.doxia.macro.snippet
Class SnippetReader

java.lang.Object
  extended by org.apache.maven.doxia.macro.snippet.SnippetReader

public class SnippetReader
extends Object

Utility class for reading snippets.

Version:
$Id: SnippetReader.java 1172204 2011-09-18 06:46:17Z hboutemy $

Constructor Summary
SnippetReader(URL src)
          Constructor.
 
Method Summary
protected  boolean isDemarcator(String snippetId, String what, String line)
          Determines if the given line is a demarcator.
protected  boolean isEnd(String snippetId, String line)
          Determines if the given line is an end demarcator.
protected  boolean isStart(String snippetId, String line)
          Determines if the given line is a start demarcator.
 StringBuffer readSnippet(String snippetId)
          Reads the snippet with given id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SnippetReader

public SnippetReader(URL src)
Constructor.

Parameters:
src - The source.
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 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.

isEnd

protected boolean isEnd(String snippetId,
                        String line)
Determines if the given line is an end demarcator.

Parameters:
snippetId - the id of the snippet.
line - the line.
Returns:
True, if the line is an end demarcator.


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.