|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.maven.doxia.parser.AbstractParser
org.apache.maven.doxia.parser.AbstractTextParser
org.apache.maven.doxia.module.apt.AptParser
public class AptParser
The APT parser.
Based on the APTconvert project.
Field Summary | |
---|---|
protected java.lang.String |
line
a line of AptSource. |
protected Sink |
sink
the sink to receive the events. |
protected java.lang.String |
sourceContent
sourceContent. |
protected static char[] |
SPACES
An array of 85 spaces. |
static int |
TAB_WIDTH
Default tab width. |
protected java.util.Map |
warnMessages
Map of warn messages with a String as key to describe the error type and a Set as value. |
Fields inherited from interface org.apache.maven.doxia.markup.TextMarkup |
---|
PIPE |
Fields inherited from interface org.apache.maven.doxia.markup.Markup |
---|
COLON, EOL, EQUAL, GREATER_THAN, LEFT_CURLY_BRACKET, LEFT_SQUARE_BRACKET, LESS_THAN, MINUS, PLUS, QUOTE, RIGHT_CURLY_BRACKET, RIGHT_SQUARE_BRACKET, SEMICOLON, SLASH, SPACE, STAR |
Fields inherited from interface org.apache.maven.doxia.parser.Parser |
---|
ROLE, TXT_TYPE, UNKNOWN_TYPE, XML_TYPE |
Constructor Summary | |
---|---|
AptParser()
|
Method Summary | |
---|---|
protected static char |
charAt(java.lang.String string,
int length,
int i)
Returns the character at position i of the given string. |
protected void |
doTraverseText(java.lang.String text,
int begin,
int end,
Sink sink)
Parse the given text. |
int |
getSourceLineNumber()
Returns the current line number of the Apt source document. |
java.lang.String |
getSourceName()
Returns the name of the Apt source document. |
protected void |
nextLine()
Parse the next line of the Apt source document. |
void |
parse(java.io.Reader source,
Sink sink)
Parses the given source model and emits Doxia events into the given sink. |
protected static java.lang.String |
replaceAll(java.lang.String string,
java.lang.String oldSub,
java.lang.String newSub)
Replace part of a string. |
protected static int |
skipSpace(java.lang.String string,
int length,
int i)
Skip spaces. |
Methods inherited from class org.apache.maven.doxia.parser.AbstractTextParser |
---|
getType |
Methods inherited from class org.apache.maven.doxia.parser.AbstractParser |
---|
enableLogging, executeMacro, getBasedir, getLog, getMacroManager, isSecondParsing, parse, setSecondParsing |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final char[] SPACES
public static final int TAB_WIDTH
protected java.lang.String sourceContent
protected Sink sink
protected java.lang.String line
protected java.util.Map warnMessages
Constructor Detail |
---|
public AptParser()
Method Detail |
---|
public void parse(java.io.Reader source, Sink sink) throws ParseException
parse
in interface Parser
source
- not null reader that provides the source document.
You could use newReader
methods from org.codehaus.plexus.util.ReaderFactory
.sink
- A sink that consumes the Doxia events.
ParseException
- if the model could not be parsed.public java.lang.String getSourceName()
public int getSourceLineNumber()
protected void nextLine() throws AptParseException
AptParseException
- if something goes wrong.protected void doTraverseText(java.lang.String text, int begin, int end, Sink sink) throws AptParseException
text
- the text to parse.begin
- offset.end
- offset.sink
- the sink to receive the events.
AptParseException
- if something goes wrong.protected static char charAt(java.lang.String string, int length, int i)
string
- the string.length
- length.i
- offset.
protected static int skipSpace(java.lang.String string, int length, int i)
string
- string.length
- length.i
- offset.
protected static java.lang.String replaceAll(java.lang.String string, java.lang.String oldSub, java.lang.String newSub)
string
- the stringoldSub
- the substring to replacenewSub
- the replacement string
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |