Package org.apache.camel.dsl.modeline
Interface ModelineParser
- All Known Implementing Classes:
DefaultModelineParser
public interface ModelineParser
Modeline parser
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds theTraitto the parserbooleanisModeline(String line) 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 viaTraitsparseModeline(org.apache.camel.spi.Resource resource, String key, String value) A modeline was detected while parsing
-
Method Details
-
addTrait
Adds theTraitto the parser- Parameters:
trait- the trait
-
isModeline
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 viaTraits- Parameters:
resource- the source code resource- Returns:
- list of
CamelContextCustomizercustomizers that processes the modelines - Throws:
Exception- is thrown if error during parsing
-
parseModeline
A modeline was detected while parsing- Parameters:
resource- the resourcekey- the mode line keyvalue- the mode line value- Returns:
- the trait that handles the detected modeline
-