anon.util
Interface IResourceInstantiator

All Known Implementing Classes:
CertificateRevocationList.CRLInstantiator, ClassUtil.ClassInstantiator, JAPCertificate.X509CertificateInstantiator, ResourceLoader.ByteArrayInstantiator, ResourceLoader.FileTypeInstantiator

public interface IResourceInstantiator

This interface is only needed in the context of the ResourceLoader. It loads resources and transforms them into concrete objects.

Author:
Rolf Wendolsky
See Also:
ResourceLoader

Nested Class Summary
static class IResourceInstantiator.ResourceInstantiationException
          An Exception that is thrown by a ResourceInstantiator if too much instantiations have failed.
 
Method Summary
 java.lang.Object getInstance(java.io.File a_file, java.io.File a_topDirectory)
          Loads a file and transforms it into a concrete object.
 java.lang.Object getInstance(java.io.InputStream a_inputStream, java.lang.String a_resourceName)
          Optional: may not be supported by all resource instantiators.
 java.lang.Object getInstance(java.util.zip.ZipEntry a_entry, java.util.zip.ZipFile a_file)
          Loads a file and transforms it into a concrete object.
 

Method Detail

getInstance

java.lang.Object getInstance(java.io.File a_file,
                             java.io.File a_topDirectory)
                             throws java.lang.Exception
Loads a file and transforms it into a concrete object.

Parameters:
a_file - a File
a_topDirectory - the top directory of this file; this is generally not needed to load the file
Returns:
an Object
Throws:
IResourceInstantiator.ResourceInstantiationException - if an error occurs
java.lang.Exception

getInstance

java.lang.Object getInstance(java.util.zip.ZipEntry a_entry,
                             java.util.zip.ZipFile a_file)
                             throws java.lang.Exception
Loads a file and transforms it into a concrete object. Please not that JDK 1.1.8 does not correctly load zip entries! Please use the method ResourceLoader.loadResource(String) instead. By this way, only zip/jar files in the classpath may be loaded.

Parameters:
a_entry - a ZipEntry
a_file - the ZipFile of this zip entry
Returns:
an Object
Throws:
IResourceInstantiator.ResourceInstantiationException - if an error occurs
java.lang.Exception

getInstance

java.lang.Object getInstance(java.io.InputStream a_inputStream,
                             java.lang.String a_resourceName)
                             throws java.lang.Exception
Optional: may not be supported by all resource instantiators. You may not rely that this methods returns results.

Parameters:
a_inputStream -
Returns:
Throws:
IResourceInstantiator.ResourceInstantiationException
java.lang.Exception