ElementImpl encapsulates the common properties and behaviour of an element.
Common Element Structure
An Element consists of:
- max 1 constructor together with * VariableElement-children as constructor
parameters.
- * ActionElement-children
- max 1 action together with * VariableElement-children as action
parameters.
Common processing procedures
ElementImpl defines the common procedures for processing these
sub-components. The details of the processing can be tricky - an Element
might or might not have a constructor, it might or might not have an element,
etc.
Lack of the exact runtime-behaviour
the runtime-behaviour of an Element is defined by interfaces VariableElement and
ActionElement. Whether an Element becomes an VariableElement or an ActionElement
depends on the state of the Element.
ElementImpl can be initialized little-by-little, it is designed to be used
together with ElementCompiler. because of this approach, the
runtime-behaviour of the Element is known only when the Element is completely
initialized.
After an ElementImpl-object is completely initialized, its runtime-version
(VariableElement or ActionElement) can be obtained with method
toRuntimeElement().
id binding
the object is added to the global-context only after it is created. this
way, the child-elements that are constructor parameters are processed before
the element has used its id-attribute. therefore, if a child has a same
id than the parent, the duplicate-id-exceptions will blame the wrong
element for the id - the parent.
Copyright (C) 2004 Timo Laitinen
author: .timo |