org.netbeans.core.startup/1 1.40

org.netbeans.core.startup
Class ManifestSection<T>

java.lang.Object
  extended by org.netbeans.core.startup.ManifestSection<T>
Direct Known Subclasses:
ManifestSection.ActionSection, ManifestSection.ClipboardConvertorSection, ManifestSection.DebuggerSection, ManifestSection.LoaderSection

public abstract class ManifestSection<T>
extends Object

Class representing one specially-treated section in a module's manifest file. For example, one section may describe a single action provided by the module.


Nested Class Summary
static class ManifestSection.ActionSection
          Module section for an Action.
static class ManifestSection.ClipboardConvertorSection
          Deprecated. use META-INF/services to register convertors.
static class ManifestSection.DebuggerSection
          Deprecated. use new debugger API
static class ManifestSection.LoaderSection
          Module section for a Data Loader.
 
Constructor Summary
protected ManifestSection(String name, Module module, Object superclazz)
          Create a manifest section generally.
 
Method Summary
static ManifestSection create(String name, Attributes attr, Module module)
          Parse a manifest section and make an object representation of it.
protected  Object createInstance()
          Create a fresh instance.
 void dispose()
          Dispose of a section.
protected  ClassLoader getClassLoader()
          Get the classloader used to load this section.
 Object getInstance()
          Get a single cached instance.
 Module getModule()
          Get the associated module.
 Class<?> getSectionClass()
          Get the class which the generated instances will have.
 String getSectionClassName()
          Same as getSectionClass(), but only provides the name of the class.
 Class<?> getSuperclass()
          Get the superclass which all instances of this section are expected to be assignable to.
 boolean isDefaultInstance()
          Does this section represent a default instance? Normally true, but false when deserializing beans.
 String toString()
          String representation for debugging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ManifestSection

protected ManifestSection(String name,
                          Module module,
                          Object superclazz)
                   throws InvalidException
Create a manifest section generally.

Parameters:
name - name of section, should be a class file, e.g. foo/Bar.class
module - associated module
superclazz - super-class of instances of this section
Throws:
InvalidException - if the name is not valid for an OpenIDE section (exception must include module for reference)
Method Detail

getModule

public final Module getModule()
Get the associated module.


getClassLoader

protected final ClassLoader getClassLoader()
Get the classloader used to load this section.


isDefaultInstance

public final boolean isDefaultInstance()
Does this section represent a default instance? Normally true, but false when deserializing beans.


getSectionClass

public final Class<?> getSectionClass()
                               throws Exception
Get the class which the generated instances will have.

Returns:
the class
Throws:
Exception - for various reasons

getSectionClassName

public String getSectionClassName()
                           throws Exception
Same as getSectionClass(), but only provides the name of the class. Could be more efficient because it will not try to load the class unless a serialized bean is in use.

Throws:
Exception

createInstance

protected final Object createInstance()
                               throws Exception
Create a fresh instance.

Returns:
the instance
Throws:
Exception - if there is an error

getInstance

public final Object getInstance()
                         throws Exception
Get a single cached instance.

Returns:
the instance
Throws:
Exception - if there is an error

getSuperclass

public final Class<?> getSuperclass()
Get the superclass which all instances of this section are expected to be assignable to.


dispose

public void dispose()
Dispose of a section. Used when a module will be uninstalled and all its resources should be released.


toString

public String toString()
String representation for debugging.

Overrides:
toString in class Object

create

public static ManifestSection create(String name,
                                     Attributes attr,
                                     Module module)
                              throws InvalidException
Parse a manifest section and make an object representation of it.

Parameters:
name - name of the section (i.e. file to load)
attr - attributes of the manifest section
module - the associated module
Returns:
the section or null if this manifest section is not related to module installation
Throws:
InvalidException - if the attributes are not valid

org.netbeans.core.startup/1 1.40

Built on May 22 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.