class_name
Return the deserialized object on success and
record in errors
if class_name
is unknown.
This method should be redefined for each custom subclass of Serializable
.
All refinement should look for a precise class_name
and call super
on unsupported classes.
# Deserialize the next available object as an instance of `class_name`
#
# Return the deserialized object on success and
# record in `errors` if `class_name` is unknown.
#
# This method should be redefined for each custom subclass of `Serializable`.
# All refinement should look for a precise `class_name` and call super
# on unsupported classes.
protected fun deserialize_class(class_name: Text): nullable Object do
if class_name == "Error" then return new Error.from_deserializer(self)
return deserialize_class_intern(class_name)
end
lib/serialization/serialization_core.nit:136,2--147,4
redef fun deserialize_class(name)
do
if name == "POSet[String]" then return new POSet[String].from_deserializer(self)
if name == "POSetElement[String]" then return new POSetElement[String].from_deserializer(self)
if name == "HashSet[String]" then return new HashSet[String].from_deserializer(self)
if name == "HashMap[String, POSetElement[String]]" then return new HashMap[String, POSetElement[String]].from_deserializer(self)
return super
end
lib/serialization/safe.nit:100,2--108,4
redef fun deserialize_class(name) do
if name == "Issue" then
var issue = super.as(Issue)
if path.last.has_key("pull_request") then
issue.is_pull_request = true
end
return issue
else if name == "Commit" then
var commit = super.as(Commit)
var git_commit = commit.commit
if git_commit != null then commit.message = git_commit.message
return commit
end
return super
end
lib/github/api.nit:1131,2--1145,4