com.uwyn.rife.site.instrument
Class ConstrainedDetector

java.lang.Object
  extended by com.uwyn.rife.site.instrument.ConstrainedDetector

public class ConstrainedDetector
extends Object

Detects whether class implements the Constrainted interface or not, by analyzing its bytecode.

Since:
1.6
Version:
$Revision: 3811 $
Author:
Geert Bevin (gbevin[remove] at uwyn dot com)

Constructor Summary
ConstrainedDetector(ClassBytesLoader bytesLoader)
          Creates new instance by providing a loader that is able to retrieve the bytes of any parent classes that are extended by the class that is being analyzed.
 
Method Summary
 boolean isConstrained(String internedClassname, byte[] bytes)
          Verifies if the Constrained interface is implemented by the class that is defined by the bytes that are provided.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstrainedDetector

public ConstrainedDetector(ClassBytesLoader bytesLoader)
Creates new instance by providing a loader that is able to retrieve the bytes of any parent classes that are extended by the class that is being analyzed.

Parameters:
bytesLoader - the loader that will be used to retrieve the bytes of the additional classes
Since:
1.6
Method Detail

isConstrained

public boolean isConstrained(String internedClassname,
                             byte[] bytes)
                      throws ClassBytesNotFoundException
Verifies if the Constrained interface is implemented by the class that is defined by the bytes that are provided.

Parameters:
internedClassname - the class name as the previously interned string
bytes - the array of bytes that defines the class that needs to be analyzed
Returns:
true if the analyzed class implements the constrained interface; or

false otherwise

Throws:
ClassBytesNotFoundException - when the bytes of a parent class can be found
Since:
1.6


Copyright © 2001-2007 Uwyn sprl/bvba. All Rights Reserved.