org.jboss.classloading.spi.visitor
Interface ResourceContext

All Known Implementing Classes:
AbstractResourceContext, DefaultResourceContext, VFSResourceContext

public interface ResourceContext

ResourceContext.

Author:
Adrian Brock, Ales Justin

Method Summary
 byte[] getBytes()
          Get the bytes for the resource
 ClassLoader getClassLoader()
          Get the classLoader.
 String getClassName()
          Get the class name
 InputStream getInputStream()
          Get the input stream for the resource
 String getResourceName()
          Get the resourceName.
 URL getUrl()
          Get the url.
 boolean isClass()
          Whether the resource is a class
 Class<?> loadClass()
          Load a class Do isClass check before, unless you want to handle exception when resource is not actually a class.
 

Method Detail

getUrl

URL getUrl()
Get the url.

Returns:
the url.

getClassLoader

ClassLoader getClassLoader()
Get the classLoader.

Returns:
the classLoader.

getResourceName

String getResourceName()
Get the resourceName.

Returns:
the resourceName.

getClassName

String getClassName()
Get the class name

Returns:
the class name or null if it is not a class

isClass

boolean isClass()
Whether the resource is a class

Returns:
true when the resource name ends with .class

loadClass

Class<?> loadClass()
Load a class Do isClass check before, unless you want to handle exception when resource is not actually a class.

Returns:
the class from resource
Throws:
RuntimeException - for any errors during class loading

getInputStream

InputStream getInputStream()
                           throws IOException
Get the input stream for the resource

Returns:
the input stream
Throws:
IOException - for any error

getBytes

byte[] getBytes()
                throws IOException
Get the bytes for the resource

Returns:
the byte array
Throws:
IOException - for any error


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.