java.module
Class ModuleDefinitionContent

java.lang.Object
  extended by java.module.ModuleDefinitionContent
Direct Known Subclasses:
ExpandedJamDefinitionContent, URLModuleDefinitionContent

public abstract class ModuleDefinitionContent
extends Object

This class represents the content of the module definition.

Since:
1.7.0
Author:
Stanley M. Ho
See Also:
ModuleDefinition

Constructor Summary
protected ModuleDefinitionContent()
          Constructor used by subclasses.
 
Method Summary
abstract  CodeSource getCodeSource()
          Returns the code source associated with the module definition.
 byte[] getEntryAsByteArray(String name)
          Returns an entry in the module definition as byte array.
abstract  InputStream getEntryAsStream(String name)
          Returns an entry in the module definition as an input stream.
abstract  List<String> getEntryNames()
          Returns the list of the names of the entries in the module definition.
abstract  File getNativeLibrary(String libraryName)
          Returns the path of the native library associated with the module definition.
abstract  boolean hasEntry(String name)
          Checks if an entry exists in the module definition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleDefinitionContent

protected ModuleDefinitionContent()
Constructor used by subclasses.

Method Detail

hasEntry

public abstract boolean hasEntry(String name)
Checks if an entry exists in the module definition.

The entry's name is specified as '/' separated paths, with no leading '/'.

Parameters:
name - entry's name.
Returns:
true if entry exists in the module definition; otherwise, false is returned.

getEntryAsStream

public abstract InputStream getEntryAsStream(String name)
                                      throws IOException
Returns an entry in the module definition as an input stream.

The entry's name is specified as '/' separated paths, with no leading '/'.

Parameters:
name - entry's name.
Returns:
if entry exists, return input stream; otherwise, return null.
Throws:
IOException - if an I/O error occurs.

getEntryAsByteArray

public byte[] getEntryAsByteArray(String name)
                           throws IOException
Returns an entry in the module definition as byte array.

The entry's name is specified as '/' separated paths, with no leading '/'.

Parameters:
name - entry's name.
Returns:
if entry exists, return byte array; otherwise, return null.
Throws:
IOException - if an I/O error occurs.

getEntryNames

public abstract List<String> getEntryNames()
Returns the list of the names of the entries in the module definition.

Each entry's name is in the form of '/' separated paths, with no leading '/'.

Returns:
the list of the names of the entries in the module definition.

getNativeLibrary

public abstract File getNativeLibrary(String libraryName)
Returns the path of the native library associated with the module definition.

Parameters:
libraryName - the library name.
Returns:
native library if found; otherwise, null is returned.

getCodeSource

public abstract CodeSource getCodeSource()
Returns the code source associated with the module definition.

Returns:
code source of the module definition.