예제 #1
0
  public void getValueStr(
      Trait parent, GraphTextWriter writer, ABC abc, List<String> fullyQualifiedNames)
      throws InterruptedException {
    if (assignedValue != null) {
      if (parent instanceof TraitClass) {
        TraitClass tc = (TraitClass) parent;
        int traitInitId =
            abc.class_info.get(tc.class_info).static_traits.traits.size()
                + abc.instance_info.get(tc.class_info).instance_traits.traits.size()
                + 1;
        int initMethod = abc.class_info.get(tc.class_info).cinit_index;
        writer.startTrait(traitInitId);
        writer.startMethod(initMethod);
        if (Configuration.showMethodBodyId.get()) {
          writer.appendNoHilight("// method body id: ");
          writer.appendNoHilight(abc.findBodyIndex(initMethod));
          writer.newLine();
        }
      }
      assignedValue.toString(
          writer,
          LocalData.create(abc.constants, new HashMap<Integer, String>(), fullyQualifiedNames));
      if (parent instanceof TraitClass) {
        writer.endMethod();
        writer.endTrait();
      }
      return;
    }

    if (value_kind != 0) {
      ValueKind val = new ValueKind(value_index, value_kind);
      writer.hilightSpecial(val.toString(abc.constants), HighlightSpecialType.TRAIT_VALUE);
    }
  }
 public boolean isXML(
     ConstantPool constants,
     HashMap<Integer, String> localRegNames,
     List<String> fullyQualifiedNames)
     throws InterruptedException {
   String cname;
   if (name != null) {
     cname = name.toString(LocalData.create(constants, localRegNames, fullyQualifiedNames));
   } else {
     cname = (constants.getMultiname(multinameIndex).getName(constants, fullyQualifiedNames));
   }
   String cns = "";
   if (namespace != null) {
     cns = namespace.toString(LocalData.create(constants, localRegNames, fullyQualifiedNames));
   } else {
     Namespace ns = constants.getMultiname(multinameIndex).getNamespace(constants);
     if ((ns != null) && (ns.name_index != 0)) {
       cns = ns.getName(constants);
     }
   }
   return cname.equals("XML") && cns.isEmpty();
 }