Package org.apache.bcel.verifier.statics
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 (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.
-
-
Constructor Summary
Constructors Constructor Description StringRepresentation(Node n)
Creates a new StringRepresentation object which is the representation of n.
-
Method Summary
-
Methods inherited from class org.apache.bcel.classfile.EmptyVisitor
visitConstantDynamic, visitConstantModule, visitConstantPackage, visitMethodParameter, visitModule, visitModuleExports, visitModuleMainClass, visitModuleOpens, visitModulePackages, visitModuleProvides, visitModuleRequires, visitNestHost
-
-
-
-
Constructor Detail
-
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 Detail
-
toString
public String toString()
Returns the String representation.
-
visitCode
public void visitCode(Code obj)
- Specified by:
visitCode
in interfaceVisitor
- Overrides:
visitCode
in classEmptyVisitor
-
visitAnnotation
public void visitAnnotation(Annotations obj)
- Specified by:
visitAnnotation
in interfaceVisitor
- Overrides:
visitAnnotation
in classEmptyVisitor
- Since:
- 6.0
-
visitLocalVariableTypeTable
public void visitLocalVariableTypeTable(LocalVariableTypeTable obj)
- Specified by:
visitLocalVariableTypeTable
in interfaceVisitor
- Overrides:
visitLocalVariableTypeTable
in classEmptyVisitor
- Since:
- 6.0
-
visitCodeException
public void visitCodeException(CodeException obj)
- Specified by:
visitCodeException
in interfaceVisitor
- Overrides:
visitCodeException
in classEmptyVisitor
-
visitConstantClass
public void visitConstantClass(ConstantClass obj)
- Specified by:
visitConstantClass
in interfaceVisitor
- Overrides:
visitConstantClass
in classEmptyVisitor
-
visitConstantDouble
public void visitConstantDouble(ConstantDouble obj)
- Specified by:
visitConstantDouble
in interfaceVisitor
- Overrides:
visitConstantDouble
in classEmptyVisitor
-
visitConstantFieldref
public void visitConstantFieldref(ConstantFieldref obj)
- Specified by:
visitConstantFieldref
in interfaceVisitor
- Overrides:
visitConstantFieldref
in classEmptyVisitor
-
visitConstantFloat
public void visitConstantFloat(ConstantFloat obj)
- Specified by:
visitConstantFloat
in interfaceVisitor
- Overrides:
visitConstantFloat
in classEmptyVisitor
-
visitConstantInteger
public void visitConstantInteger(ConstantInteger obj)
- Specified by:
visitConstantInteger
in interfaceVisitor
- Overrides:
visitConstantInteger
in classEmptyVisitor
-
visitConstantInterfaceMethodref
public void visitConstantInterfaceMethodref(ConstantInterfaceMethodref obj)
- Specified by:
visitConstantInterfaceMethodref
in interfaceVisitor
- Overrides:
visitConstantInterfaceMethodref
in classEmptyVisitor
-
visitConstantLong
public void visitConstantLong(ConstantLong obj)
- Specified by:
visitConstantLong
in interfaceVisitor
- Overrides:
visitConstantLong
in classEmptyVisitor
-
visitConstantMethodref
public void visitConstantMethodref(ConstantMethodref obj)
- Specified by:
visitConstantMethodref
in interfaceVisitor
- Overrides:
visitConstantMethodref
in classEmptyVisitor
-
visitConstantNameAndType
public void visitConstantNameAndType(ConstantNameAndType obj)
- Specified by:
visitConstantNameAndType
in interfaceVisitor
- Overrides:
visitConstantNameAndType
in classEmptyVisitor
-
visitConstantPool
public void visitConstantPool(ConstantPool obj)
- Specified by:
visitConstantPool
in interfaceVisitor
- Overrides:
visitConstantPool
in classEmptyVisitor
-
visitConstantString
public void visitConstantString(ConstantString obj)
- Specified by:
visitConstantString
in interfaceVisitor
- Overrides:
visitConstantString
in classEmptyVisitor
-
visitConstantUtf8
public void visitConstantUtf8(ConstantUtf8 obj)
- Specified by:
visitConstantUtf8
in interfaceVisitor
- Overrides:
visitConstantUtf8
in classEmptyVisitor
-
visitConstantValue
public void visitConstantValue(ConstantValue obj)
- Specified by:
visitConstantValue
in interfaceVisitor
- Overrides:
visitConstantValue
in classEmptyVisitor
-
visitDeprecated
public void visitDeprecated(Deprecated obj)
- Specified by:
visitDeprecated
in interfaceVisitor
- Overrides:
visitDeprecated
in classEmptyVisitor
-
visitExceptionTable
public void visitExceptionTable(ExceptionTable obj)
- Specified by:
visitExceptionTable
in interfaceVisitor
- Overrides:
visitExceptionTable
in classEmptyVisitor
-
visitField
public void visitField(Field obj)
- Specified by:
visitField
in interfaceVisitor
- Overrides:
visitField
in classEmptyVisitor
-
visitInnerClass
public void visitInnerClass(InnerClass obj)
- Specified by:
visitInnerClass
in interfaceVisitor
- Overrides:
visitInnerClass
in classEmptyVisitor
-
visitInnerClasses
public void visitInnerClasses(InnerClasses obj)
- Specified by:
visitInnerClasses
in interfaceVisitor
- Overrides:
visitInnerClasses
in classEmptyVisitor
-
visitJavaClass
public void visitJavaClass(JavaClass obj)
- Specified by:
visitJavaClass
in interfaceVisitor
- Overrides:
visitJavaClass
in classEmptyVisitor
-
visitLineNumber
public void visitLineNumber(LineNumber obj)
- Specified by:
visitLineNumber
in interfaceVisitor
- Overrides:
visitLineNumber
in classEmptyVisitor
-
visitLineNumberTable
public void visitLineNumberTable(LineNumberTable obj)
- Specified by:
visitLineNumberTable
in interfaceVisitor
- Overrides:
visitLineNumberTable
in classEmptyVisitor
-
visitLocalVariable
public void visitLocalVariable(LocalVariable obj)
- Specified by:
visitLocalVariable
in interfaceVisitor
- Overrides:
visitLocalVariable
in classEmptyVisitor
-
visitLocalVariableTable
public void visitLocalVariableTable(LocalVariableTable obj)
- Specified by:
visitLocalVariableTable
in interfaceVisitor
- Overrides:
visitLocalVariableTable
in classEmptyVisitor
-
visitMethod
public void visitMethod(Method obj)
- Specified by:
visitMethod
in interfaceVisitor
- Overrides:
visitMethod
in classEmptyVisitor
-
visitSignature
public void visitSignature(Signature obj)
- Specified by:
visitSignature
in interfaceVisitor
- Overrides:
visitSignature
in classEmptyVisitor
-
visitSourceFile
public void visitSourceFile(SourceFile obj)
- Specified by:
visitSourceFile
in interfaceVisitor
- Overrides:
visitSourceFile
in classEmptyVisitor
-
visitStackMap
public void visitStackMap(StackMap obj)
- Specified by:
visitStackMap
in interfaceVisitor
- Overrides:
visitStackMap
in classEmptyVisitor
-
visitSynthetic
public void visitSynthetic(Synthetic obj)
- Specified by:
visitSynthetic
in interfaceVisitor
- Overrides:
visitSynthetic
in classEmptyVisitor
-
visitUnknown
public void visitUnknown(Unknown obj)
- Specified by:
visitUnknown
in interfaceVisitor
- Overrides:
visitUnknown
in classEmptyVisitor
-
visitEnclosingMethod
public void visitEnclosingMethod(EnclosingMethod obj)
- Specified by:
visitEnclosingMethod
in interfaceVisitor
- Overrides:
visitEnclosingMethod
in classEmptyVisitor
- Since:
- 6.0
-
visitBootstrapMethods
public void visitBootstrapMethods(BootstrapMethods obj)
- Specified by:
visitBootstrapMethods
in interfaceVisitor
- Overrides:
visitBootstrapMethods
in classEmptyVisitor
- Since:
- 6.0
-
visitMethodParameters
public void visitMethodParameters(MethodParameters obj)
- Specified by:
visitMethodParameters
in interfaceVisitor
- Overrides:
visitMethodParameters
in classEmptyVisitor
- Since:
- 6.0
-
visitConstantInvokeDynamic
public void visitConstantInvokeDynamic(ConstantInvokeDynamic obj)
- Specified by:
visitConstantInvokeDynamic
in interfaceVisitor
- Overrides:
visitConstantInvokeDynamic
in classEmptyVisitor
- Since:
- 6.0
-
visitStackMapEntry
public void visitStackMapEntry(StackMapEntry obj)
- Specified by:
visitStackMapEntry
in interfaceVisitor
- Overrides:
visitStackMapEntry
in classEmptyVisitor
- Since:
- 6.0
-
visitParameterAnnotation
public void visitParameterAnnotation(ParameterAnnotations obj)
- Specified by:
visitParameterAnnotation
in interfaceVisitor
- Overrides:
visitParameterAnnotation
in classEmptyVisitor
- Since:
- 6.0
-
visitAnnotationEntry
public void visitAnnotationEntry(AnnotationEntry obj)
- Specified by:
visitAnnotationEntry
in interfaceVisitor
- Overrides:
visitAnnotationEntry
in classEmptyVisitor
- Since:
- 6.0
-
visitAnnotationDefault
public void visitAnnotationDefault(AnnotationDefault obj)
- Specified by:
visitAnnotationDefault
in interfaceVisitor
- Overrides:
visitAnnotationDefault
in classEmptyVisitor
- Since:
- 6.0
-
visitConstantMethodType
public void visitConstantMethodType(ConstantMethodType obj)
- Specified by:
visitConstantMethodType
in interfaceVisitor
- Overrides:
visitConstantMethodType
in classEmptyVisitor
- Since:
- 6.0
-
visitConstantMethodHandle
public void visitConstantMethodHandle(ConstantMethodHandle obj)
- Specified by:
visitConstantMethodHandle
in interfaceVisitor
- Overrides:
visitConstantMethodHandle
in classEmptyVisitor
- Since:
- 6.0
-
visitParameterAnnotationEntry
public void visitParameterAnnotationEntry(ParameterAnnotationEntry obj)
- Specified by:
visitParameterAnnotationEntry
in interfaceVisitor
- Overrides:
visitParameterAnnotationEntry
in classEmptyVisitor
- Since:
- 6.0
-
visitNestMembers
public void visitNestMembers(NestMembers obj)
- Specified by:
visitNestMembers
in interfaceVisitor
- Overrides:
visitNestMembers
in classEmptyVisitor
- Since:
- 6.4.0
-
-