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:
org.apache.hivemind.Locatable, org.apache.hivemind.LocationHolder, 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
Author:
Howard Lewis Ship

Field Summary
protected  Map _configuration
           
 
Constructor Summary
ExtensionSpecification(org.apache.hivemind.ClassResolver resolver, ValueConverter valueConverter)
          Creates a new instance which will use the specified resolver to resolve classes and converter to coerce values to their desired type.
 
Method Summary
 void addConfiguration(String propertyName, String value)
           
 String getClassName()
           
 Map getConfiguration()
          Returns an immutable Map of the configuration; keyed on property name, with values as properties to assign.
 Object instantiateExtension()
          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 LibrarySpecificationif 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.hivemind.LocationHolder
setLocation
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 

Field Detail

_configuration

protected Map _configuration
Constructor Detail

ExtensionSpecification

public ExtensionSpecification(org.apache.hivemind.ClassResolver resolver,
                              ValueConverter valueConverter)
Creates a new instance which will use the specified resolver to resolve classes and converter to coerce values to their desired type.

Parameters:
resolver - The class resolver used to resolve classes safely in a servlet environment.
valueConverter - Converter used to coerce values.
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,
                             String 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()
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 LibrarySpecificationif 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


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.