Beispiel #1
0
  @Override
  protected void printRImpl(
      Env env, WriteStream out, int depth, IdentityHashMap<Value, String> valueSet)
      throws IOException {
    if (_classDef.printRImpl(env, _object, out, depth, valueSet)) {
      return;
    }

    Set<? extends Map.Entry<Value, Value>> entrySet = entrySet();

    if (entrySet == null) {
      out.print("resource(" + toString(env) + ")"); // XXX:
      return;
    }

    out.print(_classDef.getSimpleName());
    out.println(" Object");
    printRDepth(out, depth);
    out.print("(");

    for (Map.Entry<Value, Value> entry : entrySet) {
      out.println();
      printRDepth(out, depth);
      out.print("    [" + entry.getKey() + "] => ");

      entry.getValue().printRImpl(env, out, depth + 1, valueSet);
    }

    out.println();
    printRDepth(out, depth);
    out.println(")");
  }
  public static void writeDepend(Path dependPath, ArrayList<PersistentDependency> dependList)
      throws IOException {
    WriteStream os = dependPath.openWrite();
    try {
      for (int i = 0; i < dependList.size(); i++) {
        PersistentDependency dependency = dependList.get(i);

        if (dependency instanceof Depend) {
          Depend depend = (Depend) dependency;

          os.print('"');
          os.print(depend.getPath().getNativePath());
          os.print("\" \"");
          os.print(depend.getDigest());
          os.println("\"");
        }
      }
    } finally {
      os.close();
    }
  }
Beispiel #3
0
  /** var_dump() implementation */
  public void varDumpImpl(
      Env env, Value obj, WriteStream out, int depth, IdentityHashMap<Value, String> valueSet)
      throws IOException {
    String name = "SimpleXMLElement";

    if (obj != null) name = obj.getClassName();

    // php/1x33
    if (_text != null && _children == null && _attributes == null) {
      if (depth > 0) {
        _text.varDump(env, out, depth, valueSet);
        return;
      }

      out.println("object(" + name + ") (1) {");
      printDepth(out, 2 * (depth + 1));
      out.println("[0]=>");

      printDepth(out, 2 * (depth + 1));
      _text.varDump(env, out, depth, valueSet);
      out.println();

      printDepth(out, 2 * depth);
      out.print("}");

      return;
    }

    Set<Map.Entry<Value, Value>> entrySet = entrySet();
    out.println("object(" + name + ") (" + entrySet.size() + ") {");

    for (Map.Entry<Value, Value> entry : entrySet) {
      printDepth(out, 2 * (depth + 1));
      out.print("[");

      if (entry.getKey().isString()) out.print("\"" + entry.getKey() + "\"");
      else out.print(entry.getKey());

      out.println("]=>");

      printDepth(out, 2 * (depth + 1));
      entry.getValue().varDump(env, out, depth + 1, valueSet);
      out.println();
    }

    printDepth(out, 2 * depth);
    out.print('}');
  }
Beispiel #4
0
 private void writeTagMap(WriteStream out) throws IOException {
   for (Map.Entry<String, RepositoryTagEntry> entry : _tagMap.entrySet()) {
     out.println(entry.getKey());
     out.println(entry.getValue().getTagEntryHash());
   }
 }