A fully-qualified name of this model entity.

The full-name is based on the short name and is usually prefixed by the name of an outer entity. Usually the quad (::) is used to separate the different names.

The full-name is expected to be unique and unambiguous in lawful Nit models for the same kind of entity.

It is often suitable to use it in message to the user. However, some full-name could be long and verbose,

See the specific implementation in subclasses for details.

Property definitions

nitc $ MEntity :: full_name
	# A fully-qualified name of this model entity.
	#
	# The full-name is based on the short name and is usually prefixed by the name of an outer entity.
	# Usually the quad (`::`) is used to separate the different names.
	#
	# The full-name is expected to be unique and unambiguous in lawful Nit models for the same kind of entity.
	#
	# It is often suitable to use it in message to the user.
	# However, some full-name could be long and verbose,
	#
	# See the specific implementation in subclasses for details.
	fun full_name: String is abstract
src/model/model_base.nit:46,2--57,34

nitc $ MClass :: full_name
	# The canonical name of the class
	#
	# It is the name of the class prefixed by the full_name of the `intro_mmodule`
	# Example: `"owner::module::MyClass"`
	redef var full_name is lazy do
		return "{self.intro_mmodule.namespace_for(visibility)}::{name}"
	end
src/model/model.nit:448,2--454,4

nitc $ MClassDef :: full_name
	# The module and class name separated by a '$'.
	#
	# The short-name of the class is used for introduction.
	# Example: "my_module$MyClass"
	#
	# The full-name of the class is used for refinement.
	# Example: "my_module$intro_module::MyClass"
	redef var full_name is lazy do
		if is_intro then
			# public gives 'p$A'
			# private gives 'p::m$A'
			return "{mmodule.namespace_for(mclass.visibility)}${mclass.name}"
		else if mclass.intro_mmodule.mpackage != mmodule.mpackage then
			# public gives 'q::n$p::A'
			# private gives 'q::n$p::m::A'
			return "{mmodule.full_name}${mclass.full_name}"
		else if mclass.visibility > private_visibility then
			# public gives 'p::n$A'
			return "{mmodule.full_name}${mclass.name}"
		else
			# private gives 'p::n$::m::A' (redundant p is omitted)
			return "{mmodule.full_name}$::{mclass.intro_mmodule.name}::{mclass.name}"
		end
	end
src/model/model.nit:684,2--707,4

nitc $ MPackage :: full_name
	redef fun full_name do return name
src/model/mpackage.nit:31,2--35

nitc $ MGroup :: full_name
	# Fully qualified name.
	# It includes each parent group separated by `>`.
	# The full_name is terminated by `>` to avoid collision with other entities.
	#
	# E.g. `core>` and `core>collection>`
	redef fun full_name
	do
		var p = parent
		if p == null then return "{name}>"
		return "{p.full_name}{name}>"
	end
src/model/mpackage.nit:132,2--142,4

nitc $ MProperty :: full_name
	# The canonical name of the property.
	#
	# It is currently the short-`name` prefixed by the short-name of the class and the full-name of the module.
	# Example: "my_package::my_module::MyClass::my_method"
	#
	# The full-name of the module is needed because two distinct modules of the same package can
	# still refine the same class and introduce homonym properties.
	#
	# For public properties not introduced by refinement, the module name is not used.
	#
	# Example: `my_package::MyClass::My_method`
	redef var full_name is lazy do
		if intro_mclassdef.is_intro then
			return "{intro_mclassdef.mmodule.namespace_for(visibility)}::{intro_mclassdef.mclass.name}::{name}"
		else
			return "{intro_mclassdef.mmodule.full_name}::{intro_mclassdef.mclass.name}::{name}"
		end
	end
src/model/model.nit:2166,2--2183,4

nitc $ MPropDef :: full_name
	# The full-name of mpropdefs combine the information about the `classdef` and the `mproperty`.
	#
	# Therefore the combination of identifiers is awful,
	# the worst case being
	#
	#  * a property "p::m::A::x"
	#  * redefined in a refinement of a class "q::n::B"
	#  * in a module "r::o"
	#  * so "r::o$q::n::B$p::m::A::x"
	#
	# Fortunately, the full-name is simplified when entities are repeated.
	# For the previous case, the simplest form is "p$A$x".
	redef var full_name is lazy do
		var res = new FlatBuffer

		# The first part is the mclassdef. Worst case is "r::o$q::n::B"
		res.append mclassdef.full_name

		res.append "$"

		if mclassdef.mclass == mproperty.intro_mclassdef.mclass then
			# intro are unambiguous in a class
			res.append name
		else
			# Just try to simplify each part
			if mclassdef.mmodule.mpackage != mproperty.intro_mclassdef.mmodule.mpackage then
				# precise "p::m" only if "p" != "r"
				res.append mproperty.intro_mclassdef.mmodule.namespace_for(mproperty.visibility)
				res.append "::"
			else if mproperty.visibility <= private_visibility then
				# Same package ("p"=="q"), but private visibility,
				# does the module part ("::m") need to be displayed
				if mclassdef.mmodule.namespace_for(mclassdef.mclass.visibility) != mproperty.intro_mclassdef.mmodule.mpackage then
					res.append "::"
					res.append mproperty.intro_mclassdef.mmodule.name
					res.append "::"
				end
			end
			# precise "B" because it is not the same class than "A"
			res.append mproperty.intro_mclassdef.name
			res.append "::"
			# Always use the property name "x"
			res.append mproperty.name
		end
		return res.to_s
	end
src/model/model.nit:2543,2--2588,4

nitc $ MModule :: full_name
	# The canonical name of the module.
	#
	# It is usually the `name` prefixed by the package's name.
	# Example: `"package::name"`
	#
	# Default modules use a doubled name to distinguish them from the package name.
	# E.g.: `"core::core"`
	#
	# If the module is package-less, then the short-name is used alone.
	redef var full_name is lazy do
		var mgroup = self.mgroup
		if mgroup == null then
			return self.name
		else
			return "{mgroup.mpackage.name}::{self.name}"
		end
	end
src/model/mmodule.nit:111,2--127,4

nitc $ MClassType :: full_name
	redef fun full_name do return mclass.full_name
src/model/model.nit:1307,2--47

nitc $ MNullType :: full_name
	redef fun full_name do return "null"
src/model/model.nit:1897,2--37

nitc $ MBottomType :: full_name
	redef fun full_name do return "bottom"
src/model/model.nit:1924,2--39

nitc $ MErrorType :: full_name
	redef fun full_name do return "error"
src/model/model.nit:1950,2--38

nitc $ MGenericType :: full_name
	# The full-name of the class, then the full-name of each type arguments within brackets.
	# Example: `"core::Map[core::String, core::List[core::Int]]"`
	redef var full_name is lazy do
		var args = new Array[String]
		for t in arguments do
			args.add t.full_name
		end
		return "{mclass.full_name}[{args.join(", ")}]"
	end
src/model/model.nit:1424,2--1432,4

nitc $ MVirtualType :: full_name
	redef fun full_name do return self.mproperty.full_name
src/model/model.nit:1618,2--55

nitc $ MParameterType :: full_name
	redef var full_name is lazy do return "{mclass.full_name}::{name}"
src/model/model.nit:1669,2--67

nitc $ MNullableType :: full_name
	redef var full_name is lazy do return "nullable {mtype.full_name}"
src/model/model.nit:1841,2--67

nitc $ MNotNullType :: full_name
	redef var full_name is lazy do return "not null {mtype.full_name}"
src/model/model.nit:1870,2--67