eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'ObjectCoder':

Home

everywhere
www.exept.de
for:
[back]

Class: ObjectCoder


Inheritance:

   Object
   |
   +--Visitor
      |
      +--AspectVisitor
         |
         +--ObjectCoder
            |
            +--BaseNCoder
            |
            +--JSONPrinter
            |
            +--XMLCoder

Package:
stx:libbasic
Category:
System-Storage
Version:
rev: 1.15 date: 2005/11/16 08:47:25
user: stefan
file: ObjectCoder.st directory: libbasic
module: stx stc-classLibrary: libbasic
Author:
Stefan Vogel

Description:


This is an abstract class. Subclasses implement encoding and decoding
of Objects onto resp. from a stream. Possible coders are ASN.1/BER,
CORBA/CDR, BOSS, RMI ...

Classes which implement basic types (Boolean, Integer, Float, ...)
implement the visitor methods #acceptVisitor:with:, which dispatches onto an ObjectCoder.



[instance variables:]
    stream  <Stream>        the stream we read/write the encodings from/to

[class variables:]


Related information:

    OSI::ASN1_Coder

Class protocol:

encoding
o  decode: anObject
decode anObject

o  decodingOf: anObject
use encode

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  encode: anObject
encode of anObject

o  encode: anObject on: aStream

o  encode: anObject on: aStream with: info

o  encode: anObject with: aParameter
return the encoding of anObject

o  encodingOf: anObject
use #encode:

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  encodingOf: anObject with: aParameter
use #encode:with:

** This is an obsolete interface - do not use it (it may vanish in future versions) **

instance creation
o  on: aStream
return an encoder/decoder for a stream


Instance protocol:

accessing
o  contents

decoding
o  next
read, decode and return the next object

** This method raises an error - it must be redefined in concrete classes **

encoding
o  encodingOf: anObject
answer the encoded argument anObject

o  encodingOf: anObject with: aParameter
answer the encoded argument anObject

o  nextPut: anObject
encode anObject onto my stream

o  nextPut: anObject with: aParameter
encode anObject onto my stream

o  nextPutAll: aCollectionOfObjects
encode all objects from the argument

encoding-smalltalk types
o  visitBlock: aBlock with: aParameter
encoding of blocks is rather difficult and an error by default.
If your encoder supports this, redefine it there

initialization
o  close
close the underlying stream

o  emptyWriteStream
answer an empty stream for writing the encoded object

** This method raises an error - it must be redefined in concrete classes **

o  flush
flush possibly internally buffered data.
Nothing is done by default. Subclasses may redefine this

o  reset
reset the coder

private-accessing
o  stream: aStream



ST/X 6.1.1; WebServer 1.620 at exept:8081; Wed, 23 May 2012 20:20:26 GMT