org.apache.tapestry.spec
Class ExtensionSpecification

java.lang.Object
  extended by org.apache.tapestry.util.BasePropertyHolder
      extended by org.apache.tapestry.spec.LocatablePropertyHolder
          extended by org.apache.tapestry.spec.ExtensionSpecification
All Implemented Interfaces:
ILocatable, ILocationHolder, IExtensionSpecification, IPropertyHolder

public class ExtensionSpecification
extends LocatablePropertyHolder
implements IExtensionSpecification

Defines an "extension", which is much like a helper bean, but is part of a library or application specification (and has the same lifecycle as the application).

Since:
2.2
Version:
$Id: ExtensionSpecification.java 243791 2004-02-19 17:38:13Z hlship $
Author:
Howard Lewis Ship

Field Summary
protected  Map _configuration
           
 
Constructor Summary
ExtensionSpecification()
           
 
Method Summary
 void addConfiguration(String propertyName, Object value)
           
 String getClassName()
           
 Map getConfiguration()
          Returns an immutable Map of the configuration; keyed on property name, with values as properties to assign.
 Object instantiateExtension(IResourceResolver resolver)
          Invoked to instantiate an instance of the extension and return it.
 boolean isImmediate()
          Returns true if the extensions should be instantiated immediately after the containing LibrarySpecification if parsed.
 void setClassName(String className)
           
 void setImmediate(boolean immediate)
           
 String toString()
           
 
Methods inherited from class org.apache.tapestry.spec.LocatablePropertyHolder
getLocation, setLocation
 
Methods inherited from class org.apache.tapestry.util.BasePropertyHolder
getProperty, getPropertyNames, removeProperty, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.tapestry.util.IPropertyHolder
getProperty, getPropertyNames, removeProperty, setProperty
 
Methods inherited from interface org.apache.tapestry.ILocationHolder
setLocation
 
Methods inherited from interface org.apache.tapestry.ILocatable
getLocation
 

Field Detail

_configuration

protected Map _configuration
Constructor Detail

ExtensionSpecification

public ExtensionSpecification()
Method Detail

getClassName

public String getClassName()
Specified by:
getClassName in interface IExtensionSpecification

setClassName

public void setClassName(String className)
Specified by:
setClassName in interface IExtensionSpecification

addConfiguration

public void addConfiguration(String propertyName,
                             Object value)
Specified by:
addConfiguration in interface IExtensionSpecification

getConfiguration

public Map getConfiguration()
Returns an immutable Map of the configuration; keyed on property name, with values as properties to assign.

Specified by:
getConfiguration in interface IExtensionSpecification

instantiateExtension

public Object instantiateExtension(IResourceResolver resolver)
Invoked to instantiate an instance of the extension and return it. It also configures properties of the extension.

Specified by:
instantiateExtension in interface IExtensionSpecification

toString

public String toString()
Overrides:
toString in class Object

isImmediate

public boolean isImmediate()
Returns true if the extensions should be instantiated immediately after the containing LibrarySpecification if parsed. Non-immediate extensions are instantiated only as needed.

Specified by:
isImmediate in interface IExtensionSpecification

setImmediate

public void setImmediate(boolean immediate)
Specified by:
setImmediate in interface IExtensionSpecification