Interface AnnotationParser
- All Known Implementing Classes:
PreprocessorAnnotationParser
public interface AnnotationParser
Interface for a parser that analyzes annotations in parsed text. The parser is responsible for determining the type
of the annotation (see
AnnotationType
), and parsing the annotation into a Node
.
See PreprocessorAnnotationParser
for an example of how an implementation of AnnotationParser could look like.
-
Method Summary
Modifier and TypeMethodDescriptionDetermine the annotation type for the given piece of text (typically a line of source code).org.prop4j.Node
parseAnnotation
(String text) Parse the condition of the given text containing an annotation (typically a line of source code).
-
Method Details
-
determineAnnotationType
Determine the annotation type for the given piece of text (typically a line of source code).- Parameters:
text
- The text of which the type is determined.- Returns:
- The annotation type of the piece of text.
-
parseAnnotation
Parse the condition of the given text containing an annotation (typically a line of source code).- Parameters:
text
- The text containing a conditional annotation- Returns:
- The formula of the condition in the given annotation. If no such formula could be extracted, returns a Literal with the line's condition as name.
- Throws:
UnparseableFormulaException
- if there is an error while parsing.
-