| 480 | * https://en.wikipedia.org/wiki/State_pattern |
| 481 | */ |
| 482 | export class XmlStateParser implements XmlConsumer { |
| 483 | private state: XmlStateConsumer; |
| 484 | |
| 485 | constructor(state: XmlStateConsumer) { |
| 486 | this.state = state; |
| 487 | } |
| 488 | |
| 489 | parse(args: xml.ParserEvent) { |
| 490 | this.state = this.state.parse(args); |
| 491 | } |
| 492 | } |
| 493 | |
| 494 | interface XmlStateConsumer extends XmlConsumer { |
| 495 | parse(args: xml.ParserEvent): XmlStateConsumer; |
nothing calls this directly
no outgoing calls
no test coverage detected