Package org.oddjob.arooa.standard
Class StandardArooaParser
java.lang.Object
org.oddjob.arooa.standard.StandardArooaParser
- All Implemented Interfaces:
ArooaParser<ArooaContext>
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
ConstructorsConstructorDescriptionStandardArooaParser(Object root) Constructor that will use aStandardArooaSessionwith aStandardArooaDescriptor.StandardArooaParser(Object root, ArooaDescriptor descriptor) Constructor with aArooaDescriptorthat will be used in aStandardArooaSession.StandardArooaParser(Object root, ArooaSession session) Constructor with aArooaSession. -
Method Summary
Modifier and TypeMethodDescriptionGetter for the expected document element.Get theArooaSessionused.parse(ArooaConfiguration configuration) Parse anArooaConfiguration.voidsetExpectedDocumentElement(ArooaElement expectedDocumentElement) Set the expected document element.
-
Constructor Details
-
StandardArooaParser
Constructor with aArooaSession.- Parameters:
root- The root object. Must not be null.session- The ArooaSession. Must not be null.
-
StandardArooaParser
Constructor with aArooaDescriptorthat will be used in aStandardArooaSession.- Parameters:
root- The root object. Must not be null.descriptor- The Descriptor. May be null.
-
StandardArooaParser
Constructor that will use aStandardArooaSessionwith aStandardArooaDescriptor.- Parameters:
root- The root object. Must not be null.
-
-
Method Details
-
setExpectedDocumentElement
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:
expectedDocumentElement-
-
getExpectedDocumentElement
Getter for the expected document element.- Returns:
-
parse
public ConfigurationHandle<ArooaContext> parse(ArooaConfiguration configuration) throws ArooaParseException Description copied from interface:ArooaParserParse anArooaConfiguration.- Specified by:
parsein interfaceArooaParser<ArooaContext>- Parameters:
configuration- The configuration.- Returns:
- A
ConfigurationHandle. - Throws:
ArooaParseException- If parsing fails.
-
getSession
Get theArooaSessionused. This will either be as provided or the one created.- Returns:
- The ArooaSession. Never null.
-