Interface SourceType
- All Known Implementing Classes:
JavaSourceType, NoneSourceType
public interface SourceType
Source file type.
- Author:
- harald
-
Method Summary
Modifier and TypeMethodDescriptionextractProperties(SourceDocument document) Extract properties for given file.static SourceTypeGets the source type of given extension.static Collection<SourceType> getAll()Gets all registered source types.Gets the file extension (including the dot).default booleanReturns whether this is the default source type.default booleanReturns whether generated code should be generated with smart indent.
With smart indent, the generated code will be aligned with the comment block containing the wurblet anchor.
-
Method Details
-
getFileExtension
String getFileExtension()Gets the file extension (including the dot).- Returns:
- the extension, never null
-
extractProperties
Extract properties for given file.- Parameters:
document- the source document- Returns:
- the properties, never null
-
isDefault
default boolean isDefault()Returns whether this is the default source type.- Returns:
- true if default
-
isSmartIndent
default boolean isSmartIndent()Returns whether generated code should be generated with smart indent.
With smart indent, the generated code will be aligned with the comment block containing the wurblet anchor.- Returns:
- true if smart indent
-
getAll
-
get
Gets the source type of given extension.- Parameters:
extension- the file extension, null if default type- Returns:
- the source type
- Throws:
WurbelException- if no matching source type configured
-