org.directwebremoting.create
Class StaticCreator

java.lang.Object
  extended by org.directwebremoting.extend.AbstractCreator
      extended by org.directwebremoting.create.StaticCreator
All Implemented Interfaces:
Creator

public class StaticCreator
extends AbstractCreator
implements Creator

A creator that attempts to grab an instance of a static/singleton class.

Author:
David Marginian [david at butterdev dot com]

Field Summary
 
Fields inherited from interface org.directwebremoting.extend.Creator
APPLICATION, PAGE, REQUEST, SCRIPT, SESSION
 
Constructor Summary
StaticCreator()
           
 
Method Summary
 java.lang.String getClassName()
          Gets the name of the class to create.
 java.lang.Object getInstance()
          Accessor for the/an instance of this Creator.
 java.lang.String getInstanceMethodName()
          Retrieves name of the method that will be called to retrieve the static instance of this class.
 java.lang.Class<?> getType()
          Accessor for the java.lang.Class that this Creator allows access to.
 void setClass(java.lang.String classname)
          What sort of class do we create?
 void setClassName(java.lang.String className)
          Sets the class name to create.
 void setInstanceMethodName(java.lang.String instanceMethodName)
          Sets the name of the method that will be called to retrieve the static instance of this class.
 
Methods inherited from class org.directwebremoting.extend.AbstractCreator
getJavascript, getScope, isCacheable, isHidden, setCacheable, setHidden, setJavascript, setProperties, setScope, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.directwebremoting.extend.Creator
getJavascript, getScope, isCacheable, isHidden, setProperties
 

Constructor Detail

StaticCreator

public StaticCreator()
Method Detail

setClass

public void setClass(java.lang.String classname)
What sort of class do we create?

Parameters:
classname - The name of the class

getType

public java.lang.Class<?> getType()
Description copied from interface: Creator
Accessor for the java.lang.Class that this Creator allows access to.

Specified by:
getType in interface Creator
Returns:
The type of this allowed class

getInstance

public java.lang.Object getInstance()
                             throws java.lang.InstantiationException
Description copied from interface: Creator
Accessor for the/an instance of this Creator.

Specified by:
getInstance in interface Creator
Returns:
the instance to use
Throws:
java.lang.InstantiationException - If for some reason the object can not be created

getInstanceMethodName

public java.lang.String getInstanceMethodName()
Retrieves name of the method that will be called to retrieve the static instance of this class.

Returns:
the getInstanceMethodName

setInstanceMethodName

public void setInstanceMethodName(java.lang.String instanceMethodName)
Sets the name of the method that will be called to retrieve the static instance of this class.

Parameters:
the - new getInstanceMethodName

setClassName

public void setClassName(java.lang.String className)
Sets the class name to create.

Parameters:
className - The name of the class to create

getClassName

public java.lang.String getClassName()
Gets the name of the class to create.

Returns:
The name of the class to create

Copyright 2008