org.jboss.shrinkwrap.api.asset
Class ClassAsset

java.lang.Object
  extended by org.jboss.shrinkwrap.api.asset.ClassAsset
All Implemented Interfaces:
Asset

public class ClassAsset
extends Object
implements Asset

ClassAsset Implementation of a Asset backed by a loaded Class

Author:
Aslak Knutsen

Constructor Summary
ClassAsset(Class<?> clazz)
          Load any class as a resource.
 
Method Summary
 InputStream openStream()
          Converts the Class name into a Resource URL and uses the ClassloaderResource for loading the Class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassAsset

public ClassAsset(Class<?> clazz)
Load any class as a resource.

Parameters:
clazz - The class to load
Throws:
IllegalArgumentException - Class can not be null
Method Detail

openStream

public InputStream openStream()
Converts the Class name into a Resource URL and uses the ClassloaderResource for loading the Class.

Specified by:
openStream in interface Asset
Returns:
A new open InputStream for each call, or null if this type simply represents a logical path within an Archive


Copyright © 2012 JBoss by Red Hat. All Rights Reserved.