Ejemplo n.º 1
0
  public GraphTextWriter getModifiers(ABC abc, boolean isStatic, GraphTextWriter writer) {
    if ((kindFlags & ATTR_Override) > 0) {
      writer.appendNoHilight("override ");
    }
    Multiname m = getName(abc);
    if (m != null) {
      String nsname = "";
      for (ABCContainerTag abcTag : abc.getAbcTags()) {
        if (m.namespace_index == -1) {
          break;
        }
        DottedChain dc =
            abcTag
                .getABC()
                .nsValueToName(
                    abc.constants.getNamespace(m.namespace_index).getName(abc.constants));
        nsname = dc.getLast();

        if (nsname == null) {
          break;
        }
        if (!nsname.isEmpty()) {
          break;
        }
      }

      Namespace ns = m.getNamespace(abc.constants);

      if (nsname != null) {
        String identifier = IdentifiersDeobfuscation.printIdentifier(true, nsname);
        if (identifier != null && !identifier.isEmpty()) {
          writer.appendNoHilight(identifier).appendNoHilight(" ");
        }
      }
      if (ns != null) {
        String nsPrefix = ns.getPrefix(abc);
        if (nsPrefix != null && !nsPrefix.isEmpty()) {
          writer.appendNoHilight(nsPrefix).appendNoHilight(" ");
        }
      }
    }
    if (isStatic) {
      if ((this instanceof TraitSlotConst) && ((TraitSlotConst) this).isNamespace()) {
        // static is automatic
      } else {
        writer.appendNoHilight("static ");
      }
    }
    if ((kindFlags & ATTR_Final) > 0) {
      if (!isStatic) {
        writer.appendNoHilight("final ");
      }
    }
    return writer;
  }
  private AS3Package ensurePackage(DottedChain packageStr) {
    AS3Package parent = root;
    for (int i = 0; i < packageStr.size(); i++) {
      String pathElement = packageStr.get(i);
      AS3Package pkg = parent.getSubPackage(pathElement);
      if (pkg == null) {
        pkg = new AS3Package(pathElement, swf);
        parent.addSubPackage(pkg);
      }

      parent = pkg;
    }

    return parent;
  }
Ejemplo n.º 3
0
  public int getStringId(DottedChain val, boolean add) {
    if (val == null) {
      return 0;
    }

    return getStringId(val.toRawString(), add);
  }
Ejemplo n.º 4
0
  public DottedChain getDottedChain(int index) {
    String str = getString(index);
    DottedChain chain = dottedChainCache.get(str);
    if (chain == null) {
      chain = DottedChain.parse(str);
      dottedChainCache.put(str, chain);
    }

    return chain;
  }
 /**
  * Returns the value for the cell at <code>columnIndex</code> and <code>rowIndex</code>.
  *
  * @param rowIndex the row whose value is to be queried
  * @param columnIndex the column whose value is to be queried
  * @return the value Object at the specified cell
  */
 @Override
 public Object getValueAt(int rowIndex, int columnIndex) {
   switch (columnIndex) {
     case 0:
       return rowIndex;
     case 1:
       if (rowIndex == 0) {
         return "-";
       }
       return abc.constants.getNamespace(rowIndex).getKindStr();
     case 2:
       if (rowIndex == 0) {
         return "-";
       }
       DottedChain chain = abc.constants.getNamespace(rowIndex).getName(abc.constants);
       if (chain == null) {
         return "-";
       }
       return chain.toRawString();
     default:
       return null;
   }
 }