from __future__ import annotations

from typing import Dict


class AbstractCollector(object):
    def start(self, tag: str, attrs: dict):
        raise NotImplementedError()

    def end(self, tag: str):
        raise NotImplementedError()

    def data(self, text: str):
        raise NotImplementedError()

    def comment(self, text: str):
        raise NotImplementedError()

    def close(self):
        raise NotImplementedError()


class CollectorHandler(AbstractCollector):
    TAG: str = None

    def __init__(self, sub_handlers: Dict[str, CollectorHandler] = None):
        self.sub_handlers = sub_handlers or {}

    def init(self, attrs: dict):
        pass

    def start(self, tag: str, attrs: dict):
        pass

    def end(self, tag: str):
        pass

    def data(self, text: str):
        pass

    def comment(self, text: str):
        pass

    def close(self):
        pass
