com.bbn.swede.core.libraries
Class LibraryEntryDescriptor

java.lang.Object
  extended bycom.bbn.swede.core.libraries.LibraryEntryDescriptor
All Implemented Interfaces:
ILibraryEntryDescriptor

public class LibraryEntryDescriptor
extends Object
implements ILibraryEntryDescriptor

The main interface for operations on the LibraryEntry. This class implements ILibraryEntryDescriptor.

Author:
aperezlo

Constructor Summary
(package private) LibraryEntryDescriptor(LibraryEntry entry)
          Creates a descriptor for a library entry.
 
Method Summary
 boolean close()
          Attempts to release all system resources associated with the ILibraryEntry.
 IConfiguration getConfiguration()
          Retrieves the IConfiguration of this library entry.
 ILibraryEntry getEntry()
          Retrieves the ILibraryEntry associated with this descriptor.
 InputStream getFileInputStream()
          Returns an InputStream to the file associated with this Entry.
 String getName()
          Retrieves the entry's name from this 'Descriptor's LibraryEntryConfiguration object.
 IOWLAbstractSyntaxTree getOAST()
          Retrieves the OWL abstract syntax tree associated with this entry.
 IConfigurationValidator getPropertiesValidator()
          Retrieves the properties validator from the entry's configuration.
 String getURI()
          Retrieves the entry's URI from this 'Descriptor's LibraryEntryConfiguration object.
 boolean hasOAST()
          Indicates whether the library entry represented by this object has an OWL abstract syntax tree associated with it.
 boolean hasURI()
          Indicates whether this descriptor has a URI.
(package private)  void write(ZipOutputStream out)
          Writes this 'Descriptor's LibraryEntry to a ZipOutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LibraryEntryDescriptor

LibraryEntryDescriptor(LibraryEntry entry)
Creates a descriptor for a library entry.

Parameters:
entry - The entry
Method Detail

getEntry

public ILibraryEntry getEntry()
Description copied from interface: ILibraryEntryDescriptor
Retrieves the ILibraryEntry associated with this descriptor.

Specified by:
getEntry in interface ILibraryEntryDescriptor
Returns:
the library entry

getPropertiesValidator

public IConfigurationValidator getPropertiesValidator()
Retrieves the properties validator from the entry's configuration.

Returns:
the properties validator
See Also:
IConfiguration.getPropertiesValidator()

getConfiguration

public IConfiguration getConfiguration()
Description copied from interface: ILibraryEntryDescriptor
Retrieves the IConfiguration of this library entry.

Specified by:
getConfiguration in interface ILibraryEntryDescriptor
Returns:
the configuration object associated with this entry descriptor

hasOAST

public boolean hasOAST()
Description copied from interface: ILibraryEntryDescriptor
Indicates whether the library entry represented by this object has an OWL abstract syntax tree associated with it.

Specified by:
hasOAST in interface ILibraryEntryDescriptor
Returns:
true if this object's ILibraryEntry has an OAST associated with it, false otherwise

getFileInputStream

public InputStream getFileInputStream()
Description copied from interface: ILibraryEntryDescriptor
Returns an InputStream to the file associated with this Entry.

Note: it can not be assumed that the input stream returned will be a FileInputStream, in spite of the name of this method

Specified by:
getFileInputStream in interface ILibraryEntryDescriptor
Returns:
a InputStream to the file associated with this Entry

close

public boolean close()
Description copied from interface: ILibraryEntryDescriptor
Attempts to release all system resources associated with the ILibraryEntry.

Specified by:
close in interface ILibraryEntryDescriptor
Returns:
true if the operation was successful, false otherwise

hasURI

public boolean hasURI()
Indicates whether this descriptor has a URI.

Returns:
true if this 'Descriptor has a URI, false otherwise

getName

public String getName()
Retrieves the entry's name from this 'Descriptor's LibraryEntryConfiguration object.

Returns:
The entry name
See Also:
IConfiguration.getName()

getURI

public String getURI()
Retrieves the entry's URI from this 'Descriptor's LibraryEntryConfiguration object.

Returns:
The entry URI
See Also:
LibraryEntryConfiguration.getURI()

getOAST

public IOWLAbstractSyntaxTree getOAST()
Description copied from interface: ILibraryEntryDescriptor
Retrieves the OWL abstract syntax tree associated with this entry.

Specified by:
getOAST in interface ILibraryEntryDescriptor
Returns:
the IOWLAbstractSyntaxTree associated with this Entry, or null if one does not exist

write

void write(ZipOutputStream out)
Writes this 'Descriptor's LibraryEntry to a ZipOutputStream.

This method creates two entries in the zip file (OAST support is currently not yet implemented), one for this 'Descriptor's LibraryEntry's file, and one for the associated metadata. For an explanation of how library files are structured, see Library.

This method does not close the ZipOutputStream.

Parameters:
out - the ZipOutputStream to which this 'Descriptor's 'Entry should be written


Copyright © 2004-2005 BBN Technologies. All Rights Reserved.