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 Type
    Method
    Description
    Determine the annotation type for the given piece of text (typically a line of source code).
    org.prop4j.Node
    Parse the condition of the given text containing an annotation (typically a line of source code).
  • Method Details

    • determineAnnotationType

      AnnotationType determineAnnotationType(String text)
      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

      org.prop4j.Node parseAnnotation(String text) throws UnparseableFormulaException
      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.