Interface ModelineParser

All Known Implementing Classes:
DefaultModelineParser

public interface ModelineParser
Modeline parser
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addTrait(Trait trait)
    Adds the Trait to the parser
    boolean
    Is the given source code line a modeline?
    List<org.apache.camel.spi.CamelContextCustomizer>
    parse(org.apache.camel.spi.Resource resource)
    Parses the resource to detect modelines and process them via Traits
    parseModeline(org.apache.camel.spi.Resource resource, String key, String value)
    A modeline was detected while parsing
  • Method Details

    • addTrait

      void addTrait(Trait trait)
      Adds the Trait to the parser
      Parameters:
      trait - the trait
    • isModeline

      boolean isModeline(String line)
      Is the given source code line a modeline?
      Parameters:
      line - the source code line
      Returns:
      true if modeline, false if not
    • parse

      List<org.apache.camel.spi.CamelContextCustomizer> parse(org.apache.camel.spi.Resource resource) throws Exception
      Parses the resource to detect modelines and process them via Traits
      Parameters:
      resource - the source code resource
      Returns:
      list of CamelContextCustomizer customizers that processes the modelines
      Throws:
      Exception - is thrown if error during parsing
    • parseModeline

      Trait parseModeline(org.apache.camel.spi.Resource resource, String key, String value)
      A modeline was detected while parsing
      Parameters:
      resource - the resource
      key - the mode line key
      value - the mode line value
      Returns:
      the trait that handles the detected modeline