|
Préférences
Moteurs de recherche
|
||||||||||||||
JavaTM 2 Platform Std. Ed. v1.6.0
javax.activation
|
Constructor Summary | |
---|---|
CommandInfo(String verb,
String className)
The Constructor for CommandInfo. |
Method Summary | |
---|---|
String |
getCommandClass()
Return the command's class name. |
String |
getCommandName()
Return the command verb. |
Object |
getCommandObject(DataHandler dh,
ClassLoader loader)
Return the instantiated JavaBean component. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommandInfo(String verb, String className)
verb
- The command verb this CommandInfo decribes.className
- The command's fully qualified class name.Method Detail |
---|
public String getCommandName()
public String getCommandClass()
public Object getCommandObject(DataHandler dh, ClassLoader loader) throws IOException, ClassNotFoundException
Begin by instantiating the component with
Beans.instantiate()
.
If the bean implements the javax.activation.CommandObject
interface, call its setCommandContext
method.
If the DataHandler parameter is null, then the bean is instantiated with no data. NOTE: this may be useful if for some reason the DataHandler that is passed in throws IOExceptions when this method attempts to access its InputStream. It will allow the caller to retrieve a reference to the bean if it can be instantiated.
If the bean does NOT implement the CommandObject interface, this method will check if it implements the java.io.Externalizable interface. If it does, the bean's readExternal method will be called if an InputStream can be acquired from the DataHandler.
dh
- The DataHandler that describes the data to be
passed to the command.loader
- The ClassLoader to be used to instantiate the bean.
IOException
ClassNotFoundException
Beans.instantiate(java.lang.ClassLoader, java.lang.String)
,
CommandObject