|
Class: XMLStandardDecoder
Object
|
+--XML::SAXDriver
|
+--XMLStandardDecoder
- Package:
- stx:goodies/xml/stx
- Category:
- XML-Presentation
- Version:
- rev:
1.36
date: 2018/02/02 16:38:56
- user: cg
- file: XMLStandardDecoder.st directory: goodies/xml/stx
- module: stx stc-classLibrary: stx
- Author:
- Stefan Vogel (stefan@zwerg)
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:]
ObjectCoder
XMLCoder
XMLStandardCoder
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: classGiven 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
-
-
startElement: localName namespace: namespace prefix: nameSpacePrefix attributes: attributes
-
aspect may be present only in the start element
error handler
-
error: anInvalidSignal
-
Called when a validating is on and parser reaches invalid XML. Is resumable
Also called when a class does not exist
-
fatalError: anXMLSignal
-
The XML parsers malformed and invalid signals are sent to this method
-
warning: aWarningSignal
-
initialization
-
initialize
-
AbstractConverter
Base64Converter
CharacterConverter
ContainedObject
ContainedSequence
NumberConverter
StringConverter
SymbolConverter
Look at examples in XMLStandardCoder
|