Examples of UTF8Info


Examples of net.sf.rej.java.constantpool.UTF8Info

  public void setDescriptorIndex(int index) {
    this.descriptorIndex = index;
  }

  public Descriptor getDescriptor() {
    UTF8Info info = (UTF8Info) this.pool.get(this.descriptorIndex);
    return new Descriptor(info.getValue());
  }
View Full Code Here

Examples of net.sf.rej.java.constantpool.UTF8Info

        sd.drawDefault("(");
        sd.drawKeyword("long");
        sd.drawDefault(") " + li.getLongValue());
        break;
      case ConstantPoolInfo.UTF8:
        UTF8Info ui = (UTF8Info) constant;
        sd.drawString("\"");
        sd.drawString(ui.getValue());
        sd.drawString("\"");
        break;
      case ConstantPoolInfo.STRING:
        StringInfo si = (StringInfo) constant;
        sd.drawString("\"");
View Full Code Here

Examples of net.sf.rej.java.constantpool.UTF8Info

    return elementValue;
  }
 
  public String getName() {
    UTF8Info info = (UTF8Info)this.pool.get(this.typeIndex);
    Descriptor desc = new Descriptor(info.getValue());
    return desc.getReturn().toString();
  }
View Full Code Here

Examples of net.sf.rej.java.constantpool.UTF8Info

      ElementValue ev = entry.getValue();
      sb.append(name + " = " + ev.getValue());
    }
    String pairs = sb.toString();
    sb = new StringBuilder();
    UTF8Info info = (UTF8Info)this.pool.get(this.typeIndex);
    Descriptor desc = new Descriptor(info.getValue());
    sb.append(desc.getReturn());
    if (pairs.length() > 0) {
      sb.append("(");
      sb.append(pairs);
      sb.append(")");
View Full Code Here

Examples of net.sf.rej.java.constantpool.UTF8Info

  }

  public void execute() {
    if (this.utf8 == null) {
      // the first time this is executed, create the items
      this.utf8 = new UTF8Info(this.str, this.cp);
      int utf8Index = this.cp.forceAdd(this.utf8);
      this.stringInfo = new StringInfo(utf8Index, this.cp);
      this.cp.forceAdd(this.stringInfo);
    } else {
      /* if an actions(undo, redo) is performed, do not recreate
View Full Code Here

Examples of net.sf.rej.java.constantpool.UTF8Info

  void validateAndStore(ConstantPoolInfo cpi, String newValue)
      throws BasicInfoEditor.ValidationException {
    // TODO: validate and save to cpi
    switch (cpi.getType()) {
    case ConstantPoolInfo.UTF8: {
      UTF8Info info = (UTF8Info) cpi;
      EditorFacade.getInstance().modifyUTF8Info(info, newValue);
      break;
    }
    case ConstantPoolInfo.DOUBLE: {
      DoubleInfo info = (DoubleInfo) cpi;
      double d = 0;
      try {
        d = Double.parseDouble(newValue);
      } catch (NumberFormatException nfe) {
        throw new BasicInfoEditor.ValidationException(
            "Not a valid double. (" + nfe.getMessage() + ")");
      }
      EditorFacade.getInstance().modifyDoubleInfo(info, d);
      break;
    }
    case ConstantPoolInfo.FLOAT: {
      FloatInfo info = (FloatInfo) cpi;
      float f = 0;
      try {
        f = Float.parseFloat(newValue);
      } catch (NumberFormatException nfe) {
        throw new BasicInfoEditor.ValidationException(
            "Not a valid float. (" + nfe.getMessage() + ")");
      }
      EditorFacade.getInstance().modifyFloatInfo(info, f);
      break;
    }
    case ConstantPoolInfo.INTEGER: {
      IntegerInfo info = (IntegerInfo) cpi;
      int i = 0;
      try {
        i = Integer.parseInt(newValue);
      } catch (NumberFormatException nfe) {
        throw new BasicInfoEditor.ValidationException(
            "Not a valid integer. (" + nfe.getMessage() + ")");
      }
      EditorFacade.getInstance().modifyIntegerInfo(info, i);
      break;
    }
    case ConstantPoolInfo.LONG: {
      LongInfo info = (LongInfo) cpi;
      long l = 0;
      try {
        l = Long.parseLong(newValue);
      } catch (NumberFormatException nfe) {
        throw new BasicInfoEditor.ValidationException(
            "Not a valid long. (" + nfe.getMessage() + ")");
      }
      EditorFacade.getInstance().modifyLongInfo(info, l);
      break;
    }
    case ConstantPoolInfo.STRING: {
      StringInfo info = (StringInfo) cpi;
      int answer = JOptionPane.showOptionDialog(this,
          "Modify underlying UTF-8 info or create a new one.",
          "Modify String Info item",
          JOptionPane.YES_NO_CANCEL_OPTION,
          JOptionPane.QUESTION_MESSAGE, null, new String[] {
              "Modify", "Create new", "Cancel" }, "Modify");
      if (answer == JOptionPane.YES_OPTION) {
        // Modify UTF-8 Info
        UTF8Info ui = info.getUTF8Info();
        EditorFacade.getInstance().modifyUTF8Info(ui, newValue);
        break;

      } else if (answer == JOptionPane.NO_OPTION) {
        // Create a new UTF-8 Info
View Full Code Here

Examples of net.sf.rej.java.constantpool.UTF8Info

      return map;
    }

    public String getName() {
        UTF8Info info = (UTF8Info) this.pool.get(this.nameIndex);

        return info.getValue();
    }
View Full Code Here

Examples of net.sf.rej.java.constantpool.UTF8Info

        return sb.toString().trim();
    }

    public Descriptor getDescriptor() {
        UTF8Info info = (UTF8Info) this.pool.get(this.descriptorIndex);
        return new Descriptor(info.getValue());
    }
View Full Code Here

Examples of net.sf.rej.java.constantpool.UTF8Info

                + this.pool.get(this.descriptorIndex) + ") accessflags 0x"
                + ByteToolkit.getHexString(this.accessFlags, 4);
    }

    public String getName() {
        UTF8Info info = (UTF8Info) this.pool.get(this.nameIndex);

        return info.getValue();
    }
View Full Code Here

Examples of net.sf.rej.java.constantpool.UTF8Info

        return info.getValue();
    }

    public Descriptor getDescriptor() {
        UTF8Info info = (UTF8Info) this.pool.get(this.descriptorIndex);
        return new Descriptor(info.getValue());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.