Class JavaSourceCodeReaderLowlevel
java.lang.Object
io.github.mmm.scanner.AbstractCharStreamScanner
io.github.mmm.scanner.CharReaderScanner
io.github.mmm.code.impl.java.parser.JavaSourceCodeReaderLowlevel
- All Implemented Interfaces:
io.github.mmm.base.text.TextFormatProcessor,io.github.mmm.base.text.TextPosition,io.github.mmm.scanner.CharStreamScanner,AutoCloseable
- Direct Known Subclasses:
JavaSourceCodeReaderHighlevel
public abstract class JavaSourceCodeReaderLowlevel
extends io.github.mmm.scanner.CharReaderScanner
Wrapper for a
Reader with internal char buffer to read and parse textual data.- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<io.github.mmm.code.api.annotation.CodeAnnotation> protected final List<io.github.mmm.code.api.comment.CodeComment> ListofCodeComments collected whilst parsing.protected io.github.mmm.code.api.comment.CodeCommentprotected BaseFileThe currentBaseFileto parse.Listof plain JavaDoc lines collected whilst parsing.Fields inherited from class io.github.mmm.scanner.CharReaderScanner
positionFields inherited from class io.github.mmm.scanner.AbstractCharStreamScanner
buffer, column, limit, line, offsetFields inherited from interface io.github.mmm.scanner.CharStreamScanner
EOS -
Constructor Summary
ConstructorsConstructorDescriptionThe constructor.JavaSourceCodeReaderLowlevel(int capacity) The constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidClears all collected comments, annotations and javaDocs.voidconsume()Consumes all standard text like spaces, comments, JavaDoc and annotationsList<io.github.mmm.code.api.annotation.CodeAnnotation> List<io.github.mmm.code.api.comment.CodeComment> io.github.mmm.code.api.comment.CodeCommentprotected Stringprotected io.github.mmm.code.api.modifier.CodeModifiersparseModifiers(boolean inInterface) protected Stringprotected voidSkips all whitespaces and parses allCodeComments.protected voidreset()Methods inherited from class io.github.mmm.scanner.CharReaderScanner
close, expect, expectRestWithLookahead, fill, getBufferToParse, getPosition, isEob, isEos, isEot, peek, peekString, peekWhile, setReader, verifyLookaheadMethods inherited from class io.github.mmm.scanner.AbstractCharStreamScanner
addMessage, append, builder, eot, expectOne, expectOne, expectUnsafe, getAppended, getBufferParsed, getColumn, getLine, getMessages, handleChar, hasNext, next, peek, read, read, readDigit, readDouble, readFloat, readInteger, readJavaCharLiteral, readJavaNumberLiteral, readJavaStringLiteral, readLine, readLong, readNumber, readUnsignedLong, readUntil, readUntil, readUntil, readUntil, readUntil, readUntil, readWhile, require, requireMin, setOffset, skip, skipNewLine, skipOver, skipUntil, skipUntil, skipWhile, skipWhile, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.mmm.scanner.CharStreamScanner
expect, expect, expect, expect, expectOne, expectUnsafe, peekUntil, readBoolean, readBoolean, readBoolean, readDigit, readDouble, readFloat, readInteger, readJavaCharLiteral, readJavaStringLiteral, readLine, readLong, readUntil, readUntil, readUntil, readWhile, require, require, requireOne, requireOne, requireOneOrMore, skipOver, skipOver, skipWhile, skipWhileAndPeek, skipWhileAndPeekMethods inherited from interface io.github.mmm.base.text.TextFormatProcessor
addError, addInfo, addMessage, addWarning
-
Field Details
-
Constructor Details
-
JavaSourceCodeReaderLowlevel
public JavaSourceCodeReaderLowlevel()The constructor. -
JavaSourceCodeReaderLowlevel
public JavaSourceCodeReaderLowlevel(int capacity) The constructor.- Parameters:
capacity- the buffer capacity.
-
-
Method Details
-
reset
protected void reset()- Overrides:
resetin classio.github.mmm.scanner.CharReaderScanner
-
clearConsumeState
protected void clearConsumeState()Clears all collected comments, annotations and javaDocs. -
getComments
-
getElementComment
public io.github.mmm.code.api.comment.CodeComment getElementComment()- Returns:
- the
CodeCommentfor the currently parsed "element" (type, member, etc.) parsed by the last invocation ofconsume().
-
getJavaDocLines
-
getAnnotations
-
consume
public void consume()Consumes all standard text like spaces, comments, JavaDoc and annotations -
parseWhitespacesAndComments
protected void parseWhitespacesAndComments()Skips all whitespaces and parses allCodeComments. -
parseIdentifier
- Returns:
- the current identifier or
nullif not pointing to such.
-
parseQName
- Returns:
- the current (qualified) name or
nullif not pointing to such.
-
parseModifiers
protected io.github.mmm.code.api.modifier.CodeModifiers parseModifiers(boolean inInterface) - Parameters:
inInterface- -trueif in the context of an interface (where public is the default),falseotherwise.- Returns:
- the parsed
CodeModifiers.
-