XOTcl - Documentation -- ./../library/serialize/Serializer.xotcl

# ./../library/serialize/Serializer.xotcl

## Package/File Information

Package required: XOTcl 1.0
Package provided: xotcl::serializer 0.3
Defined Objects/Classes:

- Serializer: all, deepSerialize, serialize.

Filename: ./../library/serialize/Serializer.xotcl

Description: | This package provides the class Serializer, which can be used to generate a snapshot of the current state of the workspace in the form of XOTcl source code.
Authors: | Gustaf Neumann, Gustaf.Neumann@wu-wien.ac.at
Date: | $Date: 01/03/23 21:55:33+01:00 $

## Class: Serializer

Procs/Instprocs: all, deepSerialize, serialize.

### Instprocs

- serialize entity

  Arguments: | entity: Object or Class
  Description: | Serialize the specified object or class.
  Return: | Object or Class with all currently defined methods, variables, invariants, filters and mixins

### Procs

- all ?-ignoreVarsRE RE? ?-ignore obj1 obj2 ...?

  Arguments: | ?-ignoreVarsRE RE?: provide regular expression; matching vars are ignored
  | ?-ignore obj1 obj2 ...?: provide a list of objects to be omitted
  Description: | Serialize all objects and classes that are currently defined (except the specified omissions and the current Serializer object). Examples: `Serializer all -ignoreVarsRE {::b$}` do not serialize any instance variable named b (of any object) `Serializer all -ignoreVarsRE {^::o1::.*text.*$|^::o2::x$}` do not serialize any variable of c1 whose name contains the string "text" and do not serialze the variable x of o2 `Serializer all - ignore obj1 obj2 ...` do not serizalze the specified objects
  Return: | script

- deepSerialize objs ?-ignoreVarsRE RE? ?-ignore obj1 obj2 ...? ?-map list?

  Arguments: | objs: Objects to be serialized
  | ?-ignoreVarsRE RE?: provide regular expression; matching vars are ignored
  | ?-ignore obj1 obj2 ...?: provide a list of objects to be omitted
  | ?-map list?: translate object names in serialized code
  Description: | Serialize object with all child objects (deep operation) except the specified omissions. For the description of `ignore` and `igonoreVarsRE` see `Serizalizer all`. `map` can be used in addition to provide pairs of old-string and new-string (like in the tcl command `string map`). This option can be used to regenerate the serialized object under a different object or under an different name, or to translate relative object names in the serialized code. Examples: `Serializer deepSerialize ::a::b::c -map {::a::b ::x::y}` Serialize the object `c` which is a child of `a::b`; the object will be reinitialized as object `::x::y::c`, all references `::a::b` will be replaced by `::x::y`. `Serializer deepSerialize ::a::b::c -map {::a::b [self]}` The serizalized object can be reinstantiated under some current object, under which the script is evaluated. `Serializer deepSerialize ::a::b::c -map {::a::b::c ${var}}` The serizalized object will be reinstantiated under a name specified by the variable `var`in the recreation context.``
  Return: | script

Back to index page.