org.openide.cookies
Interface InstanceCookie

All Superinterfaces:
Node.Cookie
All Known Subinterfaces:
InstanceCookie.Of, InstanceCookie.Origin
All Known Implementing Classes:
FolderInstance

public interface InstanceCookie
extends Node.Cookie

Cookie that should be provided by all nodes that are able to create a "instance".

For example, Beans (class form, or serialized) may be instantiated in the usual fashion (say, for subsequent serialization); visual components may be instantiated into the Form Editor; folders of components may be "instantiated" into a Palette toolbar; and so on.


Inner Class Summary
static interface InstanceCookie.Of
          Enhanced cookie that can answer queries about the type of the instance it creates.
static interface InstanceCookie.Origin
          Enhanced instance cookie that also knows the file it was created from and can be serialized back to.
 
Method Summary
 Class instanceClass()
          The representation type that may be created as instances.
 Object instanceCreate()
          Create an instance.
 String instanceName()
          The name of instanceClass().
 

Method Detail

instanceName

public String instanceName()
The name of instanceClass().
Returns:
the instance class name

instanceClass

public Class instanceClass()
                    throws IOException,
                           ClassNotFoundException
The representation type that may be created as instances. Can be used to test whether the instance is of an appropriate class without actually creating it.
Returns:
the representation class of the instance
Throws:
IOException - if an I/O error occurred
ClassNotFoundException - if a class was not found

instanceCreate

public Object instanceCreate()
                      throws IOException,
                             ClassNotFoundException
Create an instance.
Returns:
the instance of type instanceClass() (or a subclass)
Throws:
IOException - if an I/O error occured
ClassNotFoundException - if a class was not found


Built on December 12 2001.  |  Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.