nitc :: MPackageMetadata :: _contributors
The list of contributorsnitc :: MPackageMetadata :: _first_date
The date of the oldest commitnitc :: MPackageMetadata :: _last_date
The date of the most recent commitnitc :: MPackageMetadata :: _maintainer
Key: package.maintainer`nitc :: MPackageMetadata :: _maintainers
The list of all maintainersnitc :: MPackageMetadata :: _more_contributors
Key:package.more_contributors
nitc :: MPackageMetadata :: _mpackage
The mpacakge this metadata belongs tonitc :: MPackageMetadata :: browse=
Key:upstream.browse
nitc :: MPackageMetadata :: contributors=
The list of contributorsnitc :: MPackageMetadata :: defaultinit
nitc :: MPackageMetadata :: first_date
The date of the oldest commitnitc :: MPackageMetadata :: first_date=
The date of the oldest commitnitc :: MPackageMetadata :: homepage=
Key:upstream.homepage
nitc :: MPackageMetadata :: issues=
Package issue trackernitc :: MPackageMetadata :: last_date
The date of the most recent commitnitc :: MPackageMetadata :: last_date=
The date of the most recent commitnitc :: MPackageMetadata :: license=
Key:package.license
nitc :: MPackageMetadata :: maintainer=
Key: package.maintainer`nitc :: MPackageMetadata :: maintainers=
The list of all maintainersnitc :: MPackageMetadata :: more_contributors
Key:package.more_contributors
nitc :: MPackageMetadata :: more_contributors=
Key:package.more_contributors
nitc :: MPackageMetadata :: mpackage=
The mpacakge this metadata belongs tonitc $ MPackageMetadata :: SELF
Type of this instance, automatically specialized in every classnitc :: json_model $ MPackageMetadata :: core_serialize_to
Actual serialization ofself
to serializer
nitc :: json_model $ MPackageMetadata :: from_deserializer
Create an instance of this class from thedeserializer
nitc :: MPackageMetadata :: _contributors
The list of contributorsnitc :: MPackageMetadata :: _first_date
The date of the oldest commitnitc :: MPackageMetadata :: _last_date
The date of the most recent commitnitc :: MPackageMetadata :: _maintainer
Key: package.maintainer`nitc :: MPackageMetadata :: _maintainers
The list of all maintainersnitc :: MPackageMetadata :: _more_contributors
Key:package.more_contributors
nitc :: MPackageMetadata :: _mpackage
The mpacakge this metadata belongs toserialization :: Serializable :: accept_inspect_serializer_core
serialization :: Serializable :: accept_json_serializer
Refinable service to customize the serialization of this class to JSONserialization :: Serializable :: accept_msgpack_attribute_counter
Hook to customize the behavior of theAttributeCounter
serialization :: Serializable :: accept_msgpack_serializer
Hook to customize the serialization of this class to MessagePackserialization :: Serializable :: add_to_bundle
Called by[]=
to dynamically choose the appropriate method according
nitc :: MPackageMetadata :: browse=
Key:upstream.browse
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: MPackageMetadata :: contributors=
The list of contributorsserialization :: Serializable :: core_serialize_to
Actual serialization ofself
to serializer
core :: Object :: defaultinit
nitc :: MPackageMetadata :: defaultinit
nitc :: MPackageMetadata :: first_date
The date of the oldest commitnitc :: MPackageMetadata :: first_date=
The date of the oldest commitserialization :: Serializable :: from_deserializer
Create an instance of this class from thedeserializer
nitc :: MPackageMetadata :: homepage=
Key:upstream.homepage
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
nitc :: MPackageMetadata :: issues=
Package issue trackernitc :: MPackageMetadata :: last_date
The date of the most recent commitnitc :: MPackageMetadata :: last_date=
The date of the most recent commitnitc :: MPackageMetadata :: license=
Key:package.license
nitc :: MPackageMetadata :: maintainer=
Key: package.maintainer`nitc :: MPackageMetadata :: maintainers=
The list of all maintainersnitc :: MPackageMetadata :: more_contributors
Key:package.more_contributors
nitc :: MPackageMetadata :: more_contributors=
Key:package.more_contributors
nitc :: MPackageMetadata :: mpackage=
The mpacakge this metadata belongs toserialization :: Serializable :: msgpack_extra_array_items
Hook to request a larger than usual metadata arraycore :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).serialization :: Serializable :: serialize_msgpack
Serializeself
to MessagePack bytes
serialization :: Serializable :: serialize_to
Serializeself
to serializer
serialization :: Serializable :: serialize_to_json
Serializeself
to JSON
serialization :: Serializable :: serialize_to_or_delay
Accept references or force direct serialization (usingserialize_to
)
serialization :: Serializable :: to_pretty_json
Serializeself
to plain pretty JSON
Serializer::serialize
# The metadata extracted from a MPackage
class MPackageMetadata
# The mpacakge this metadata belongs to
var mpackage: MPackage
# Return the associated metadata from the `ini`, if any
fun metadata(key: String): nullable String do
var ini = mpackage.ini
if ini == null then return null
return ini[key]
end
# The consolidated list of tags
var tags: Array[String] is lazy do
var tags = new Array[String]
var string = metadata("package.tags")
if string == null then return tags
for tag in string.split(",") do
tag = tag.trim
if tag.is_empty then continue
tags.add tag
end
if tryit != null then tags.add "tryit"
if apk != null then tags.add "apk"
if tags.is_empty then tags.add "none"
return tags
end
# The list of all maintainers
var maintainers = new Array[Person]
# The list of contributors
var contributors = new Array[Person]
# The date of the most recent commit
var last_date: nullable String = null
# The date of the oldest commit
var first_date: nullable String = null
# Key: package.maintainer`
var maintainer: nullable String is lazy do return metadata("package.maintainer")
# Key: `package.more_contributors`
var more_contributors: Array[String] is lazy do
var res = new Array[String]
var string = metadata("package.more_contributors")
if string == null then return res
for c in string.split(",") do
c = c.trim
if c.is_empty then continue
res.add c
end
return res
end
# Key: `package.license`
var license: nullable String is lazy do return metadata("package.license")
# Key: `upstream.tryit`
var tryit: nullable String is lazy do return metadata("upstream.tryit")
# Key: `upstream.apk`
var apk: nullable String is lazy do return metadata("upstream.apk")
# Key: `upstream.homepage`
var homepage: nullable String is lazy do return metadata("upstream.homepage")
# Key: `upstream.browse`
var browse: nullable String is lazy do return metadata("upstream.browse")
# Package git clone address
var git: nullable String is lazy do return metadata("upstream.git")
# Package issue tracker
var issues: nullable String is lazy do return metadata("upstream.issues")
end
src/catalog/catalog.nit:61,1--138,3
redef class MPackageMetadata
serialize
redef fun core_serialize_to(v) do
super
v.serialize_attribute("license", license)
v.serialize_attribute("maintainers", maintainers)
v.serialize_attribute("contributors", contributors)
v.serialize_attribute("tags", tags)
v.serialize_attribute("tryit", tryit)
v.serialize_attribute("apk", apk)
v.serialize_attribute("homepage", homepage)
v.serialize_attribute("browse", browse)
v.serialize_attribute("git", git)
v.serialize_attribute("issues", issues)
v.serialize_attribute("first_date", first_date)
v.serialize_attribute("last_date", last_date)
end
end
src/doc/templates/json_model.nit:382,1--400,3