From 04eeede1f0d4e9a9e3947f08d537b378a84aaeb9 Mon Sep 17 00:00:00 2001 From: zt515 Date: Tue, 26 Dec 2017 01:00:14 +0800 Subject: [PATCH] Codegen: Rename classes --- .../io/neoterm/component/codegen/CodeGenComponent.kt | 4 ++-- .../codegen/generators/NeoColorGenerator.kt | 4 ++-- .../codegen/generators/NeoProfileGenerator.kt | 4 ++-- .../component/codegen/interfaces/CodeGenObject.kt | 3 +-- .../component/codegen/interfaces/ICodeGenerator.kt | 12 ------------ .../neoterm/component/colorscheme/NeoColorScheme.kt | 4 ++-- .../java/io/neoterm/component/profile/NeoProfile.kt | 4 ++-- 7 files changed, 11 insertions(+), 24 deletions(-) delete mode 100644 app/src/main/java/io/neoterm/component/codegen/interfaces/ICodeGenerator.kt diff --git a/app/src/main/java/io/neoterm/component/codegen/CodeGenComponent.kt b/app/src/main/java/io/neoterm/component/codegen/CodeGenComponent.kt index 5b78e15..107ac6c 100644 --- a/app/src/main/java/io/neoterm/component/codegen/CodeGenComponent.kt +++ b/app/src/main/java/io/neoterm/component/codegen/CodeGenComponent.kt @@ -1,6 +1,6 @@ package io.neoterm.component.codegen -import io.neoterm.component.codegen.interfaces.ICodeGenerator +import io.neoterm.component.codegen.interfaces.CodeGenerator import io.neoterm.component.codegen.interfaces.CodeGenObject import io.neoterm.frontend.component.NeoComponent @@ -17,7 +17,7 @@ class CodeGenComponent : NeoComponent { override fun onServiceObtained() { } - fun newGenerator(codeObject: CodeGenObject): ICodeGenerator { + fun newGenerator(codeObject: CodeGenObject): CodeGenerator { val parameter = CodeGenParameter() return codeObject.getCodeGenerator(parameter) } diff --git a/app/src/main/java/io/neoterm/component/codegen/generators/NeoColorGenerator.kt b/app/src/main/java/io/neoterm/component/codegen/generators/NeoColorGenerator.kt index 76bb6ab..5ff9766 100644 --- a/app/src/main/java/io/neoterm/component/codegen/generators/NeoColorGenerator.kt +++ b/app/src/main/java/io/neoterm/component/codegen/generators/NeoColorGenerator.kt @@ -1,7 +1,7 @@ package io.neoterm.component.codegen.generators import io.neoterm.component.codegen.CodeGenParameter -import io.neoterm.component.codegen.interfaces.ICodeGenerator +import io.neoterm.component.codegen.interfaces.CodeGenerator import io.neoterm.component.codegen.interfaces.CodeGenObject import io.neoterm.component.colorscheme.NeoColorScheme import io.neoterm.component.config.ConfigureComponent @@ -10,7 +10,7 @@ import io.neoterm.frontend.component.ComponentManager /** * @author kiva */ -class NeoColorGenerator(parameter: CodeGenParameter) : ICodeGenerator(parameter) { +class NeoColorGenerator(parameter: CodeGenParameter) : CodeGenerator(parameter) { override fun getGeneratorName(): String { return "NeoColorScheme-Generator" } diff --git a/app/src/main/java/io/neoterm/component/codegen/generators/NeoProfileGenerator.kt b/app/src/main/java/io/neoterm/component/codegen/generators/NeoProfileGenerator.kt index a230d4c..0d46114 100644 --- a/app/src/main/java/io/neoterm/component/codegen/generators/NeoProfileGenerator.kt +++ b/app/src/main/java/io/neoterm/component/codegen/generators/NeoProfileGenerator.kt @@ -1,13 +1,13 @@ package io.neoterm.component.codegen.generators import io.neoterm.component.codegen.CodeGenParameter -import io.neoterm.component.codegen.interfaces.ICodeGenerator +import io.neoterm.component.codegen.interfaces.CodeGenerator import io.neoterm.component.codegen.interfaces.CodeGenObject /** * @author kiva */ -class NeoProfileGenerator(parameter: CodeGenParameter) : ICodeGenerator(parameter) { +class NeoProfileGenerator(parameter: CodeGenParameter) : CodeGenerator(parameter) { override fun getGeneratorName(): String { return "NeoProfile-Generator" } diff --git a/app/src/main/java/io/neoterm/component/codegen/interfaces/CodeGenObject.kt b/app/src/main/java/io/neoterm/component/codegen/interfaces/CodeGenObject.kt index a0717e7..e613ba1 100644 --- a/app/src/main/java/io/neoterm/component/codegen/interfaces/CodeGenObject.kt +++ b/app/src/main/java/io/neoterm/component/codegen/interfaces/CodeGenObject.kt @@ -1,11 +1,10 @@ package io.neoterm.component.codegen.interfaces import io.neoterm.component.codegen.CodeGenParameter -import io.neoterm.component.codegen.interfaces.ICodeGenerator /** * @author kiva */ interface CodeGenObject { - fun getCodeGenerator(parameter: CodeGenParameter): ICodeGenerator + fun getCodeGenerator(parameter: CodeGenParameter): CodeGenerator } \ No newline at end of file diff --git a/app/src/main/java/io/neoterm/component/codegen/interfaces/ICodeGenerator.kt b/app/src/main/java/io/neoterm/component/codegen/interfaces/ICodeGenerator.kt deleted file mode 100644 index 73cb3c1..0000000 --- a/app/src/main/java/io/neoterm/component/codegen/interfaces/ICodeGenerator.kt +++ /dev/null @@ -1,12 +0,0 @@ -package io.neoterm.component.codegen.interfaces - -import io.neoterm.component.codegen.CodeGenParameter - -/** - * @author kiva - */ -abstract class ICodeGenerator(parameter: CodeGenParameter) { - abstract fun getGeneratorName(): String - - abstract fun generateCode(codeGenObject: CodeGenObject): String -} diff --git a/app/src/main/java/io/neoterm/component/colorscheme/NeoColorScheme.kt b/app/src/main/java/io/neoterm/component/colorscheme/NeoColorScheme.kt index 7fd1918..38af512 100644 --- a/app/src/main/java/io/neoterm/component/colorscheme/NeoColorScheme.kt +++ b/app/src/main/java/io/neoterm/component/colorscheme/NeoColorScheme.kt @@ -4,7 +4,7 @@ import io.neolang.visitor.ConfigVisitor import io.neoterm.backend.TerminalColorScheme import io.neoterm.backend.TerminalColors import io.neoterm.component.codegen.CodeGenParameter -import io.neoterm.component.codegen.interfaces.ICodeGenerator +import io.neoterm.component.codegen.interfaces.CodeGenerator import io.neoterm.component.codegen.interfaces.CodeGenObject import io.neoterm.component.codegen.generators.NeoColorGenerator import io.neoterm.component.config.ConfigureComponent @@ -156,7 +156,7 @@ open class NeoColorScheme : CodeGenObject, ConfigFileBasedObject { } } - override fun getCodeGenerator(parameter: CodeGenParameter): ICodeGenerator { + override fun getCodeGenerator(parameter: CodeGenParameter): CodeGenerator { return NeoColorGenerator(parameter) } diff --git a/app/src/main/java/io/neoterm/component/profile/NeoProfile.kt b/app/src/main/java/io/neoterm/component/profile/NeoProfile.kt index 507c213..201f2c9 100644 --- a/app/src/main/java/io/neoterm/component/profile/NeoProfile.kt +++ b/app/src/main/java/io/neoterm/component/profile/NeoProfile.kt @@ -1,7 +1,7 @@ package io.neoterm.component.profile import io.neoterm.component.codegen.CodeGenParameter -import io.neoterm.component.codegen.interfaces.ICodeGenerator +import io.neoterm.component.codegen.interfaces.CodeGenerator import io.neoterm.component.codegen.generators.NeoProfileGenerator import io.neoterm.component.codegen.interfaces.CodeGenObject import io.neoterm.frontend.component.helper.ConfigFileBasedObject @@ -12,7 +12,7 @@ import io.neoterm.frontend.component.helper.ConfigFileBasedObject abstract class NeoProfile : CodeGenObject, ConfigFileBasedObject { abstract val profileMetaName: String - override fun getCodeGenerator(parameter: CodeGenParameter): ICodeGenerator { + override fun getCodeGenerator(parameter: CodeGenParameter): CodeGenerator { return NeoProfileGenerator(parameter) } } \ No newline at end of file