Class SelectiveClassCoding

Superclasses :
lang::ClassCoding
Subclasses :
net::URL
Package :
lang

An implementation of ClassCoding. The subclass must override the method get_template() to return a list of pairs. The first element of each pair is an arbitrary string used to identify the field; the second element is the name of the field.

The programmer may change the name of the field afterwards; for example value may be re-named initial_value, and the data would still be restored correctly.

Alternatively, any of the pairs may be a string field name, in which the label is the field name itself. This does not permit the field name to change without rendering the encoded string invalid.

Example :
  # This will save the three fields {increment_size}, {value} and {is_range_flag}.
  method get_template()
     return  [
         ["Increment Size", "increment_size"],
         ["Value", "value"],
         ["Is Range Flag", "is_range_flag"]]
  end
Source

Class summary
Methods inherited from lang::ClassCoding
post_decode() pre_encode()
Methods defined in this class
decode_obj(e) encode_obj(e) get_template() load_map() load_template()

Method detail

decode_obj(e)

Overrides decode_obj(e) in lang::ClassCoding
Source

encode_obj(e)

Overrides encode_obj(e) in lang::ClassCoding
Source

get_template()

This method must be overridden by a subclass to return the field template (see above).
Source

load_map()

Private method, not intended for client invocation

load_template()

Private method, not intended for client invocation