# Class StringRepresentation

java.lang.Object
org.apache.bcel.classfile.EmptyVisitor
org.apache.bcel.verifier.statics.StringRepresentation

All Implemented Interfaces:
  `Visitor`

public class StringRepresentation extends EmptyVisitor
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 (for example 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.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `StringRepresentation(Node n)`
  Creates a new StringRepresentation object which is the representation of n.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `toString()`
  Returns the String representation.
  `void`
  `visitAnnotation(Annotations obj)`
  Visits an Annotations attribute.
  `void`
  `visitAnnotationDefault(AnnotationDefault obj)`
  Visits an AnnotationDefault attribute.
  `void`
  `visitAnnotationEntry(AnnotationEntry obj)`
  Visits an AnnotationEntry.
  `void`
  `visitBootstrapMethods(BootstrapMethods obj)`
  Visits a BootstrapMethods attribute.
  `void`
  `visitCode(Code obj)`
  /////////////////////////////
  `void`
  `visitCodeException(CodeException obj)`
  Visits a CodeException.
  `void`
  `visitConstantClass(ConstantClass obj)`
  Visits a ConstantClass.
  `void`
  `visitConstantDouble(ConstantDouble obj)`
  Visits a ConstantDouble.
  `void`
  `visitConstantDynamic(ConstantDynamic obj)`
  Visits a ConstantDynamic.
  `void`
  `visitConstantFieldref(ConstantFieldref obj)`
  Visits a ConstantFieldref.
  `void`
  `visitConstantFloat(ConstantFloat obj)`
  Visits a ConstantFloat.
  `void`
  `visitConstantInteger(ConstantInteger obj)`
  Visits a ConstantInteger.
  `void`
  `visitConstantInterfaceMethodref(ConstantInterfaceMethodref obj)`
  Visits a ConstantInterfaceMethodref.
  `void`
  `visitConstantInvokeDynamic(ConstantInvokeDynamic obj)`
  Visits a ConstantInvokeDynamic.
  `void`
  `visitConstantLong(ConstantLong obj)`
  Visits a ConstantLong.
  `void`
  `visitConstantMethodHandle(ConstantMethodHandle obj)`
  Visits a ConstantMethodHandle.
  `void`
  `visitConstantMethodref(ConstantMethodref obj)`
  Visits a ConstantMethodref.
  `void`
  `visitConstantMethodType(ConstantMethodType obj)`
  Visits a ConstantMethodType.
  `void`
  `visitConstantModule(ConstantModule obj)`
  Visits a ConstantModule.
  `void`
  `visitConstantNameAndType(ConstantNameAndType obj)`
  Visits a ConstantNameAndType.
  `void`
  `visitConstantPackage(ConstantPackage obj)`
  Visits a ConstantPackage.
  `void`
  `visitConstantPool(ConstantPool obj)`
  Visits a ConstantPool.
  `void`
  `visitConstantString(ConstantString obj)`
  Visits a ConstantString.
  `void`
  `visitConstantUtf8(ConstantUtf8 obj)`
  Visits a ConstantUtf8.
  `void`
  `visitConstantValue(ConstantValue obj)`
  Visits a ConstantValue attribute.
  `void`
  `visitDeprecated(Deprecated obj)`
  Visits a Deprecated attribute.
  `void`
  `visitEnclosingMethod(EnclosingMethod obj)`
  Visits an EnclosingMethod attribute.
  `void`
  `visitExceptionTable(ExceptionTable obj)`
  Visits an ExceptionTable attribute.
  `void`
  `visitField(Field obj)`
  Visits a Field.
  `void`
  `visitInnerClass(InnerClass obj)`
  Visits an InnerClass.
  `void`
  `visitInnerClasses(InnerClasses obj)`
  Visits an InnerClasses attribute.
  `void`
  `visitJavaClass(JavaClass obj)`
  Visits a JavaClass.
  `void`
  `visitLineNumber(LineNumber obj)`
  Visits a LineNumber.
  `void`
  `visitLineNumberTable(LineNumberTable obj)`
  Visits a LineNumberTable attribute.
  `void`
  `visitLocalVariable(LocalVariable obj)`
  Visits a LocalVariable.
  `void`
  `visitLocalVariableTable(LocalVariableTable obj)`
  Visits a LocalVariableTable attribute.
  `void`
  `visitLocalVariableTypeTable(LocalVariableTypeTable obj)`
  Visits a LocalVariableTypeTable attribute.
  `void`
  `visitMethod(Method obj)`
  Visits a Method.
  `void`
  `visitMethodParameters(MethodParameters obj)`
  Visits a MethodParameters attribute.
  `void`
  `visitNestMembers(NestMembers obj)`
  Visits a NestMembers attribute.
  `void`
  `visitParameterAnnotation(ParameterAnnotations obj)`
  Visits a ParameterAnnotations attribute.
  `void`
  `visitParameterAnnotationEntry(ParameterAnnotationEntry obj)`
  Visits a ParameterAnnotationEntry.
  `void`
  `visitRecord(Record obj)`
  Visits a `Record` object.
  `void`
  `visitRecordComponent(RecordComponentInfo obj)`
  Visits a `RecordComponentInfo` object.
  `void`
  `visitSignature(Signature obj)`
  Visits a Signature attribute.
  `void`
  `visitSourceFile(SourceFile obj)`
  Visits a SourceFile attribute.
  `void`
  `visitStackMap(StackMap obj)`
  Visits a StackMap attribute.
  `void`
  `visitStackMapEntry(StackMapEntry obj)`
  Visits a StackMapEntry.
  `void`
  `visitSynthetic(Synthetic obj)`
  Visits a Synthetic attribute.
  `void`
  `visitUnknown(Unknown obj)`
  Visits an Unknown attribute.

  ### Methods inherited from class EmptyVisitor

  `visitMethodParameter, visitModule, visitModuleExports, visitModuleMainClass, visitModuleOpens, visitModulePackages, visitModuleProvides, visitModuleRequires, visitNestHost, visitStackMapType`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### StringRepresentation

    public StringRepresentation(Node n)
    Creates a new StringRepresentation object which is the representation of n.
    Parameters:
      `n` - The node to represent.
    See Also:
      - `toString()`

- ## Method Details

  - ### toString

    public String toString()
    Returns the String representation.
    Overrides:
      `toString` in class `Object`

  - ### visitAnnotation

    public void visitAnnotation(Annotations obj)
    Description copied from interface: `Visitor`
    Visits an Annotations attribute.
    Specified by:
      `visitAnnotation` in interface `Visitor`
    Overrides:
      `visitAnnotation` in class `EmptyVisitor`
    Parameters:
      `obj` - the attribute.
    Since:
      6.0

  - ### visitAnnotationDefault

    public void visitAnnotationDefault(AnnotationDefault obj)
    Description copied from interface: `Visitor`
    Visits an AnnotationDefault attribute.
    Specified by:
      `visitAnnotationDefault` in interface `Visitor`
    Overrides:
      `visitAnnotationDefault` in class `EmptyVisitor`
    Parameters:
      `obj` - the attribute.
    Since:
      6.0

  - ### visitAnnotationEntry

    public void visitAnnotationEntry(AnnotationEntry obj)
    Description copied from interface: `Visitor`
    Visits an AnnotationEntry.
    Specified by:
      `visitAnnotationEntry` in interface `Visitor`
    Overrides:
      `visitAnnotationEntry` in class `EmptyVisitor`
    Parameters:
      `obj` - the annotation entry.
    Since:
      6.0

  - ### visitBootstrapMethods

    public void visitBootstrapMethods(BootstrapMethods obj)
    Description copied from interface: `Visitor`
    Visits a BootstrapMethods attribute.
    Specified by:
      `visitBootstrapMethods` in interface `Visitor`
    Overrides:
      `visitBootstrapMethods` in class `EmptyVisitor`
    Parameters:
      `obj` - the attribute.
    Since:
      6.0

  - ### visitCode

    public void visitCode(Code obj)
    /////////////////////////////
    Specified by:
      `visitCode` in interface `Visitor`
    Overrides:
      `visitCode` in class `EmptyVisitor`
    Parameters:
      `obj` - the attribute.

  - ### visitCodeException

    public void visitCodeException(CodeException obj)
    Description copied from interface: `Visitor`
    Visits a CodeException.
    Specified by:
      `visitCodeException` in interface `Visitor`
    Overrides:
      `visitCodeException` in class `EmptyVisitor`
    Parameters:
      `obj` - the exception.

  - ### visitConstantClass

    public void visitConstantClass(ConstantClass obj)
    Description copied from interface: `Visitor`
    Visits a ConstantClass.
    Specified by:
      `visitConstantClass` in interface `Visitor`
    Overrides:
      `visitConstantClass` in class `EmptyVisitor`
    Parameters:
      `obj` - the constant.

  - ### visitConstantDouble

    public void visitConstantDouble(ConstantDouble obj)
    Description copied from interface: `Visitor`
    Visits a ConstantDouble.
    Specified by:
      `visitConstantDouble` in interface `Visitor`
    Overrides:
      `visitConstantDouble` in class `EmptyVisitor`
    Parameters:
      `obj` - the constant.

  - ### visitConstantDynamic

    public void visitConstantDynamic(ConstantDynamic obj)
    Description copied from interface: `Visitor`
    Visits a ConstantDynamic.
    Specified by:
      `visitConstantDynamic` in interface `Visitor`
    Overrides:
      `visitConstantDynamic` in class `EmptyVisitor`
    Parameters:
      `obj` - the constant.
    Since:
      6.6.0

  - ### visitConstantFieldref

    public void visitConstantFieldref(ConstantFieldref obj)
    Description copied from interface: `Visitor`
    Visits a ConstantFieldref.
    Specified by:
      `visitConstantFieldref` in interface `Visitor`
    Overrides:
      `visitConstantFieldref` in class `EmptyVisitor`
    Parameters:
      `obj` - the constant.

  - ### visitConstantFloat

    public void visitConstantFloat(ConstantFloat obj)
    Description copied from interface: `Visitor`
    Visits a ConstantFloat.
    Specified by:
      `visitConstantFloat` in interface `Visitor`
    Overrides:
      `visitConstantFloat` in class `EmptyVisitor`
    Parameters:
      `obj` - the constant.

  - ### visitConstantInteger

    public void visitConstantInteger(ConstantInteger obj)
    Description copied from interface: `Visitor`
    Visits a ConstantInteger.
    Specified by:
      `visitConstantInteger` in interface `Visitor`
    Overrides:
      `visitConstantInteger` in class `EmptyVisitor`
    Parameters:
      `obj` - the constant.

  - ### visitConstantInterfaceMethodref

    public void visitConstantInterfaceMethodref(ConstantInterfaceMethodref obj)
    Description copied from interface: `Visitor`
    Visits a ConstantInterfaceMethodref.
    Specified by:
      `visitConstantInterfaceMethodref` in interface `Visitor`
    Overrides:
      `visitConstantInterfaceMethodref` in class `EmptyVisitor`
    Parameters:
      `obj` - the constant.

  - ### visitConstantInvokeDynamic

    public void visitConstantInvokeDynamic(ConstantInvokeDynamic obj)
    Description copied from interface: `Visitor`
    Visits a ConstantInvokeDynamic.
    Specified by:
      `visitConstantInvokeDynamic` in interface `Visitor`
    Overrides:
      `visitConstantInvokeDynamic` in class `EmptyVisitor`
    Parameters:
      `obj` - the constant.
    Since:
      6.0

  - ### visitConstantLong

    public void visitConstantLong(ConstantLong obj)
    Description copied from interface: `Visitor`
    Visits a ConstantLong.
    Specified by:
      `visitConstantLong` in interface `Visitor`
    Overrides:
      `visitConstantLong` in class `EmptyVisitor`
    Parameters:
      `obj` - the constant.

  - ### visitConstantMethodHandle

    public void visitConstantMethodHandle(ConstantMethodHandle obj)
    Description copied from interface: `Visitor`
    Visits a ConstantMethodHandle.
    Specified by:
      `visitConstantMethodHandle` in interface `Visitor`
    Overrides:
      `visitConstantMethodHandle` in class `EmptyVisitor`
    Parameters:
      `obj` - the constant.
    Since:
      6.0

  - ### visitConstantMethodref

    public void visitConstantMethodref(ConstantMethodref obj)
    Description copied from interface: `Visitor`
    Visits a ConstantMethodref.
    Specified by:
      `visitConstantMethodref` in interface `Visitor`
    Overrides:
      `visitConstantMethodref` in class `EmptyVisitor`
    Parameters:
      `obj` - the constant.

  - ### visitConstantMethodType

    public void visitConstantMethodType(ConstantMethodType obj)
    Description copied from interface: `Visitor`
    Visits a ConstantMethodType.
    Specified by:
      `visitConstantMethodType` in interface `Visitor`
    Overrides:
      `visitConstantMethodType` in class `EmptyVisitor`
    Parameters:
      `obj` - the constant.
    Since:
      6.0

  - ### visitConstantModule

    public void visitConstantModule(ConstantModule obj)
    Description copied from interface: `Visitor`
    Visits a ConstantModule.
    Specified by:
      `visitConstantModule` in interface `Visitor`
    Overrides:
      `visitConstantModule` in class `EmptyVisitor`
    Parameters:
      `obj` - the constant.
    Since:
      6.6.0

  - ### visitConstantNameAndType

    public void visitConstantNameAndType(ConstantNameAndType obj)
    Description copied from interface: `Visitor`
    Visits a ConstantNameAndType.
    Specified by:
      `visitConstantNameAndType` in interface `Visitor`
    Overrides:
      `visitConstantNameAndType` in class `EmptyVisitor`
    Parameters:
      `obj` - the constant.

  - ### visitConstantPackage

    public void visitConstantPackage(ConstantPackage obj)
    Description copied from interface: `Visitor`
    Visits a ConstantPackage.
    Specified by:
      `visitConstantPackage` in interface `Visitor`
    Overrides:
      `visitConstantPackage` in class `EmptyVisitor`
    Parameters:
      `obj` - the constant.
    Since:
      6.6.0

  - ### visitConstantPool

    public void visitConstantPool(ConstantPool obj)
    Description copied from interface: `Visitor`
    Visits a ConstantPool.
    Specified by:
      `visitConstantPool` in interface `Visitor`
    Overrides:
      `visitConstantPool` in class `EmptyVisitor`
    Parameters:
      `obj` - the constant pool.

  - ### visitConstantString

    public void visitConstantString(ConstantString obj)
    Description copied from interface: `Visitor`
    Visits a ConstantString.
    Specified by:
      `visitConstantString` in interface `Visitor`
    Overrides:
      `visitConstantString` in class `EmptyVisitor`
    Parameters:
      `obj` - the constant.

  - ### visitConstantUtf8

    public void visitConstantUtf8(ConstantUtf8 obj)
    Description copied from interface: `Visitor`
    Visits a ConstantUtf8.
    Specified by:
      `visitConstantUtf8` in interface `Visitor`
    Overrides:
      `visitConstantUtf8` in class `EmptyVisitor`
    Parameters:
      `obj` - the constant.

  - ### visitConstantValue

    public void visitConstantValue(ConstantValue obj)
    Description copied from interface: `Visitor`
    Visits a ConstantValue attribute.
    Specified by:
      `visitConstantValue` in interface `Visitor`
    Overrides:
      `visitConstantValue` in class `EmptyVisitor`
    Parameters:
      `obj` - the attribute.

  - ### visitDeprecated

    public void visitDeprecated(Deprecated obj)
    Description copied from interface: `Visitor`
    Visits a Deprecated attribute.
    Specified by:
      `visitDeprecated` in interface `Visitor`
    Overrides:
      `visitDeprecated` in class `EmptyVisitor`
    Parameters:
      `obj` - the attribute.

  - ### visitEnclosingMethod

    public void visitEnclosingMethod(EnclosingMethod obj)
    Description copied from interface: `Visitor`
    Visits an EnclosingMethod attribute.
    Specified by:
      `visitEnclosingMethod` in interface `Visitor`
    Overrides:
      `visitEnclosingMethod` in class `EmptyVisitor`
    Parameters:
      `obj` - the attribute.
    Since:
      6.0

  - ### visitExceptionTable

    public void visitExceptionTable(ExceptionTable obj)
    Description copied from interface: `Visitor`
    Visits an ExceptionTable attribute.
    Specified by:
      `visitExceptionTable` in interface `Visitor`
    Overrides:
      `visitExceptionTable` in class `EmptyVisitor`
    Parameters:
      `obj` - the attribute.

  - ### visitField

    public void visitField(Field obj)
    Description copied from interface: `Visitor`
    Visits a Field.
    Specified by:
      `visitField` in interface `Visitor`
    Overrides:
      `visitField` in class `EmptyVisitor`
    Parameters:
      `obj` - the field.

  - ### visitInnerClass

    public void visitInnerClass(InnerClass obj)
    Description copied from interface: `Visitor`
    Visits an InnerClass.
    Specified by:
      `visitInnerClass` in interface `Visitor`
    Overrides:
      `visitInnerClass` in class `EmptyVisitor`
    Parameters:
      `obj` - the inner class.

  - ### visitInnerClasses

    public void visitInnerClasses(InnerClasses obj)
    Description copied from interface: `Visitor`
    Visits an InnerClasses attribute.
    Specified by:
      `visitInnerClasses` in interface `Visitor`
    Overrides:
      `visitInnerClasses` in class `EmptyVisitor`
    Parameters:
      `obj` - the attribute.

  - ### visitJavaClass

    public void visitJavaClass(JavaClass obj)
    Description copied from interface: `Visitor`
    Visits a JavaClass.
    Specified by:
      `visitJavaClass` in interface `Visitor`
    Overrides:
      `visitJavaClass` in class `EmptyVisitor`
    Parameters:
      `obj` - the class.

  - ### visitLineNumber

    public void visitLineNumber(LineNumber obj)
    Description copied from interface: `Visitor`
    Visits a LineNumber.
    Specified by:
      `visitLineNumber` in interface `Visitor`
    Overrides:
      `visitLineNumber` in class `EmptyVisitor`
    Parameters:
      `obj` - the line number.

  - ### visitLineNumberTable

    public void visitLineNumberTable(LineNumberTable obj)
    Description copied from interface: `Visitor`
    Visits a LineNumberTable attribute.
    Specified by:
      `visitLineNumberTable` in interface `Visitor`
    Overrides:
      `visitLineNumberTable` in class `EmptyVisitor`
    Parameters:
      `obj` - the attribute.

  - ### visitLocalVariable

    public void visitLocalVariable(LocalVariable obj)
    Description copied from interface: `Visitor`
    Visits a LocalVariable.
    Specified by:
      `visitLocalVariable` in interface `Visitor`
    Overrides:
      `visitLocalVariable` in class `EmptyVisitor`
    Parameters:
      `obj` - the local variable.

  - ### visitLocalVariableTable

    public void visitLocalVariableTable(LocalVariableTable obj)
    Description copied from interface: `Visitor`
    Visits a LocalVariableTable attribute.
    Specified by:
      `visitLocalVariableTable` in interface `Visitor`
    Overrides:
      `visitLocalVariableTable` in class `EmptyVisitor`
    Parameters:
      `obj` - the attribute.

  - ### visitLocalVariableTypeTable

    public void visitLocalVariableTypeTable(LocalVariableTypeTable obj)
    Description copied from interface: `Visitor`
    Visits a LocalVariableTypeTable attribute.
    Specified by:
      `visitLocalVariableTypeTable` in interface `Visitor`
    Overrides:
      `visitLocalVariableTypeTable` in class `EmptyVisitor`
    Parameters:
      `obj` - the attribute.
    Since:
      6.0

  - ### visitMethod

    public void visitMethod(Method obj)
    Description copied from interface: `Visitor`
    Visits a Method.
    Specified by:
      `visitMethod` in interface `Visitor`
    Overrides:
      `visitMethod` in class `EmptyVisitor`
    Parameters:
      `obj` - the method.

  - ### visitMethodParameters

    public void visitMethodParameters(MethodParameters obj)
    Description copied from interface: `Visitor`
    Visits a MethodParameters attribute.
    Specified by:
      `visitMethodParameters` in interface `Visitor`
    Overrides:
      `visitMethodParameters` in class `EmptyVisitor`
    Parameters:
      `obj` - the attribute.
    Since:
      6.0

  - ### visitNestMembers

    public void visitNestMembers(NestMembers obj)
    Description copied from interface: `Visitor`
    Visits a NestMembers attribute.
    Specified by:
      `visitNestMembers` in interface `Visitor`
    Overrides:
      `visitNestMembers` in class `EmptyVisitor`
    Parameters:
      `obj` - the attribute.
    Since:
      6.4.0

  - ### visitParameterAnnotation

    public void visitParameterAnnotation(ParameterAnnotations obj)
    Description copied from interface: `Visitor`
    Visits a ParameterAnnotations attribute.
    Specified by:
      `visitParameterAnnotation` in interface `Visitor`
    Overrides:
      `visitParameterAnnotation` in class `EmptyVisitor`
    Parameters:
      `obj` - the attribute.
    Since:
      6.0

  - ### visitParameterAnnotationEntry

    public void visitParameterAnnotationEntry(ParameterAnnotationEntry obj)
    Description copied from interface: `Visitor`
    Visits a ParameterAnnotationEntry.
    Specified by:
      `visitParameterAnnotationEntry` in interface `Visitor`
    Overrides:
      `visitParameterAnnotationEntry` in class `EmptyVisitor`
    Parameters:
      `obj` - the annotation entry.
    Since:
      6.0

  - ### visitRecord

    public void visitRecord(Record obj)
    Description copied from interface: `Visitor`
    Visits a `Record` object.
    Parameters:
      `obj` - Record to visit.

  - ### visitRecordComponent

    public void visitRecordComponent(RecordComponentInfo obj)
    Description copied from interface: `Visitor`
    Visits a `RecordComponentInfo` object.
    Parameters:
      `obj` - component to visit.

  - ### visitSignature

    public void visitSignature(Signature obj)
    Description copied from interface: `Visitor`
    Visits a Signature attribute.
    Specified by:
      `visitSignature` in interface `Visitor`
    Overrides:
      `visitSignature` in class `EmptyVisitor`
    Parameters:
      `obj` - the attribute.

  - ### visitSourceFile

    public void visitSourceFile(SourceFile obj)
    Description copied from interface: `Visitor`
    Visits a SourceFile attribute.
    Specified by:
      `visitSourceFile` in interface `Visitor`
    Overrides:
      `visitSourceFile` in class `EmptyVisitor`
    Parameters:
      `obj` - the attribute.

  - ### visitStackMap

    public void visitStackMap(StackMap obj)
    Description copied from interface: `Visitor`
    Visits a StackMap attribute.
    Specified by:
      `visitStackMap` in interface `Visitor`
    Overrides:
      `visitStackMap` in class `EmptyVisitor`
    Parameters:
      `obj` - the attribute.

  - ### visitStackMapEntry

    public void visitStackMapEntry(StackMapEntry obj)
    Description copied from interface: `Visitor`
    Visits a StackMapEntry.
    Specified by:
      `visitStackMapEntry` in interface `Visitor`
    Overrides:
      `visitStackMapEntry` in class `EmptyVisitor`
    Parameters:
      `obj` - the entry.
    Since:
      6.0

  - ### visitSynthetic

    public void visitSynthetic(Synthetic obj)
    Description copied from interface: `Visitor`
    Visits a Synthetic attribute.
    Specified by:
      `visitSynthetic` in interface `Visitor`
    Overrides:
      `visitSynthetic` in class `EmptyVisitor`
    Parameters:
      `obj` - the attribute.

  - ### visitUnknown

    public void visitUnknown(Unknown obj)
    Description copied from interface: `Visitor`
    Visits an Unknown attribute.
    Specified by:
      `visitUnknown` in interface `Visitor`
    Overrides:
      `visitUnknown` in class `EmptyVisitor`
    Parameters:
      `obj` - the attribute.