org.oddjob.arooa.standard
Class StandardArooaParser

java.lang.Object
  extended by org.oddjob.arooa.standard.StandardArooaParser
All Implemented Interfaces:
ArooaParser

public class StandardArooaParser
extends Object
implements ArooaParser

An ArooaParser that configures a provided root Object. The root Object is considered to be a component and so may be given an id and is registered with the the ComponentPool

Author:
rob

Constructor Summary
StandardArooaParser(Object root)
          Constructor that will use a StandardArooaSession with a StandardArooaDescriptor.
StandardArooaParser(Object root, ArooaDescriptor descriptor)
          Constructor with a ArooaDescriptor that will be used in a StandardArooaSession.
StandardArooaParser(Object root, ArooaSession session)
          Constructor with a ArooaSession.
 
Method Summary
 ArooaElement getExpectedDocumentElement()
          Getter for the expected document element.
 ArooaSession getSession()
          Get the ArooaSession used.
 ConfigurationHandle parse(ArooaConfiguration configuration)
          Parse an ArooaConfiguration.
 void setExpectedDocumentElement(ArooaElement exepectedDocumentElement)
          Set the expected document element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardArooaParser

public StandardArooaParser(Object root,
                           ArooaSession session)
Constructor with a ArooaSession.

Parameters:
root - The root object. Must not be null.
session - The ArooaSession. Must not be null.

StandardArooaParser

public StandardArooaParser(Object root,
                           ArooaDescriptor descriptor)
Constructor with a ArooaDescriptor that will be used in a StandardArooaSession.

Parameters:
root - The root object. Must not be null.
descriptor - The Descriptor. May be null.

StandardArooaParser

public StandardArooaParser(Object root)
Constructor that will use a StandardArooaSession with a StandardArooaDescriptor.

Parameters:
root - The root object. Must not be null.
Method Detail

setExpectedDocumentElement

public void setExpectedDocumentElement(ArooaElement exepectedDocumentElement)
Set the expected document element. If present the document element of the configuration will be check against this. Otherwise the document element can be anything.

Parameters:
exepectedDocumentElement -

getExpectedDocumentElement

public ArooaElement getExpectedDocumentElement()
Getter for the expected document element.

Returns:

parse

public ConfigurationHandle parse(ArooaConfiguration configuration)
                          throws ArooaParseException
Description copied from interface: ArooaParser
Parse an ArooaConfiguration.

Specified by:
parse in interface ArooaParser
Parameters:
configuration - The configuration.
Returns:
A ConfigurationHandle.
Throws:
ArooaParseException - If parsing fails.

getSession

public ArooaSession getSession()
Get the ArooaSession used. This will either be as provided or the one created.

Returns:
The ArooaSession. Never null.