Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.bcel.verifier.statics
Class StringRepresentation  view StringRepresentation download StringRepresentation.java

java.lang.Object
  extended byorg.apache.bcel.classfile.EmptyVisitor
      extended byorg.apache.bcel.verifier.statics.StringRepresentation
All Implemented Interfaces:
org.apache.bcel.classfile.Visitor

public class StringRepresentation
extends org.apache.bcel.classfile.EmptyVisitor
implements org.apache.bcel.classfile.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 $

Field Summary
private  org.apache.bcel.classfile.Node n
          The node we ask for its string representation.
private  java.lang.String tostring
          The string representation, created by a visitXXX() method, output by toString().
 
Constructor Summary
StringRepresentation(org.apache.bcel.classfile.Node n)
          Creates a new StringRepresentation object which is the representation of n.
 
Method Summary
 java.lang.String toString()
          Returns the String representation.
private  java.lang.String toString(org.apache.bcel.classfile.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.
 void visitCode(org.apache.bcel.classfile.Code obj)
           
 void visitCodeException(org.apache.bcel.classfile.CodeException obj)
           
 void visitConstantClass(org.apache.bcel.classfile.ConstantClass obj)
           
 void visitConstantDouble(org.apache.bcel.classfile.ConstantDouble obj)
           
 void visitConstantFieldref(org.apache.bcel.classfile.ConstantFieldref obj)
           
 void visitConstantFloat(org.apache.bcel.classfile.ConstantFloat obj)
           
 void visitConstantInteger(org.apache.bcel.classfile.ConstantInteger obj)
           
 void visitConstantInterfaceMethodref(org.apache.bcel.classfile.ConstantInterfaceMethodref obj)
           
 void visitConstantLong(org.apache.bcel.classfile.ConstantLong obj)
           
 void visitConstantMethodref(org.apache.bcel.classfile.ConstantMethodref obj)
           
 void visitConstantNameAndType(org.apache.bcel.classfile.ConstantNameAndType obj)
           
 void visitConstantPool(org.apache.bcel.classfile.ConstantPool obj)
           
 void visitConstantString(org.apache.bcel.classfile.ConstantString obj)
           
 void visitConstantUtf8(org.apache.bcel.classfile.ConstantUtf8 obj)
           
 void visitConstantValue(org.apache.bcel.classfile.ConstantValue obj)
           
 void visitDeprecated(org.apache.bcel.classfile.Deprecated obj)
           
 void visitExceptionTable(org.apache.bcel.classfile.ExceptionTable obj)
           
 void visitField(org.apache.bcel.classfile.Field obj)
           
 void visitInnerClass(org.apache.bcel.classfile.InnerClass obj)
           
 void visitInnerClasses(org.apache.bcel.classfile.InnerClasses obj)
           
 void visitJavaClass(org.apache.bcel.classfile.JavaClass obj)
           
 void visitLineNumber(org.apache.bcel.classfile.LineNumber obj)
           
 void visitLineNumberTable(org.apache.bcel.classfile.LineNumberTable obj)
           
 void visitLocalVariable(org.apache.bcel.classfile.LocalVariable obj)
           
 void visitLocalVariableTable(org.apache.bcel.classfile.LocalVariableTable obj)
           
 void visitMethod(org.apache.bcel.classfile.Method obj)
           
 void visitSignature(org.apache.bcel.classfile.Signature obj)
           
 void visitSourceFile(org.apache.bcel.classfile.SourceFile obj)
           
 void visitStackMap(org.apache.bcel.classfile.StackMap obj)
           
 void visitSynthetic(org.apache.bcel.classfile.Synthetic obj)
           
 void visitUnknown(org.apache.bcel.classfile.Unknown obj)
           
 
Methods inherited from class org.apache.bcel.classfile.EmptyVisitor
visitStackMapEntry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.bcel.classfile.Visitor
visitStackMapEntry
 

Field Detail

tostring

private java.lang.String tostring
The string representation, created by a visitXXX() method, output by toString().


n

private org.apache.bcel.classfile.Node n
The node we ask for its string representation. Not really needed; only for debug output.

Constructor Detail

StringRepresentation

public StringRepresentation(org.apache.bcel.classfile.Node n)
Creates a new StringRepresentation object which is the representation of n.

Method Detail

toString

public java.lang.String toString()
Returns the String representation.


toString

private java.lang.String toString(org.apache.bcel.classfile.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.


visitCode

public void visitCode(org.apache.bcel.classfile.Code obj)
Specified by:
visitCode in interface org.apache.bcel.classfile.Visitor

visitCodeException

public void visitCodeException(org.apache.bcel.classfile.CodeException obj)
Specified by:
visitCodeException in interface org.apache.bcel.classfile.Visitor

visitConstantClass

public void visitConstantClass(org.apache.bcel.classfile.ConstantClass obj)
Specified by:
visitConstantClass in interface org.apache.bcel.classfile.Visitor

visitConstantDouble

public void visitConstantDouble(org.apache.bcel.classfile.ConstantDouble obj)
Specified by:
visitConstantDouble in interface org.apache.bcel.classfile.Visitor

visitConstantFieldref

public void visitConstantFieldref(org.apache.bcel.classfile.ConstantFieldref obj)
Specified by:
visitConstantFieldref in interface org.apache.bcel.classfile.Visitor

visitConstantFloat

public void visitConstantFloat(org.apache.bcel.classfile.ConstantFloat obj)
Specified by:
visitConstantFloat in interface org.apache.bcel.classfile.Visitor

visitConstantInteger

public void visitConstantInteger(org.apache.bcel.classfile.ConstantInteger obj)
Specified by:
visitConstantInteger in interface org.apache.bcel.classfile.Visitor

visitConstantInterfaceMethodref

public void visitConstantInterfaceMethodref(org.apache.bcel.classfile.ConstantInterfaceMethodref obj)
Specified by:
visitConstantInterfaceMethodref in interface org.apache.bcel.classfile.Visitor

visitConstantLong

public void visitConstantLong(org.apache.bcel.classfile.ConstantLong obj)
Specified by:
visitConstantLong in interface org.apache.bcel.classfile.Visitor

visitConstantMethodref

public void visitConstantMethodref(org.apache.bcel.classfile.ConstantMethodref obj)
Specified by:
visitConstantMethodref in interface org.apache.bcel.classfile.Visitor

visitConstantNameAndType

public void visitConstantNameAndType(org.apache.bcel.classfile.ConstantNameAndType obj)
Specified by:
visitConstantNameAndType in interface org.apache.bcel.classfile.Visitor

visitConstantPool

public void visitConstantPool(org.apache.bcel.classfile.ConstantPool obj)
Specified by:
visitConstantPool in interface org.apache.bcel.classfile.Visitor

visitConstantString

public void visitConstantString(org.apache.bcel.classfile.ConstantString obj)
Specified by:
visitConstantString in interface org.apache.bcel.classfile.Visitor

visitConstantUtf8

public void visitConstantUtf8(org.apache.bcel.classfile.ConstantUtf8 obj)
Specified by:
visitConstantUtf8 in interface org.apache.bcel.classfile.Visitor

visitConstantValue

public void visitConstantValue(org.apache.bcel.classfile.ConstantValue obj)
Specified by:
visitConstantValue in interface org.apache.bcel.classfile.Visitor

visitDeprecated

public void visitDeprecated(org.apache.bcel.classfile.Deprecated obj)
Specified by:
visitDeprecated in interface org.apache.bcel.classfile.Visitor

visitExceptionTable

public void visitExceptionTable(org.apache.bcel.classfile.ExceptionTable obj)
Specified by:
visitExceptionTable in interface org.apache.bcel.classfile.Visitor

visitField

public void visitField(org.apache.bcel.classfile.Field obj)
Specified by:
visitField in interface org.apache.bcel.classfile.Visitor

visitInnerClass

public void visitInnerClass(org.apache.bcel.classfile.InnerClass obj)
Specified by:
visitInnerClass in interface org.apache.bcel.classfile.Visitor

visitInnerClasses

public void visitInnerClasses(org.apache.bcel.classfile.InnerClasses obj)
Specified by:
visitInnerClasses in interface org.apache.bcel.classfile.Visitor

visitJavaClass

public void visitJavaClass(org.apache.bcel.classfile.JavaClass obj)
Specified by:
visitJavaClass in interface org.apache.bcel.classfile.Visitor

visitLineNumber

public void visitLineNumber(org.apache.bcel.classfile.LineNumber obj)
Specified by:
visitLineNumber in interface org.apache.bcel.classfile.Visitor

visitLineNumberTable

public void visitLineNumberTable(org.apache.bcel.classfile.LineNumberTable obj)
Specified by:
visitLineNumberTable in interface org.apache.bcel.classfile.Visitor

visitLocalVariable

public void visitLocalVariable(org.apache.bcel.classfile.LocalVariable obj)
Specified by:
visitLocalVariable in interface org.apache.bcel.classfile.Visitor

visitLocalVariableTable

public void visitLocalVariableTable(org.apache.bcel.classfile.LocalVariableTable obj)
Specified by:
visitLocalVariableTable in interface org.apache.bcel.classfile.Visitor

visitMethod

public void visitMethod(org.apache.bcel.classfile.Method obj)
Specified by:
visitMethod in interface org.apache.bcel.classfile.Visitor

visitSignature

public void visitSignature(org.apache.bcel.classfile.Signature obj)
Specified by:
visitSignature in interface org.apache.bcel.classfile.Visitor

visitSourceFile

public void visitSourceFile(org.apache.bcel.classfile.SourceFile obj)
Specified by:
visitSourceFile in interface org.apache.bcel.classfile.Visitor

visitStackMap

public void visitStackMap(org.apache.bcel.classfile.StackMap obj)
Specified by:
visitStackMap in interface org.apache.bcel.classfile.Visitor

visitSynthetic

public void visitSynthetic(org.apache.bcel.classfile.Synthetic obj)
Specified by:
visitSynthetic in interface org.apache.bcel.classfile.Visitor

visitUnknown

public void visitUnknown(org.apache.bcel.classfile.Unknown obj)
Specified by:
visitUnknown in interface org.apache.bcel.classfile.Visitor