org.oddjob.arooa.parsing.interceptors
Class OnePropertyInterceptor
java.lang.Object
org.oddjob.arooa.parsing.interceptors.OnePropertyInterceptor
- All Implemented Interfaces:
- ParsingInterceptor
public class OnePropertyInterceptor
- extends Object
- implements ParsingInterceptor
An interceptor that allows all child elements to contribute to the
configuraiton of a single property.
This is typically where a component only has one property which
is a value or component. The configuration is more readable because
the property name element can be ommitted. For instance:
<snack>
<fruit>
<apple/>
</fruit>
<snack>
becomes:
<snack>
<apple/>
<list>
This interceptor works by creating an invisible RuntimeConfiguration
equivalent to the omitted element.
- Author:
- rob
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OnePropertyInterceptor
public OnePropertyInterceptor()
OnePropertyInterceptor
public OnePropertyInterceptor(String property)
intercept
public ArooaContext intercept(ArooaContext suggestedContext)
throws ArooaConfigurationException
- Description copied from interface:
ParsingInterceptor
- Intercept current parsing.
- Specified by:
intercept
in interface ParsingInterceptor
- Parameters:
suggestedContext
- A suggested context which may be over ridden.
- Returns:
- The new context. Never null (The suggested context should be
returned).
- Throws:
ArooaConfigurationException
getProperty
public String getProperty()
setProperty
public void setProperty(String property)