Packageorg.springextensions.actionscript.ioc.factory.xml.parser.support.nodeparsers
Classpublic class AbstractNodeParser
ImplementsINodeParser
SubclassesArrayCollectionNodeParser, ArrayNodeParser, DictionaryNodeParser, KeyValueNodeParser, NullNodeParser, ObjectNodeParser, RefNodeParser

Abstract base class for node parsers.

Authors: Christophe Herreman, Erik Westra
Version: $Revision: 21 $, $Date: 2008-11-01 22:58:42 +0100 (za, 01 nov 2008) $, $Author: dmurat $
Since: 0.1



Protected Properties
 PropertyDefined by
  nodeNames : Array
An array containing the compatible node names.
AbstractNodeParser
  xmlObjectDefinitionsParser : XMLObjectDefinitionsParser
The xmlObjectDefinitionsParser using this NodeParser
AbstractNodeParser
Public Methods
 MethodDefined by
  
AbstractNodeParser(xmlObjectDefinitionsParser:XMLObjectDefinitionsParser, nodeName:String)
This class should not be instantiated directly.
AbstractNodeParser
  
addNodeNameAlias(alias:String):void
Will add an alias that this node parser will react upon.
AbstractNodeParser
  
canParse(node:XML):Boolean
Determines if the given node can be parsed.
AbstractNodeParser
  
getNodeNames():Array
Return an array containing the node names this parser can parse
AbstractNodeParser
  
parse(node:XML):Object
This is an abstract method and should be overridden in a subclass.
AbstractNodeParser
Property detail
nodeNamesproperty
protected var nodeNames:Array

An array containing the compatible node names.

xmlObjectDefinitionsParserproperty 
protected var xmlObjectDefinitionsParser:XMLObjectDefinitionsParser

The xmlObjectDefinitionsParser using this NodeParser

Constructor detail
AbstractNodeParser()constructor
public function AbstractNodeParser(xmlObjectDefinitionsParser:XMLObjectDefinitionsParser, nodeName:String)

This class should not be instantiated directly. Create a subclass that implements the parse method.

Parameters
xmlObjectDefinitionsParser:XMLObjectDefinitionsParser — The definitions parser using this NodeParser
 
nodeName:String — The name of the node this parser should react to
Method detail
addNodeNameAlias()method
public function addNodeNameAlias(alias:String):void

Will add an alias that this node parser will react upon. It has direct influence on the result of the canParse method.

Parameters
alias:String — Alternative nodename that can be parsed by this parser
canParse()method 
public function canParse(node:XML):Boolean

Determines if the given node can be parsed.

Parameters
node:XML — The node to be checked.

Returns
Boolean — true if this implementation can parse the given node.
getNodeNames()method 
public function getNodeNames():Array

Return an array containing the node names this parser can parse

Returns
Array
parse()method 
public function parse(node:XML):Object

This is an abstract method and should be overridden in a subclass. Will parse the given node. The type of the result depends on the implementation of the node parser.

Parameters
node:XML — The node that will be parsed

Returns
Object — the parsed node