Class BaseImportItem

java.lang.Object
io.github.mmm.code.base.item.BaseItem
io.github.mmm.code.base.imports.BaseImportItem
All Implemented Interfaces:
io.github.mmm.code.api.imports.CodeImportItem, io.github.mmm.code.api.item.CodeItem

public class BaseImportItem extends BaseItem implements io.github.mmm.code.api.imports.CodeImportItem
Base implementation of CodeImportItem (actually specific for TypeScript).
Since:
1.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)
  • Constructor Details

    • BaseImportItem

      public BaseImportItem(String item)
      The constructor.
      Parameters:
      item - the item.
    • BaseImportItem

      public BaseImportItem(String item, String alias)
      The constructor.
      Parameters:
      item - the item.
      alias - the alias.
  • Method Details

    • getItem

      public String getItem()
      Specified by:
      getItem in interface io.github.mmm.code.api.imports.CodeImportItem
    • getAlias

      public String getAlias()
      Specified by:
      getAlias in interface io.github.mmm.code.api.imports.CodeImportItem
    • doWrite

      protected void doWrite(Appendable sink, String newline, String defaultIndent, String currentIndent, io.github.mmm.code.api.language.CodeLanguage language) throws IOException
      Specified by:
      doWrite in class BaseItem
      Parameters:
      sink - the Appendable where to append the code from this CodeItem.
      newline - the newline String.
      defaultIndent - the String used for indentation (e.g. a number of spaces to insert per indent level).
      currentIndent - the current indent (number of spaces). Initially the empty string (""). Before a recursion the defaultIndent will be appended.
      language - the CodeLanguage to use.
      Throws:
      IOException - if thrown by Appendable.
      See Also:
      • CodeItem.write(Appendable, String, String)