Class JavaAnnotationParser
java.lang.Object
com.github.tadukoo.java.parsing.AbstractJavaParser
com.github.tadukoo.java.parsing.codetypes.JavaAnnotationParser
- All Implemented Interfaces:
JavaTokens
A parser to use for parsing
annotations in Java- Version:
- Beta v.0.5
- Author:
- Logan Ferree (Tadukoo)
-
Field Summary
Fields inherited from class com.github.tadukoo.java.parsing.AbstractJavaParser
MODIFIERS_REGEX, TOKEN_REGEX, WHITESPACE_MATCHERFields inherited from interface com.github.tadukoo.java.JavaTokens
ABSTRACT_MODIFIER, ANNOTATION_START_TOKEN, ASSIGNMENT_OPERATOR_TOKEN, BLOCK_CLOSE_TOKEN, BLOCK_OPEN_TOKEN, CLASS_TOKEN, EXTENDS_TOKEN, FINAL_MODIFIER, IMPLEMENTS_TOKEN, IMPORT_TOKEN, JAVADOC_AUTHOR_TOKEN, JAVADOC_LINE_TOKEN, JAVADOC_PARAM_TOKEN, JAVADOC_RETURN_TOKEN, JAVADOC_SINCE_TOKEN, JAVADOC_START_TOKEN, JAVADOC_VERSION_TOKEN, LIST_SEPARATOR_TOKEN, MODIFIERS, MULTI_LINE_COMMENT_CLOSE_TOKEN, MULTI_LINE_COMMENT_START_TOKEN, PACKAGE_TOKEN, PARAMETER_CLOSE_TOKEN, PARAMETER_OPEN_TOKEN, PRIVATE_MODIFIER, PROTECTED_MODIFIER, PUBLIC_MODIFIER, SEMICOLON, SINGLE_LINE_COMMENT_TOKEN, STATIC_MODIFIER, THROWS_TOKEN, VISIBILITY_MODIFIERS -
Method Summary
Modifier and TypeMethodDescriptionstatic JavaAnnotationparseAnnotation(String content) Parses the given text into anannotationif possible, or returns nullstatic ParsingPojoparseAnnotation(List<String> tokens, int startToken) Parses anannotationfrom the given tokens and starting indexMethods inherited from class com.github.tadukoo.java.parsing.AbstractJavaParser
determineFieldOrMethod, skipLeadingWhitespace, splitContentIntoTokens, verifyEndOfTokens
-
Method Details
-
parseAnnotation
public static ParsingPojo parseAnnotation(List<String> tokens, int startToken) throws JavaParsingException Parses anannotationfrom the given tokens and starting index- Parameters:
tokens- The List of tokens to be parsedstartToken- The index of the token to start parsing at- Returns:
- A
ParsingPojocontaining where we stopped parsing and theannotation - Throws:
JavaParsingException- If anything goes wrong during parsing
-
parseAnnotation
Parses the given text into anannotationif possible, or returns null- Parameters:
content- The text to be parsed into aannotation- Returns:
- The
annotationparsed from the text, ornullif it can't be parsed - Throws:
JavaParsingException- If anything goes wrong during parsing
-