TypeFactory

interface TypeFactory

Resolves a fully-qualified type name (as it would appear as an it.unibo.tuprolog.core.Atom in Prolog code, e.g. in a cast/3 expression X as 'java.util.ArrayList' or in new_object/2,3) into a KClass, backing type-name lookups performed by TermToObjectConverter and the type/2 predicate (it.unibo.tuprolog.solve.libs.oop.primitives.Type).

On the JVM this also understands Kotlin's own standard-library names (e.g. kotlin.String, kotlin.collections.List) via an internal name map, since Class.forName alone only knows about their JVM/Java counterparts.

See also

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun typeFromName(typeName: String): KClass<*>?

Resolves typeName into a KClass, or null if no such type could be found.

Link copied to clipboard
open fun typeRefFromName(typeName: String): TypeRef?

Like typeFromName, wrapping the result into a TypeRef.