Interface SourceType

All Known Implementing Classes:
JavaSourceType, NoneSourceType

public interface SourceType
Source file type.
Author:
harald
  • Method Summary

    Modifier and Type
    Method
    Description
    Extract properties for given file.
    static SourceType
    get(String extension)
    Gets the source type of given extension.
    Gets all registered source types.
    Gets the file extension (including the dot).
    default boolean
    Returns whether this is the default source type.
    default boolean
    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.
  • Method Details

    • getFileExtension

      String getFileExtension()
      Gets the file extension (including the dot).
      Returns:
      the extension, never null
    • extractProperties

      Properties extractProperties(SourceDocument document)
      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

      static Collection<SourceType> getAll()
      Gets all registered source types.
      Returns:
      the source types
    • get

      static SourceType get(String extension) throws WurbelException
      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