|
Class: XMLStandardDecoder
Object
|
+--XML::SAXDriver
|
+--XMLStandardDecoder
- Package:
- stx:goodies/xml/stx
- Category:
- XML-Presentation
- Version:
- rev:
1.45
date: 2024-04-30 15:41:41
- user: stefan
- file: XMLStandardDecoder.st directory: goodies/xml/stx
- module: stx stc-classLibrary: stx
XMLStandardDecoder is used to decode the XML representation of objects encoded
with XMLStandardCoder
[instance variables:]
idToObjectMapping <Collection> Mapping from object ids to objects
object <Object> The decoded object
aspect <String|nil> The aspect used to encode
version <String|nil> The version provided by the encoder
stack <Stack> Stack of nested objects
characterStream <WriteStream>Stream to collect character data
needWhitespace <Bool> true, when whitespace should be preserved for the
current element
useSend <Bool> If true, use #perform: instead of
#instvarNamed:put: to build objects
[class variables:]
copyrightCOPYRIGHT (c) 2004 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
instance creation
-
on: readStream
-
redefine to switch off validation
-
on: readStream beforeScanDo: aBlock
-
redefine to switch off validation
accessing
-
aspect
-
return the value of the instance variable 'aspect' (automatically generated)
-
next
-
answer the next object from the stream.
Notice: VALID xml files contain only a single object.
-
object
-
-
useSend
-
-
useSend: aBoolean
-
if aBoolean is true, the decoder uses a message send to set the values of an object.
If aBoolean is false, the instance variables are set directly
-
version
-
return the value of the instance variable 'version' (automatically generated)
building
-
add: newObj toParent: parentObjectContainer with: currentObjectContainer
-
add an object to its parent object
-
remember: obj as: id
-
map an object id to an object.
We know here that object ids are consecutive integers starting at 1.
If this changes, we have to use a Dictionary instead of an OrderedCollection
-
valueForElementName: elementName class: classNameGiven size: sizeGiven
-
answer an object for a XML element name.
Only some primitive elements or containers may be resolved immediately.
Others need the elements text available only when the end tag is
being processed. In this case push a converter onto the stack and return 0
content handler
-
characters: aString
-
process xml character data.
If characters are separated by ignorable whitespace, this may
be called more than once for a single element
-
endElement: localName namespace: nameSpace prefix: nameSpacePrefix
-
end of xml element.
If stack is empty, this is the single top element.
Otherwise this is a subordinate element, that will be added
to its containing object
-
ignorableWhitespace: aString
-
got white space. We need all white space in strings and symbols
-
startDocument
-
(comment from inherited method)
Indicates the start of a document
-
startElement: localName namespace: namespace prefix: nameSpacePrefix attributes: attributes
-
aspect may be present only in the start element
initialization
-
initialize
-
(comment from inherited method)
just to ignore initialize to objects which do not need it
AbstractConverter
Base64Converter
CharacterConverter
ContainedObject
ContainedSequence
NumberConverter
StringConverter
SymbolConverter
Look at examples in XMLStandardCoder
|