Class BaseImport
java.lang.Object
io.github.mmm.code.base.item.BaseItem
io.github.mmm.code.base.imports.BaseImport
- All Implemented Interfaces:
io.github.mmm.code.api.imports.CodeImport, io.github.mmm.code.api.item.CodeItem, Comparable<BaseImport>
public class BaseImport
extends BaseItem
implements io.github.mmm.code.api.imports.CodeImport, Comparable<BaseImport>
Base implementation of
CodeImport.- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
-
Field Summary
Fields inherited from interface io.github.mmm.code.api.item.CodeItem
DEFAULT_INDENT, DEFAULT_NEWLINE -
Constructor Summary
ConstructorsConstructorDescriptionBaseImport(String reference, boolean staticFlag) The constructor.BaseImport(String reference, boolean staticFlag, List<io.github.mmm.code.api.imports.CodeImportItem> items) The constructor. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(BaseImport other) protected voiddoWrite(Appendable sink, String newline, String defaultIndent, String currentIndent, io.github.mmm.code.api.language.CodeLanguage language) booleanList<io.github.mmm.code.api.imports.CodeImportItem> getItems()inthashCode()booleanisStatic()Methods inherited from class BaseItem
getOwningType, getSourceCode, getSpaces, toString, writeMethods inherited from interface io.github.mmm.code.api.item.CodeItem
getLanguage, getSourceCode, write, write, write, write, write, write
-
Constructor Details
-
BaseImport
-
BaseImport
-
-
Method Details
-
hashCode
-
equals
-
compareTo
- Specified by:
compareToin interfaceComparable<BaseImport>
-
getReference
- Specified by:
getReferencein interfaceio.github.mmm.code.api.imports.CodeImport
-
isStatic
public boolean isStatic()- Specified by:
isStaticin interfaceio.github.mmm.code.api.imports.CodeImport
-
getItems
- Specified by:
getItemsin interfaceio.github.mmm.code.api.imports.CodeImport
-
doWrite
protected void doWrite(Appendable sink, String newline, String defaultIndent, String currentIndent, io.github.mmm.code.api.language.CodeLanguage language) throws IOException - Specified by:
doWritein classBaseItem- Parameters:
sink- theAppendablewhere toappendthe code from thisCodeItem.newline- the newlineString.defaultIndent- theStringused 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 thedefaultIndentwill be appended.language- theCodeLanguageto use.- Throws:
IOException- if thrown byAppendable.- See Also:
-