Package org.oddjob.arooa.design
Class DesignParser
java.lang.Object
org.oddjob.arooa.design.DesignParser
- All Implemented Interfaces:
ArooaParser<ArooaContext>,DesignNotifier
Parses a configuration to create a
DesignInstance.
The Design is created using a DesignFactory. If one
is not provided a default factory is used which will first check
the ElementMappings of the sessions ArooaDescriptor
for a one. If none exists it will provide one that will dynamically
create a design from the properties of the class as derived from
the element and the mappings.
- Author:
- rob
-
Constructor Summary
ConstructorsConstructorDescriptionDefault Constructor.DesignParser(ArooaSession existingSession) Create a DesignParser with the given session.DesignParser(ArooaSession existingSession, DesignFactory factory) Create a DesignParser with the given session and factory.DesignParser(DesignFactory factory) Create a DesignParser for the standard session and given factory. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDesignListener(DesignListener listener) Add a listener.Is this the design of a Value or a Component?Getter for the currentDesignInstance.Getter for the expected document element.parse(ArooaConfiguration configuration) Parse anArooaConfiguration.voidremoveDesignListener(DesignListener listener) Remove a listener.voidsetArooaType(ArooaType type) Set if this is the design of a Value or a Component.voidsetExpectedDocumentElement(ArooaElement element) Setter for expected document element.
-
Constructor Details
-
DesignParser
public DesignParser()Default Constructor. Creates a DesignParser with aStandardArooaSession, and a default factory. -
DesignParser
Create a DesignParser with the given session.- Parameters:
existingSession- A session. If null the standard will be used.
-
DesignParser
Create a DesignParser for the standard session and given factory.- Parameters:
factory- The factory.
-
DesignParser
Create a DesignParser with the given session and factory.- Parameters:
existingSession- A Session. If null the standard will be used.factory- A factory. If null a default will be used.
-
-
Method Details
-
addDesignListener
Description copied from interface:DesignNotifierAdd a listener. Before this method returns the listener will have received the events required to match the state of the design.- Specified by:
addDesignListenerin interfaceDesignNotifier- Parameters:
listener- The listener.
-
removeDesignListener
Description copied from interface:DesignNotifierRemove a listener.- Specified by:
removeDesignListenerin interfaceDesignNotifier- Parameters:
listener- The listener.
-
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.
-
getDesign
Getter for the currentDesignInstance.- Returns:
-
getArooaType
Is this the design of a Value or a Component?- Returns:
-
setArooaType
Set if this is the design of a Value or a Component.- Parameters:
type- The type. Component or Value Design.
-
getExpectedDocumentElement
Getter for the expected document element.- Returns:
- The expected ArooaElement. Null if it can be anything.
-
setExpectedDocumentElement
Setter for expected document element.- Parameters:
element- The expected document element. Can be null if element can be anything.
-