ProtoObjectObjectWAHtmlElement
| attributes | children | isClosed | name |
| instance | class |
|---|---|
| as yet unclassified | as yet unclassified |
| attributes |
|---|
|
| children |
|---|
|
| isClosed |
|---|
|
| name |
|---|
|
| as yet unclassified |
|---|
| add: anElement |
children ifNil: [children _ OrderedCollection new]. children add: anElement. |
| attributeAt: aString put: anObject |
attributes at: aString put: anObject |
| beClosed |
isClosed _ true |
| childrenDo: aBlock |
children ifNotNil: [children do: aBlock] |
| initializeWithName: aString attributes: anAttributes |
name _ aString. attributes _ anAttributes. isClosed _ true. |
| name |
^ name asLowercase |
| notClosed |
isClosed _ false |
| printCloseTagOn: aStream |
aStream nextPutAll: '</'; nextPutAll: self name; nextPut: $> |
| printHtmlOn: aStream |
self printOpenTagOn: aStream. self childrenDo: [:ea | ea writeOn: aStream]. self shouldPrintCloseTag ifTrue: [self printCloseTagOn: aStream]. |
| printOpenTagOn: aStream |
aStream nextPut: $<; nextPutAll: self name. attributes ifNotNil: [attributes writeOn: aStream]. self shouldPrintCloseTag ifFalse: [aStream nextPutAll: ' /']. aStream nextPut: $> |
| shouldPrintCloseTag |
^ isClosed |
| writeOn: aStream |
self printOpenTagOn: aStream. self childrenDo: [:ea | ea isString ifTrue: [aStream nextPutAll: ea] ifFalse: [ea writeOn: aStream]]. self shouldPrintCloseTag ifTrue: [self printCloseTagOn: aStream]. |
| as yet unclassified |
|---|
| named: aString |
^ self named: aString attributes: (WAHtmlAttributes new) |
| named: aString attributes: anAttributes |
^ self new initializeWithName: aString attributes: anAttributes |