Package org.apache.camel.dsl.modeline
Class DefaultModelineParser
java.lang.Object
org.apache.camel.dsl.modeline.DefaultModelineParser
- All Implemented Interfaces:
ModelineParser
-
Field Summary
Fields -
Constructor Summary
Constructors -
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 viaTraitsprotected List<org.apache.camel.spi.CamelContextCustomizer> parseModeline(org.apache.camel.spi.Resource resource, String key, String value) A modeline was detected while parsing
-
Field Details
-
MODELINE_START
- See Also:
-
JBANG_DEPS_START
- See Also:
-
-
Constructor Details
-
DefaultModelineParser
public DefaultModelineParser()
-
-
Method Details
-
addTrait
Description copied from interface:ModelineParserAdds theTraitto the parser- Specified by:
addTraitin interfaceModelineParser- Parameters:
trait- the trait
-
parse
public List<org.apache.camel.spi.CamelContextCustomizer> parse(org.apache.camel.spi.Resource resource) throws Exception Description copied from interface:ModelineParserParses the resource to detect modelines and process them viaTraits- Specified by:
parsein interfaceModelineParser- Parameters:
resource- the source code resource- Returns:
- list of
CamelContextCustomizercustomizers that processes the modelines - Throws:
Exception- is thrown if error during parsing
-
parse
-
parseModeline
Description copied from interface:ModelineParserA modeline was detected while parsing- Specified by:
parseModelinein interfaceModelineParser- Parameters:
resource- the resourcekey- the mode line keyvalue- the mode line value- Returns:
- the trait that handles the detected modeline
-
isModeline
Description copied from interface:ModelineParserIs the given source code line a modeline?- Specified by:
isModelinein interfaceModelineParser- Parameters:
line- the source code line- Returns:
- true if modeline, false if not
-