self
to serializer
This writes the full data of self
to serializer
.
This method can be redefined in sub classes and refinements.
It should use Serializer::serialize_attribute
to to register real or
logical attributes.
Any refinement should have its equivalent refinement of
Deserializer::deserialize_class
to support this custom deserialization.
# Actual serialization of `self` to `serializer`
#
# This writes the full data of `self` to `serializer`.
#
# This method can be redefined in sub classes and refinements.
# It should use `Serializer::serialize_attribute` to to register real or
# logical attributes.
#
# Any refinement should have its equivalent refinement of
# `Deserializer::deserialize_class` to support this custom deserialization.
fun core_serialize_to(serializer: Serializer) do end
lib/serialization/serialization_core.nit:226,2--236,53
# We customize the serialization process to avoid problems with recursive
# serialization engines. These engines, such as `JsonSerializer`,
# are at danger to serialize the graph as a very deep tree.
# With a large graph it can cause a stack overflow.
#
# Instead, we serialize the nodes first and then the links.
redef fun core_serialize_to(serializer)
do
serializer.serialize_attribute("graph", graph)
end
lib/a_star/a_star.nit:199,2--208,4
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("graph", graph)
v.serialize_attribute("from", from)
v.serialize_attribute("to", to)
end
2,1--8,3
redef fun core_serialize_to(serializer)
do
serializer.serialize_attribute("nodes", nodes)
serializer.serialize_attribute("links", links)
end
lib/a_star/a_star.nit:276,2--280,4
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("total_cost", total_cost)
v.serialize_attribute("nodes", nodes)
v.serialize_attribute("at", at)
end
2,1--8,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("graph", graph)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
end
2,1--5,3
redef fun core_serialize_to(v)
do
super
end
2,1--5,3
redef fun core_serialize_to(v)
do
super
end
2,1--5,3
redef fun core_serialize_to(v)
do
super
end
2,1--5,3
redef fun core_serialize_to(v)
do
super
end
2,1--5,3
redef fun core_serialize_to(v)
do
v.serialize_attribute("message", message)
v.serialize_attribute("cause", cause)
end
lib/serialization/serialization_core.nit:317,2--321,4
redef fun core_serialize_to(v)
do
v.serialize_attribute("first", first)
v.serialize_attribute("second", second)
end
lib/serialization/serialization_core.nit:279,2--283,4
redef fun core_serialize_to(serializer)
do
serializer.serialize_attribute("poset", poset)
serializer.serialize_attribute("element", element)
serializer.serialize_attribute("tos", tos)
serializer.serialize_attribute("froms", froms)
serializer.serialize_attribute("dtos", dtos)
serializer.serialize_attribute("dfroms", dfroms)
serializer.serialize_attribute("count", count)
# Don't serialize `froms`, `dtos` and `tos` as they duplicate information.
# TODO serialize them if a flag for extra info is set on `serializer`.
end
lib/poset/poset.nit:643,2--655,4
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("line", line)
v.serialize_attribute("offset", offset)
end
2,1--7,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("level1", level1)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("level1", level1)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("level1", level1)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("prev", prev)
v.serialize_attribute("next", next)
v.serialize_attribute("capacity", capacity)
v.serialize_attribute("items", items)
v.serialize_attribute("head_index", head_index)
v.serialize_attribute("tail_index", tail_index)
end
2,1--11,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("best_distance", best_distance)
v.serialize_attribute("best_items", best_items)
end
2,1--7,3
redef fun core_serialize_to(v)
do
super
end
2,1--5,3
redef fun core_serialize_to(v)
do
super
end
2,1--5,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("tick", tick)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("tick", tick)
v.serialize_attribute("events", events)
end
2,1--7,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("name", name)
v.serialize_attribute("age", age)
end
2,1--7,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("typ", typ)
v.serialize_attribute("data", data)
end
2,1--7,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("date", date)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("full_name", full_name)
v.serialize_attribute("name", name)
v.serialize_attribute("owner", owner)
v.serialize_attribute("default_branch", default_branch)
end
2,1--9,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("_id", mongo_id)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("sha", sha)
v.serialize_attribute("parents", parents)
v.serialize_attribute("author", author)
v.serialize_attribute("committer", committer)
v.serialize_attribute("message", message)
end
2,1--10,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("label", labl)
v.serialize_attribute("ref", ref)
v.serialize_attribute("sha", sha)
v.serialize_attribute("user", user)
v.serialize_attribute("repo", repo)
end
2,1--10,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("name", name)
v.serialize_attribute("color", color)
end
2,1--7,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("number", number)
v.serialize_attribute("title", title)
v.serialize_attribute("description", description)
v.serialize_attribute("open_issues", open_issues)
v.serialize_attribute("closed_issues", closed_issues)
v.serialize_attribute("state", state)
v.serialize_attribute("created_at", created_at)
v.serialize_attribute("creator", creator)
v.serialize_attribute("due_on", due_on)
v.serialize_attribute("updated_at", updated_at)
v.serialize_attribute("closed_at", closed_at)
end
2,1--16,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("id", id)
v.serialize_attribute("user", user)
v.serialize_attribute("created_at", created_at)
v.serialize_attribute("updated_at", updated_at)
v.serialize_attribute("body", body)
end
2,1--10,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("state", state)
v.serialize_attribute("sha", sha)
v.serialize_attribute("repository", repository)
v.serialize_attribute("statuses", statuses)
v.serialize_attribute("total_count", total_count)
end
2,1--10,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("state", state)
v.serialize_attribute("description", description)
v.serialize_attribute("target_url", target_url)
v.serialize_attribute("context", context)
v.serialize_attribute("created_at", created_at)
v.serialize_attribute("updated_at", updated_at)
end
2,1--11,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("from", from)
v.serialize_attribute("to", to)
end
2,1--7,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("w", w)
v.serialize_attribute("a", a)
v.serialize_attribute("d", d)
v.serialize_attribute("c", c)
end
2,1--9,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("filename", filename)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("total_count", total_count)
v.serialize_attribute("incomplete_results", incomplete_results)
v.serialize_attribute("items", items)
end
2,1--8,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("id", id)
v.serialize_attribute("action", action)
v.serialize_attribute("repo", repo)
end
2,1--8,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("http_version", http_version)
v.serialize_attribute("method", method)
v.serialize_attribute("url", url)
v.serialize_attribute("uri", uri)
v.serialize_attribute("query_string", query_string)
v.serialize_attribute("header", header)
v.serialize_attribute("body", body)
v.serialize_attribute("cookie", cookie)
v.serialize_attribute("get_args", get_args)
v.serialize_attribute("post_args", post_args)
v.serialize_attribute("all_args", all_args)
end
2,1--16,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("http_version", http_version)
v.serialize_attribute("status_code", status_code)
v.serialize_attribute("header", header)
v.serialize_attribute("body", body)
v.serialize_attribute("files", files)
end
2,1--10,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("_id", id)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("repo", repo)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("rank", rank)
v.serialize_attribute("size", size)
v.serialize_attribute("name", name)
v.serialize_attribute("string_of_random_length", string_of_random_length)
end
2,1--9,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("pos_start", pos_start)
v.serialize_attribute("pos_end", pos_end)
v.serialize_attribute("line_start", line_start)
v.serialize_attribute("line_end", line_end)
v.serialize_attribute("col_start", col_start)
v.serialize_attribute("col_end", col_end)
end
2,1--11,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("str", str)
v.serialize_attribute("more", more)
end
2,1--7,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("min", min)
v.serialize_attribute("max", max)
v.serialize_attribute("period", period)
v.serialize_attribute("seed", seed)
end
2,1--9,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("p", p)
end
2,1--6,3
redef fun core_serialize_to(v) do
var errors = new JsonObject
for k, e in self.errors do
errors[k] = new JsonArray.from(e)
end
v.serialize_attribute("has_error", has_error)
v.serialize_attribute("errors", errors)
end
lib/popcorn/pop_validation.nit:142,2--149,4
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("id", id)
v.serialize_attribute("semi_private", semi_private)
end
2,1--7,3
redef fun core_serialize_to(v)
do
super
end
2,1--5,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("worst_cost", worst_cost)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("weight", weight)
end
2,1--6,3
redef fun core_serialize_to(v)
do
v.serialize_attribute("item", first)
end
lib/serialization/serialization_core.nit:296,2--299,4
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("location", location)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("act_at", act_at)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("next_bucket", next_bucket)
v.serialize_attribute("current_bucket_key", current_bucket_key)
v.serialize_attribute("n_buckets", n_buckets)
v.serialize_attribute("buckets", buckets)
v.serialize_attribute("delays", delays)
end
2,1--10,3
redef fun core_serialize_to(v)
do
super
end
2,1--5,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("game", game)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("buckets", buckets)
v.serialize_attribute("last_turn", last_turn)
end
2,1--7,3
redef fun core_serialize_to(v)
do
super
end
2,1--5,3
redef fun core_serialize_to(v)
do
super
end
2,1--5,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("login", login)
v.serialize_attribute("avatar_url", avatar_url)
v.serialize_attribute("name", name)
v.serialize_attribute("email", email)
v.serialize_attribute("blog", blog)
end
2,1--10,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("name", name)
v.serialize_attribute("commit", commit)
end
2,1--7,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("_id", mongo_id)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("sha", sha)
v.serialize_attribute("parents", parents)
v.serialize_attribute("author", author)
v.serialize_attribute("committer", committer)
v.serialize_attribute("author_date", author_date)
v.serialize_attribute("commit_date", commit_date)
v.serialize_attribute("files", files)
v.serialize_attribute("message", message)
v.serialize_attribute("commit", commit)
end
2,1--14,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("_id", mongo_id)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("number", number)
v.serialize_attribute("id", id)
v.serialize_attribute("title", title)
v.serialize_attribute("user", user)
v.serialize_attribute("labels", labels)
v.serialize_attribute("state", state)
v.serialize_attribute("locked", locked)
v.serialize_attribute("assignee", assignee)
v.serialize_attribute("milestone", milestone)
v.serialize_attribute("comments", comments)
v.serialize_attribute("created_at", created_at)
v.serialize_attribute("updated_at", updated_at)
v.serialize_attribute("closed_at", closed_at)
v.serialize_attribute("body", body)
v.serialize_attribute("closed_by", closed_by)
v.serialize_attribute("is_pull_request", is_pull_request)
end
2,1--21,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("_id", mongo_id)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("commit_id", commit_id)
v.serialize_attribute("position", position)
v.serialize_attribute("line", line)
v.serialize_attribute("path", path)
end
2,1--9,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("pull_request_url", pull_request_url)
v.serialize_attribute("diff_hunk", diff_hunk)
v.serialize_attribute("path", path)
v.serialize_attribute("position", position)
v.serialize_attribute("original_position", original_position)
v.serialize_attribute("commit_id", commit_id)
v.serialize_attribute("original_commit_id", original_commit_id)
end
2,1--12,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("id", id)
v.serialize_attribute("actor", actor)
v.serialize_attribute("created_at", created_at)
v.serialize_attribute("event", event)
v.serialize_attribute("commit_id", commit_id)
v.serialize_attribute("label", labl)
v.serialize_attribute("assignee", assignee)
v.serialize_attribute("milestone", milestone)
v.serialize_attribute("rename", rename)
end
2,1--14,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("_id", mongo_id)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("author", author)
v.serialize_attribute("total", total)
v.serialize_attribute("weeks", weeks)
end
2,1--8,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("comment", comment)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("ref_type", ref_type)
v.serialize_attribute("ref", ref)
v.serialize_attribute("master_branch", master_branch)
v.serialize_attribute("description", description)
end
2,1--9,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("ref_type", ref_type)
v.serialize_attribute("ref", ref)
end
2,1--7,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("sha", sha)
v.serialize_attribute("name", name)
v.serialize_attribute("payload", payload)
v.serialize_attribute("environment", environment)
v.serialize_attribute("description", description)
end
2,1--10,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("state", state)
v.serialize_attribute("target_url", target_url)
v.serialize_attribute("deployment", deployment)
v.serialize_attribute("description", description)
end
2,1--9,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("forkee", forkee)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("issue", issue)
v.serialize_attribute("comment", comment)
end
2,1--7,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("issue", issue)
v.serialize_attribute("label", lbl)
v.serialize_attribute("assignee", assignee)
end
2,1--8,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("member", member)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("number", number)
v.serialize_attribute("pull", pull)
end
2,1--7,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("comment", comment)
v.serialize_attribute("pull", pull)
end
2,1--7,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("head_commit", head_commit)
v.serialize_attribute("ref", ref)
v.serialize_attribute("size", size)
v.serialize_attribute("commits", commits)
end
2,1--9,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("sha", sha)
v.serialize_attribute("state", state)
v.serialize_attribute("description", description)
v.serialize_attribute("target_url", target_url)
v.serialize_attribute("branches", branches)
end
2,1--10,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("repo", repo)
v.serialize_attribute("_id", id)
v.serialize_attribute("last_issue", last_issue)
end
2,1--8,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("error", name)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("i", i)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("n_layers", n_layers)
v.serialize_attribute("layers", layers)
end
2,1--7,3
redef fun core_serialize_to(v)
do
super
end
2,1--5,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("request", request)
v.serialize_attribute("response", response)
v.serialize_attribute("user_agent", user_agent)
v.serialize_attribute("response_time", response_time)
v.serialize_attribute("timestamp", timestamp)
v.serialize_attribute("session", session)
end
2,1--11,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("i", i)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("a", a)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("list", list)
v.serialize_attribute("node", node)
v.serialize_attribute("index", index)
v.serialize_attribute("index_in_node", index_in_node)
end
2,1--9,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("x", x)
v.serialize_attribute("y", y)
end
2,1--7,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("point_left", point_left)
v.serialize_attribute("point_right", point_right)
end
2,1--7,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("merged_at", merged_at)
v.serialize_attribute("merge_commit_sha", merge_commit_sha)
v.serialize_attribute("review_comments", review_comments)
v.serialize_attribute("head", head)
v.serialize_attribute("base", base)
v.serialize_attribute("merged", merged)
v.serialize_attribute("mergeable", mergeable)
v.serialize_attribute("mergeable_state", mergeable_state)
v.serialize_attribute("merged_by", merged_by)
v.serialize_attribute("commits", commits)
v.serialize_attribute("additions", additions)
v.serialize_attribute("deletions", deletions)
v.serialize_attribute("changed_files", changed_files)
v.serialize_attribute("patch_url", patch_url)
end
2,1--19,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("issue_url", issue_url)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("_id", mongo_id)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("browser", browser)
v.serialize_attribute("count", count)
end
2,1--7,3
redef fun core_serialize_to(serializer)
do
# Optimize written data because this structure has duplicated data
# For example, serializing the class hierarchy of a simple program where E is String
# result is before: 200k, after: 56k.
serializer.serialize_attribute("elements", elements)
end
lib/poset/poset.nit:491,2--497,4
redef fun core_serialize_to(v)
do
super
end
2,1--5,3
redef fun core_serialize_to(v)
do
super
end
2,1--5,3
redef fun core_serialize_to(v)
do
super
end
2,1--5,3
redef fun core_serialize_to(v) do v.serialize_attribute("seq", seq)
lib/serialization/serialization_core.nit:342,2--68
redef fun core_serialize_to(v) do v.serialize_attribute("seq", seq)
lib/serialization/serialization_core.nit:360,2--68
redef fun core_serialize_to(v)
do
v.serialize_attribute("items", items)
v.serialize_attribute("comparator", comparator)
end
lib/serialization/serialization_core.nit:385,2--389,4
redef fun core_serialize_to(v)
do
super
end
2,1--5,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("default", default)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("nodes_length", nodes_length)
v.serialize_attribute("head_node", head_node)
v.serialize_attribute("tail_node", tail_node)
v.serialize_attribute("length", length)
v.serialize_attribute("index_within_node", index_within_node)
end
2,1--10,3
redef fun core_serialize_to(v)
do
super
v.serialize_attribute("z", z)
end
2,1--6,3
redef fun core_serialize_to(v)
do
super
end
2,1--5,3
redef fun core_serialize_to(v)
do
super
end
2,1--5,3