CpoolMethodType.java 767 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright (c) 2014 Per M.A. Bothner.
  2. // This is free software; for terms and warranty disclaimer see ./COPYING.
  3. package gnu.bytecode;
  4. import java.io.*;
  5. /** A CONSTANT_MethodType entry in the constant pool. */
  6. public class CpoolMethodType extends CpoolEntry {
  7. CpoolUtf8 descriptor;
  8. public CpoolMethodType() {
  9. }
  10. public int getTag() { return ConstantPool.METHOD_TYPE; }
  11. void write (DataOutputStream dstr) throws java.io.IOException {
  12. throw new Error();
  13. }
  14. public void print (ClassTypeWriter dst, int verbosity) {
  15. if (verbosity > 0) {
  16. dst.print("MethodType");
  17. if (verbosity == 2) {
  18. dst.print(" descriptor: ");
  19. dst.printOptionalIndex(descriptor);
  20. } else
  21. dst.print( ' ');
  22. }
  23. descriptor.print(dst, 0);
  24. }
  25. }