org.apache.bcel.verifier.statics
Class StringRepresentation
public
class
StringRepresentation
extends EmptyVisitor
implements Visitor
BCEL's Node classes (those from the classfile API that
accept() Visitor
instances) have
toString() methods that were not designed to be robust,
this gap is closed by this class.
When performing class file verification, it may be useful to output which
entity (e.g. a
Code instance) is not satisfying the verifier's
constraints, but in this case it could be possible for the
toString()
method to throw a RuntimeException.
A (new StringRepresentation(Node n)).toString() never throws any exception.
Note that this class also serves as a placeholder for more sophisticated message
handling in future versions of JustIce.
Version: $Id: StringRepresentation.java 386056 2006-03-15 11:31:56Z tcurdt $
Author: Enver Haase
Field Summary |
Node | n The node we ask for its string representation. |
String | tostring The string representation, created by a visitXXX() method, output by toString(). |
The node we ask for its string representation. Not really needed; only for debug output.
private String tostring
The string representation, created by a visitXXX() method, output by toString().
public StringRepresentation(
Node n)
Creates a new StringRepresentation object which is the representation of n.
See Also: toString
public String toString()
Returns the String representation.
private String toString(
Node obj)
Returns the String representation of the Node object obj;
this is obj.toString() if it does not throw any RuntimeException,
or else it is a string derived only from obj's class name.
public void visitCode(
Code obj)
public void visitField(
Field obj)
public void visitMethod(
Method obj)
public void visitUnknown(
Unknown obj)