Packageorg.pranaframework.ioc.factory.xml.parser.support
Classpublic class XMLObjectDefinitionsParser
SubclassesFlexXMLObjectDefinitionsParser

Xml parser for object definitions.



Public Properties
 PropertyDefined by
  nodeParsers : Array
[read-only] Returns all registered implementations of INodeParser.
XMLObjectDefinitionsParser
  objectFactory : IXMLObjectFactory
The objectFactory currently in use
XMLObjectDefinitionsParser
Public Methods
 MethodDefined by
  
Constructs a new XmlObjectDefinitionsParser.
XMLObjectDefinitionsParser
  
Adds a NodeParser to the parser.
XMLObjectDefinitionsParser
  
Adds a preprocessor to the parser.
XMLObjectDefinitionsParser
  
parse(xml:XML, properties:Array = null):IXMLObjectFactory
Parses all object definitions and returns the objectFactory that contains the parsed results.
XMLObjectDefinitionsParser
  
Parses and registers an object definition.
XMLObjectDefinitionsParser
  
Parses the given object definition node into an implementation of IObjectDefinition.
XMLObjectDefinitionsParser
  
parseProperty(node:XML):Object
Will parse the given property node.
XMLObjectDefinitionsParser
  
parsePropertyValue(node:XML):Object
Will parse the given property value using the node parsers.
XMLObjectDefinitionsParser
Public Constants
 ConstantDefined by
  ARRAY_COLLECTION_ELEMENT : String = "array-collection"
[static] Constant value 'array-collection'
XMLObjectDefinitionsParser
  ARRAY_ELEMENT : String = "array"
[static] Constant value 'array'
XMLObjectDefinitionsParser
  CLASS_ATTRIBUTE : String = "class"
[static] Constant value 'class'
XMLObjectDefinitionsParser
  CONSTRUCTOR_ARG_ELEMENT : String = "constructor-arg"
[static] Constant value 'constructor-arg'
XMLObjectDefinitionsParser
  DICTIONARY_ELEMENT : String = "dictionary"
[static] Constant value 'dictionary'
XMLObjectDefinitionsParser
  ENTRY_ELEMENENT : String = "entry"
[static] Constant value 'entry'
XMLObjectDefinitionsParser
  FACTORY_METHOD_ATTRIBUTE : String = "factory-method"
[static] Constant value 'factory-method'
XMLObjectDefinitionsParser
  ID_ATTRIBUTE : String = "id"
[static] Constant value 'id'
XMLObjectDefinitionsParser
  INIT_METHOD_ATTRIBUTE : String = "init-method"
[static] Constant value 'init-method'
XMLObjectDefinitionsParser
  KEY_ATTRIBUTE : String = "key"
[static] Constant value 'key'
XMLObjectDefinitionsParser
  KEY_ELEMENT : String = "key"
[static] Constant value 'key'
XMLObjectDefinitionsParser
  LAZY_INIT_ATTRIBUTE : String = "lazy-init"
[static] Constant value 'lazy-init'
XMLObjectDefinitionsParser
  LIST_ELEMENT : String = "list"
[static] Constant value 'list'
XMLObjectDefinitionsParser
  MAP_ELEMENT : String = "map"
[static] Constant value 'map'
XMLObjectDefinitionsParser
  OBJECT_ELEMENT : String = "object"
[static] Constant value 'object'
XMLObjectDefinitionsParser
  PROPERTY_ELEMENT : String = "property"
[static] Constant value 'property'
XMLObjectDefinitionsParser
  REF_ATTRIBUTE : String = "ref"
[static] Constant value 'ref'
XMLObjectDefinitionsParser
  REF_ELEMENT : String = "ref"
[static] Constant value 'ref'
XMLObjectDefinitionsParser
  SCOPE_ATTRIBUTE : String = "scope"
[static] Constant value 'scope'
XMLObjectDefinitionsParser
  TEMPLATE_ELEMENT : String = "template"
[static] Constant value 'template'
XMLObjectDefinitionsParser
  VALUE_ATTRIBUTE : String = "value"
[static] Constant value 'value'
XMLObjectDefinitionsParser
  VALUE_ELEMENT : String = "value"
[static] Constant value 'value'
XMLObjectDefinitionsParser
Property detail
nodeParsersproperty
nodeParsers:Array  [read-only]

Returns all registered implementations of INodeParser. Node parsers can be added using the addNodeParser method.

Implementation
    public function get nodeParsers():Array

See also

objectFactoryproperty 
objectFactory:IXMLObjectFactory  [read-write]

The objectFactory currently in use

The default value is an instance of XMLObjectFactory.

Implementation
    public function get objectFactory():IXMLObjectFactory
    public function set objectFactory(value:IXMLObjectFactory):void

See also

Constructor detail
XMLObjectDefinitionsParser()constructor
public function XMLObjectDefinitionsParser(objectFactory:IXMLObjectFactory = null)

Constructs a new XmlObjectDefinitionsParser. An optional objectFactory can be passed to store the definitions. If no container is passed then a new instance will be created of type XMLObjectFactory.

Will add the following node parsers by default:

