Object.st
changeset 12703 b87cc4993193
parent 12566 4e8084624f5d
child 12709 ce555ea9068f
--- a/Object.st	Fri Feb 05 14:00:22 2010 +0100
+++ b/Object.st	Mon Feb 08 11:42:29 2010 +0100
@@ -478,7 +478,6 @@
     ^ WarningSignal
 ! !
 
-
 !Object class methodsFor:'info messages'!
 
 infoPrinting
@@ -518,6 +517,70 @@
     "Modified: 23.4.1996 / 16:00:07 / cg"
 ! !
 
+!Object class methodsFor:'spray'!
+
+sprayInstanceWith: aXeContent
+	#swAdded.
+	^self basicNew
+!
+
+sprayTypeName
+	"Answer the XMLSchema type <XeName> for the receiver's instances.
+	-Default to answering a late-qualifying XePName with the 'd' prefix and the class name.
+		-In a default typespace, the prefix 'd' late qualifies to a namespace targeted by a <XeSprayClassFactory>"
+
+	#swAdded.
+	Smalltalk isSmalltalkX ifTrue:[
+	    ^SOAP::XePName prefix: 'd' local: self nameWithoutPrefix asString
+	].
+	^SOAP::XePName prefix: 'd' local: self name asString
+!
+
+sprayValueTypeName
+	"Answer the XMLSchema type <XeName> that the receivers instances extend.
+	-Used by a <XeSimpleClassFactory> to create XMLSchema simple content definitions.
+	-If the receiver implements this method, it also needs to define #sprayAttributes"
+
+	#swAdded.
+	^self error: 'Not simple content'
+! !
+
+!Object class methodsFor:'spray factory'!
+
+sprayAttributes
+	"Answer a collection of <XeAttributeSpec>s.
+	-The answer is used by a <XeSprayClassFactory> to build a schema definition for the class."
+
+	#swAdded.
+	^#()
+!
+
+sprayElements
+	"Answer a collection of <XeElementSpec>s.
+	-The answer is used by a <XeSprayClassFactory> to build a schema definition for the class.
+	-This has a similar function to an XMLSchema complexType definition. For example;
+
+<schema>
+<complexType name='Something'>
+  <element name='foo' type='xsd:string'/>
+  <element name='bar' type='xsd:integer'/>
+</complexType>
+</schema>
+
+Would be equivelent to a method
+
+	Something(class)>>sprayElement;
+
+	^OrderedCollection new
+		add: (XeElementSpec named: #foo xsdTyped: 'string');
+		add: (XeElementSpec named: #bar xsdTyped: 'integer');
+		yourself
+"
+
+	#swAdded.
+	^Error signal: 'This class does not define any child xml elements'
+! !
+
 !Object methodsFor:'Compatibility-Dolphin'!
 
 stbFixup: anSTBInFiler at: newObjectIndex
@@ -691,6 +754,8 @@
     "
 ! !
 
+
+
 !Object methodsFor:'accessing'!
 
 at:index
@@ -2662,7 +2727,6 @@
     ^ aCopy
 ! !
 
-
 !Object methodsFor:'debugging'!
 
 assert:aBooleanOrBlock
@@ -6398,18 +6462,21 @@
 !
 
 errorPrint
-    "print the receiver on the Transcript.
+    "print the receiver on the Transcript and Stderr.
      The Transcript is directed to the standard error stream on
      headless applications."
 
     |s|
 
     s := Processor activeProcess isSystemProcess
-			ifTrue:Stderr
-			ifFalse:Transcript.
+                        ifTrue:Stderr
+                        ifFalse:Transcript.
     StreamError catch:[
-	self printOn:s
-    ]
+        self printOn:s
+    ].
+    s ~~ Stderr ifTrue:[
+        self printOn:Stderr
+    ].
 
     "Modified: / 29-05-2007 / 20:00:54 / cg"
 !
@@ -6417,19 +6484,23 @@
 errorPrintCR
     "{ Pragma: +optSpace }"
 
-    "print the receiver followed by a cr on the standard error stream.
+    "print the receiver followed by a cr on the error stream(s).
      The Transcript is directed to the standard error stream on
      headless applications."
 
     |s|
 
     s := Processor activeProcess isSystemProcess
-			ifTrue:Stderr
-			ifFalse:Transcript.
+                        ifTrue:Stderr
+                        ifFalse:Transcript.
     StreamError catch:[
-	self printOn:s.
-	s cr
-    ]
+        self printOn:s.
+        s cr
+    ].
+    s ~~ Stderr ifTrue:[
+        self printOn:Stderr.
+        Stderr cr
+    ].
 
     "Created: / 20-05-1996 / 10:20:41 / cg"
     "Modified: / 29-05-2007 / 20:00:49 / cg"
@@ -7762,6 +7833,55 @@
     "
 ! !
 
+
+!Object methodsFor:'spray'!
+
+isSoapEncSameAs: anObject
+	#swAdded.
+	^self = anObject
+!
+
+schemaDisplayString
+    "Answer a <readableString> which is a valid XMLSchema lexical representation of the receiver"
+
+    #swAdded.
+    Smalltalk isSmalltalkX ifTrue:[
+	^ self printString
+    ].
+    ^self displayString
+!
+
+sprayTypeName
+    "Answer the <XeName> of the receiver's XMLSchema type.
+    -Should only be implemented as an instance method if different instances have different type"
+
+    #swAdded.
+    ^self class sprayTypeName
+!
+
+xeContentWith: anEncodingStyle
+    "Answer a <XeContent> for the receiver.
+    --Only override this method if different instances have different type (See XeQStruct , and KeyedCollections,)."
+
+    #swAdded.
+    ^self sprayTypeName xeContentWith: anEncodingStyle
+!
+
+xmlDecodeFixupWith: aNodeDecoding
+    "Answer the true object that must be used to represent the receiver when decoded from xml."
+
+    #swAdded.
+    ^self
+!
+
+xmlEncodeUsing: aXeSoapXMLWriter
+    "Answer if the receiver has perfomed the encoding itself.
+     Sent by  the <XeSoapXMLWriter>, to give the receiver the opportunity to override standard encoding."
+
+    #swAdded.
+    ^false
+! !
+
 !Object methodsFor:'synchronized evaluation'!
 
 freeSynchronizationSemaphore
@@ -9301,11 +9421,11 @@
 !Object class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.645 2009-11-28 00:23:53 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.646 2010-02-08 10:42:29 sr Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.645 2009-11-28 00:23:53 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.646 2010-02-08 10:42:29 sr Exp $'
 ! !
 
 Object initialize!