public class DesignParser extends java.lang.Object implements ArooaParser<ArooaContext>, DesignNotifier
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.
Constructor and Description |
---|
DesignParser()
Default 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.
|
Modifier and Type | Method and Description |
---|---|
void |
addDesignListener(DesignListener listener)
Add a listener.
|
ArooaType |
getArooaType()
Is this the design of a Value or a Component?
|
DesignInstance |
getDesign()
Getter for the current
DesignInstance . |
ArooaElement |
getExpectedDocumentElement()
Getter for the expected document element.
|
ConfigurationHandle<ArooaContext> |
parse(ArooaConfiguration configuration)
Parse an
ArooaConfiguration . |
void |
removeDesignListener(DesignListener listener)
Remove a listener.
|
void |
setArooaType(ArooaType type)
Set if this is the design of a Value or a Component.
|
void |
setExpectedDocumentElement(ArooaElement element)
Setter for expected document element.
|
public DesignParser()
StandardArooaSession
, and a default factory.public DesignParser(ArooaSession existingSession)
existingSession
- A session. If null the standard
will be used.public DesignParser(DesignFactory factory)
factory
- The factory.public DesignParser(ArooaSession existingSession, DesignFactory factory)
existingSession
- A Session. If null the standard will be used.factory
- A factory. If null a default will be used.public void addDesignListener(DesignListener listener)
DesignNotifier
addDesignListener
in interface DesignNotifier
listener
- The listener.public void removeDesignListener(DesignListener listener)
DesignNotifier
removeDesignListener
in interface DesignNotifier
listener
- The listener.public ConfigurationHandle<ArooaContext> parse(ArooaConfiguration configuration) throws ArooaParseException
ArooaParser
ArooaConfiguration
.parse
in interface ArooaParser<ArooaContext>
configuration
- The configuration.ConfigurationHandle
.ArooaParseException
- If parsing fails.public DesignInstance getDesign()
DesignInstance
.public ArooaType getArooaType()
public void setArooaType(ArooaType type)
type
- The type. Component or Value Design.public ArooaElement getExpectedDocumentElement()
public void setExpectedDocumentElement(ArooaElement element)
element
- The expected document element. Can be
null if element can be anything.