Parameters
objectFactory:IXMLObjectFactory (default = null) — the objectFactory where the object definitions will be stored

See also

Method detail
addNodeParser()method
public function addNodeParser(parser:INodeParser):void

Adds a NodeParser to the parser.

Parameters
parser:INodeParser — The inplementation of INodeParser that will be added
addPreprocessor()method 
public function addPreprocessor(preprocessor:IXMLObjectDefinitionsPreprocessor):void

Adds a preprocessor to the parser.

Parameters
preprocessor:IXMLObjectDefinitionsPreprocessor — The inplementation of IXMLObjectDefinitionsPreprocessor that will be added
parse()method 
public function parse(xml:XML, properties:Array = null):IXMLObjectFactory

Parses all object definitions and returns the objectFactory that contains the parsed results.

Parameters
xml:XML — the xml object with the object definitions
 
properties:Array (default = null) — an array of Properties objects

Returns
IXMLObjectFactory — the objectFactory with the parsed object definitions
parseAndRegisterObjectDefinition()method 
public function parseAndRegisterObjectDefinition(node:XML):String

Parses and registers an object definition.

Parameters
node:XML — The xml node to create an object definition from.

Returns
String
parseObjectDefinition()method 
public function parseObjectDefinition(xml:XML):IObjectDefinition

Parses the given object definition node into an implementation of IObjectDefinition.

Parameters
xml:XML — The object definition node

Returns
IObjectDefinition — an implementation of IObjectDefinition
parseProperty()method 
public function parseProperty(node:XML):Object

Will parse the given property node. If the given property does not contain a value attribute, the first childNode will be used as value else the value of the property will be parsed and returned using the parsePropertyValue method.

Parameters
node:XML — The property node to be parsed

Returns
Object — the value of the parsed node

See also

parsePropertyValue()method 
public function parsePropertyValue(node:XML):Object

Will parse the given property value using the node parsers.

Will loop through the node parsers in the order that they have been added. The first parser able to parse the node is used to retrieve the value.

Parameters
node:XML — The property value node to be parsed

Returns
Object — the value of the node after parsing
Constant detail
ARRAY_COLLECTION_ELEMENTconstant
public static const ARRAY_COLLECTION_ELEMENT:String = "array-collection"

Constant value 'array-collection'

ARRAY_ELEMENTconstant 
public static const ARRAY_ELEMENT:String = "array"

Constant value 'array'

CLASS_ATTRIBUTEconstant 
public static const CLASS_ATTRIBUTE:String = "class"

Constant value 'class'

CONSTRUCTOR_ARG_ELEMENTconstant 
public static const CONSTRUCTOR_ARG_ELEMENT:String = "constructor-arg"

Constant value 'constructor-arg'

DICTIONARY_ELEMENTconstant 
public static const DICTIONARY_ELEMENT:String = "dictionary"

Constant value 'dictionary'

ENTRY_ELEMENENTconstant 
public static const ENTRY_ELEMENENT:String = "entry"

Constant value 'entry'

FACTORY_METHOD_ATTRIBUTEconstant 
public static const FACTORY_METHOD_ATTRIBUTE:String = "factory-method"

Constant value 'factory-method'

ID_ATTRIBUTEconstant 
public static const ID_ATTRIBUTE:String = "id"

Constant value 'id'

INIT_METHOD_ATTRIBUTEconstant 
public static const INIT_METHOD_ATTRIBUTE:String = "init-method"

Constant value 'init-method'

KEY_ATTRIBUTEconstant 
public static const KEY_ATTRIBUTE:String = "key"

Constant value 'key'

KEY_ELEMENTconstant 
public static const KEY_ELEMENT:String = "key"

Constant value 'key'

LAZY_INIT_ATTRIBUTEconstant 
public static const LAZY_INIT_ATTRIBUTE:String = "lazy-init"

Constant value 'lazy-init'

LIST_ELEMENTconstant 
public static const LIST_ELEMENT:String = "list"

Constant value 'list'

MAP_ELEMENTconstant 
public static const MAP_ELEMENT:String = "map"

Constant value 'map'

OBJECT_ELEMENTconstant 
public static const OBJECT_ELEMENT:String = "object"

Constant value 'object'

PROPERTY_ELEMENTconstant 
public static const PROPERTY_ELEMENT:String = "property"

Constant value 'property'

REF_ATTRIBUTEconstant 
public static const REF_ATTRIBUTE:String = "ref"

Constant value 'ref'

REF_ELEMENTconstant 
public static const REF_ELEMENT:String = "ref"

Constant value 'ref'

SCOPE_ATTRIBUTEconstant 
public static const SCOPE_ATTRIBUTE:String = "scope"

Constant value 'scope'

TEMPLATE_ELEMENTconstant 
public static const TEMPLATE_ELEMENT:String = "template"

Constant value 'template'

VALUE_ATTRIBUTEconstant 
public static const VALUE_ATTRIBUTE:String = "value"

Constant value 'value'

VALUE_ELEMENTconstant 
public static const VALUE_ELEMENT:String = "value"

Constant value 'value'