Namespace replaced by NameNode to make it more clear and simplify implementation
This commit is contained in:
parent
12c5e30b6f
commit
0c9501cbe4
@ -12,22 +12,22 @@ import ru.landgrafhomyak.db.skeleton1.api.runtime.InputRow
|
||||
public interface ModuleConstructorScope<mUE : Any> {
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("rootNs")
|
||||
public val rootNs: Namespace<mUE>
|
||||
public val rootNameNode: NameNode<mUE>
|
||||
|
||||
public fun <tUE : Any> createTable(
|
||||
lifeTime: Table.LifeTime = Table.LifeTime.DATABASE_SCOPE,
|
||||
namespace: Namespace<mUE> = this.rootNs,
|
||||
name: String, initializer: Table.Constructor<tUE>
|
||||
location: NameNode<mUE>,
|
||||
initializer: Table.Constructor<tUE>
|
||||
): Table<tUE, mUE>
|
||||
|
||||
public fun moduleScopedObject(
|
||||
namespace: Namespace<mUE> = this.rootNs,
|
||||
name: String, metadata: ObjectClass.ImplementationsProvider
|
||||
location: NameNode<mUE>,
|
||||
metadata: ObjectClass.ImplementationsProvider
|
||||
): ModuleScopedObject<mUE>
|
||||
|
||||
public fun <smUE : Any> substituteModule(rootNs: Namespace<mUE>, template: Module.Template<smUE>): Module<smUE>
|
||||
public fun <smUE : Any> substituteModule(rootNode: NameNode<mUE>, template: Module.Template<smUE>): Module<smUE>
|
||||
|
||||
public fun namespace(parent: Namespace<mUE>, name: String): Namespace<mUE>
|
||||
public fun nameNode(parent: NameNode<mUE>, name: String): NameNode<mUE>
|
||||
|
||||
public fun addStatement(stmt: _Statement.Void2Void<*>)
|
||||
public fun addStatement(stmt: RawStatement.Void2Void.ImplementationsProvider<*>)
|
||||
|
@ -5,16 +5,13 @@ import ru.landgrafhomyak.db.skeleton1.api.ReflectionApi
|
||||
import ru.landgrafhomyak.db.skeleton1.api.ObjectClass
|
||||
|
||||
public interface ModuleScopedObject<mUE : Any> {
|
||||
@ReflectionApi
|
||||
public val name: String
|
||||
|
||||
@ReflectionApi
|
||||
public val module: Module<mUE>
|
||||
|
||||
@ReflectionApi
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("getPathFromModuleRoot")
|
||||
public val pathFromModuleRoot: List<String>
|
||||
@get:JvmName("getPathFromParentModuleRoot")
|
||||
public val pathFromParentModuleRoot: List<String>?
|
||||
|
||||
@ReflectionApi
|
||||
public val objectClassProvider: ObjectClass.ImplementationsProvider
|
||||
|
@ -10,9 +10,9 @@ import ru.landgrafhomyak.db.skeleton1.api.table.Table
|
||||
public interface ModuleUpgradeScope<nmUE : Any, omUE : Any> : ModuleConstructorScope<nmUE> {
|
||||
// Table -------------------------------------------------------------------
|
||||
public fun <tUE : Any> keepTable(table: Table<tUE, omUE>): Table<tUE, nmUE>
|
||||
public fun <tUE : Any> keepAndRenameTable(
|
||||
public fun <tUE : Any> keepAndMoveTable(
|
||||
table: Table<tUE, omUE>,
|
||||
newNamespace: Namespace<nmUE>? = null, newName: String
|
||||
newLocation: NameNode<nmUE>
|
||||
): Table<tUE, nmUE>
|
||||
|
||||
public fun <ntUE : Any, otUE : Any> upgradeTable(
|
||||
@ -20,9 +20,9 @@ public interface ModuleUpgradeScope<nmUE : Any, omUE : Any> : ModuleConstructorS
|
||||
upgrade: Table.Upgrade<ntUE, otUE>
|
||||
): Table<ntUE, nmUE>
|
||||
|
||||
public fun <ntUE : Any, otUE : Any> upgradeAndRenameTable(
|
||||
public fun <ntUE : Any, otUE : Any> upgradeAndMoveTable(
|
||||
table: Table<otUE, omUE>,
|
||||
newNamespace: Namespace<nmUE>? = null, newName: String,
|
||||
newLocation: NameNode<nmUE>,
|
||||
upgrade: Table.Upgrade<ntUE, otUE>
|
||||
): Table<ntUE, nmUE>
|
||||
|
||||
@ -32,21 +32,21 @@ public interface ModuleUpgradeScope<nmUE : Any, omUE : Any> : ModuleConstructorS
|
||||
public fun exportTable(table: Table<*, omUE>)
|
||||
public fun <tUE : Any> importTable(
|
||||
table: Table<tUE, *>,
|
||||
namespace: Namespace<nmUE> = this.rootNs, name: String
|
||||
location: NameNode<nmUE>
|
||||
): Table<tUE, nmUE>
|
||||
|
||||
public fun <ntUE : Any, otUE : Any> importAndUpgradeTable(
|
||||
table: Table<otUE, *>,
|
||||
namespace: Namespace<nmUE> = this.rootNs, name: String,
|
||||
location: NameNode<nmUE>,
|
||||
upgrade: Table.Upgrade<ntUE, otUE>
|
||||
): Table<ntUE, nmUE>
|
||||
|
||||
// Object ------------------------------------------------------------------
|
||||
|
||||
public fun keepModuleScopedObject(obj: ModuleScopedObject< omUE>): ModuleScopedObject<nmUE>
|
||||
public fun renameModuleScopedObject(
|
||||
public fun keepModuleScopedObject(obj: ModuleScopedObject<omUE>): ModuleScopedObject<nmUE>
|
||||
public fun keepAndMoveModuleScopedObject(
|
||||
obj: ModuleScopedObject<omUE>,
|
||||
newNamespace: Namespace<nmUE>? = null, newName: String
|
||||
newLocation: NameNode<nmUE>,
|
||||
): ModuleScopedObject<nmUE>
|
||||
|
||||
public fun deleteModuleScopedObject(obj: ModuleScopedObject<omUE>)
|
||||
@ -55,19 +55,19 @@ public interface ModuleUpgradeScope<nmUE : Any, omUE : Any> : ModuleConstructorS
|
||||
public fun exportModuleScopedObject(obj: ModuleScopedObject<omUE>)
|
||||
public fun importModuleScopedObject(
|
||||
obj: ModuleScopedObject<*>,
|
||||
namespace: Namespace<nmUE> = this.rootNs, name: String
|
||||
location: NameNode<nmUE>
|
||||
): ModuleScopedObject<nmUE>
|
||||
|
||||
|
||||
// Module ------------------------------------------------------------------
|
||||
|
||||
public fun <smUE : Any> keepModule(module: Module<smUE>): Module<smUE>
|
||||
public fun <smUE : Any> keepAndMoveModule(oldModule: Module<smUE>, newNs: Namespace<nmUE>): Module<smUE>
|
||||
public fun <smUE : Any> keepAndMoveModule(oldModule: Module<smUE>, newNs: NameNode<nmUE>): Module<smUE>
|
||||
|
||||
public fun <smUE : Any> upgradeModule(oldModule: Module<*>, template: Module.Template<smUE>): Module<smUE>
|
||||
public fun <smUE : Any> upgradeAndMoveModule(
|
||||
oldModule: Module<*>,
|
||||
newNamespace: Namespace<nmUE>,
|
||||
newNamespace: NameNode<nmUE>,
|
||||
template: Module.Template<smUE>
|
||||
): Module<smUE>
|
||||
|
||||
@ -78,12 +78,12 @@ public interface ModuleUpgradeScope<nmUE : Any, omUE : Any> : ModuleConstructorS
|
||||
|
||||
public fun <smUE : Any> importModule(
|
||||
module: Module<smUE>,
|
||||
namespace: Namespace<nmUE>,
|
||||
location: NameNode<nmUE>,
|
||||
): Module<smUE>
|
||||
|
||||
public fun <nsmUE : Any, osmUE : Any> importAndUpgradeModule(
|
||||
module: Module<osmUE>,
|
||||
namespace: Namespace<nmUE>,
|
||||
location: NameNode<nmUE>,
|
||||
upgrade: Module.Upgrade<nsmUE, osmUE>
|
||||
): Module<nsmUE>
|
||||
|
||||
|
@ -3,7 +3,7 @@ package ru.landgrafhomyak.db.skeleton1.api.module
|
||||
import kotlin.jvm.JvmName
|
||||
import ru.landgrafhomyak.db.skeleton1.api.ReflectionApi
|
||||
|
||||
public interface Namespace<mUE : Any> {
|
||||
public interface NameNode<mUE : Any> {
|
||||
@ReflectionApi
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("getName")
|
||||
@ -12,5 +12,5 @@ public interface Namespace<mUE : Any> {
|
||||
@ReflectionApi
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("getPath")
|
||||
public val parent: Namespace<mUE>?
|
||||
public val parent: NameNode<mUE>?
|
||||
}
|
@ -11,13 +11,8 @@ public interface Table<UE : Any, mUE : Any> {
|
||||
|
||||
@ReflectionApi
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("getName")
|
||||
public val name: String
|
||||
|
||||
@ReflectionApi
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("getPathFromModuleRoot")
|
||||
public val pathFromModuleRoot: List<String>
|
||||
@get:JvmName("getPathFromParentModuleRoot")
|
||||
public val pathFromParentModuleRoot: List<String>?
|
||||
|
||||
@ReflectionApi
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@ -44,7 +39,7 @@ public interface Table<UE : Any, mUE : Any> {
|
||||
@ReflectionApi
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("getMemberObjects")
|
||||
public val memberObjects: Collection<TableScopedObject<*, UE>>
|
||||
public val memberObjects: Collection<TableScopedObject<UE>>
|
||||
|
||||
@ReflectionApi
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@ -54,7 +49,7 @@ public interface Table<UE : Any, mUE : Any> {
|
||||
@ReflectionApi
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@get:JvmName("getMemberObjectsWhileUpgrade")
|
||||
public val memberObjectsWhileUpgrade: Collection<TableScopedObject<*, UE>>
|
||||
public val memberObjectsWhileUpgrade: Collection<TableScopedObject<UE>>
|
||||
|
||||
public interface Constructor<tUE : Any> {
|
||||
public fun createTable(context: TableConstructorScope<tUE>): tUE
|
||||
|
Loading…
Reference in New Issue
Block a user