|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The base interface that all TagHandlers must implement.
All Builder
instances use
TagHandler
instances to parse
the document's content.
All methods of TagHandler
are
based on the equivalent ContentHandler
interface.
The difference is that the TagHandler
interface prepends a tagContext
parameter to all methods.
This parameter is guaranteed to be the same accross all calls to all
TagHandler
methods.
TagHandler
s are encouraged to keep
context information in this Map
to refer to it later
as other elements are encountered.
For example usage of the tagContext
parameter, look at the
current implementation.
ContentHandler
Field Summary | |
static String |
CALL_RETURN_CLASS_KEY
Key to access the last <methodCall>'s return value's class. |
static String |
CALL_RETURN_VALUE_KEY
Key to access the last <methodCall>'s return value. |
static String |
CONSTANTS_MAP_KEY
Key to access the context's Map of constants.
|
static String |
CONTROLS_STACK_KEY
Deprecated. Replaced by CURRENT_OBJECTS_STACK_KEY . |
static String |
CURRENT_CONSTRAINTS_KEY
Key to access the next control's constraints. |
static String |
CURRENT_MODEL_ADAPTER
Model keys |
static String |
CURRENT_MODEL_ATTRIBUTE
Model keys |
static String |
CURRENT_OBJECT_ID_KEY
Key to access the current construction's ID. |
static String |
CURRENT_OBJECT_KEY
Deprecated. Replaced by AbstractTagHandler.getCurrentObject() .
The default implementation should not use this key anymore. |
static String |
CURRENT_OBJECTS_STACK_KEY
Key to access the context's current objects stack. |
static String |
CURRENT_PARM_ACC_KEY
Key to access the context's current ConstructorCall
object.
|
static String |
CURRENT_WINDOW_ID_KEY
Key to access the context's current window's ID. |
static String |
CURRENT_WINDOW_KEY
Key to access the context's current window reference. |
static String |
DOCUMENT_LOCATOR_KEY
Key to access the current document's locator. |
static String |
MODEL_ID
Model keys |
static String |
OBJECTS_MAP_KEY
Key to access the context's Map of built objects.
|
static String |
PARAMETER_CLASS_KEY
Key to access the current parameter or property class. |
static String |
PARAMETER_VALUE_KEY
Key to access the current parameter or property class. |
static String |
PROPERTY_NAME_KEY
Key to access the current parameter or property name. |
static String |
TAG_HANDLER_FACTORY_STACK_KEY
Key to access the context's TagHandlerFactory stack.
|
static String |
WINDOW_CONTEXT_KEY
The WindowContext which is building
the current window. |
static String |
WINDOW_KEY
The builder itself |
Method Summary | |
void |
endElement(String qName,
Map tagContext)
Signals the end of an element in the XML source. |
void |
startElement(String qName,
Map tagContext,
Map atts)
Signals the start of a new element in the XML source. |
Field Detail |
public static final String CURRENT_OBJECTS_STACK_KEY
Initialized in Builder
.
Never removed
Contains: a reference to aStack
object.
public static final String CURRENT_PARM_ACC_KEY
ConstructorCall
object.
Use this key when implementing TagHandler
s that must
update information on how the current object will be instantiated
(parameters to constructor, for instance).
exitElement()
.
Initialized in ObjectTagHandler
.
Removed in ParameterTagHandler
.
Contains: a reference to a ConstructorCall
object.
public static final String OBJECTS_MAP_KEY
Map
of built objects.
Use this key when referring to previously built objects in the current file.
Initialized in Builder
.
Never removed
Contains: a reference to a Map
object.
public static final String CURRENT_WINDOW_KEY
When the builder encounters a <window> element, it instantiates a window and saves the reference in the context. This way, descendants may use the context to get the current window, when they need it.
Initialized in WindowTagHandler
.
Removed in WindowTagHandler
.
Contains: a reference to a Window
object. This depends
on the type
attribute that was encountered earlier on.
public static final String CURRENT_WINDOW_ID_KEY
When the builder encounters a <window> element, it saves the element's ID in the context. This way, descendants may refer to the window's ID to get the object when they need it.
Initialized in WindowTagHandler
.
Removed in WindowTagHandler
.
Contains: a reference to a String
object.
public static final String CONTROLS_STACK_KEY
CURRENT_OBJECTS_STACK_KEY
.
When the builder encounters a <controls> element, it pushes the current window's content pane on a stack, which it stores under this key. As new controls are encountered, they are pushed on the stack. Once all controls have been built, the stack should be empty, and will be removed.
Initialized in ControlsTagHandler
.
Removed in ControlsTagHandler
.
Contains: a reference to a Stack
object.
public static final String CONSTANTS_MAP_KEY
Map
of constants.
This map must contain two items per constant definition:
This item will be used by
ConstantTagHandler
to
find the map of constant names to values.
Initialized in Builder
.
Never removed.
Contains: a reference to a Map
object.
public static final String CURRENT_OBJECT_KEY
AbstractTagHandler.getCurrentObject()
.
The default implementation should not use this key anymore.
Use this key when you need to refer to the object that has been built. This reference is valid until another object is being built, or the current scope terminates.
Initialized in ObjectTagHandler
.
Removed in ObjectTagHandler
.
Contains: a reference to a Object
object
(actually, the constructed object's class).
public static final String CURRENT_OBJECT_ID_KEY
This key refers to the id attribute of the <object> element.
Initialized in ObjectTagHandler
.
Removed in ObjectTagHandler
.
Contains: a reference to a String
object.
public static final String CURRENT_CONSTRAINTS_KEY
When the builder encounters <constraints>, it copies whatever was in the element's value and puts it in the context under this key. When the next controls are added, they will use these constraints.
Initialized in ConstraintsTagHandler
.
Removed in ControlsTagHandler
.
Contains: a reference to a Object
.
public static final String PROPERTY_NAME_KEY
While building properties accessors and parameters, this key refers to the entity's name.
Initialized in ParameterTagHandler
or PropertyTagHandler
Removed in ParameterTagHandler
or PropertyTagHandler
Contains: a reference to a String
object.
public static final String PARAMETER_CLASS_KEY
While building properties accessors and parameters, this key refers to the entity's class.
Initialized in ParameterTagHandler
or PropertyTagHandler
Removed in ParameterTagHandler
or PropertyTagHandler
Contains: a reference to a Class
object.
public static final String PARAMETER_VALUE_KEY
While building properties accessors and parameters, this key refers to the entity's instantiated object.
If the value property was set using <constant>, the class will be set to the class of the reference's class. If the value property was set using <ref>, the class will be set to the class of the reference.
Initialized in ValueTagHandler
,
ConstantTagHandler
or
RefTagHandler
.
Removed in ValueTagHandler
,
ConstantTagHandler
or
RefTagHandler
.
Contains: a reference to a Object
object.
public static final String CALL_RETURN_CLASS_KEY
MethodCalls store the return value's class in this context property.
Initialized in MethodCallTagHandler
.
Removed in MethodCallTagHandler
.
Contains: a reference to a Class
object.
public static final String CALL_RETURN_VALUE_KEY
MethodCalls store the return value in this context property.
Initialized in MethodCallTagHandler
.
Removed in MethodCallTagHandler
.
Contains: a reference to a Object
object.
public static final String TAG_HANDLER_FACTORY_STACK_KEY
TagHandlerFactory
stack.
The top of this stack must always be the current factory. It is illegal for this stack to become empty. The default builder stores it's factory on this stack when it starts up. Elements which update this stack must ensure to always leave it as it was when they are done. Usually, this means pushing a new factory when opening the element, and popping the same factory when closing the element.
Initialized in Builder
.
Removed in Builder
.
Contains: a reference to a Stack
.
public static final String DOCUMENT_LOCATOR_KEY
This locator key might not even exist because locators are the responsibility of the SAX parser, and are not required to provide one.
Initialized in Builder
.
Never removed.
Contains: a reference to a Locator
.
public static final String MODEL_ID
public static final String CURRENT_MODEL_ATTRIBUTE
public static final String CURRENT_MODEL_ADAPTER
public static final String WINDOW_KEY
public static final String WINDOW_CONTEXT_KEY
WindowContext
which is building
the current window.
Method Detail |
public void startElement(String qName, Map tagContext, Map atts) throws org.xml.sax.SAXException
The Builder
object will call this method
whenever it encounters a new element.
qName
- The qualified name of the element as it was encountered.tagContext
- A map of context information that is kept accross
all calls to TagHandler
s.atts
- A map of the attributes that were passed to this element.
org.xml.sax.SAXException
public void endElement(String qName, Map tagContext) throws org.xml.sax.SAXException
The Builder
object will call this method
whenever an element ends.
qName
- The qualified name of the element as it was encountered.tagContext
- A map of context information that is kept accross
all calls to TagHandler
s.
org.xml.sax.SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |