gpt4 book ai didi

java.util.prefs.XMLParser.flushEmptyElement()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 21:21:40 26 4
gpt4 key购买 nike

本文整理了Java中java.util.prefs.XMLParser.flushEmptyElement()方法的一些代码示例,展示了XMLParser.flushEmptyElement()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLParser.flushEmptyElement()方法的具体详情如下:
包路径:java.util.prefs.XMLParser
类名称:XMLParser
方法名:flushEmptyElement

XMLParser.flushEmptyElement介绍

暂无

代码示例

代码示例来源:origin: robovm/robovm

private static void exportEntries(String[] keys, String[] values,
    BufferedWriter out) throws IOException {
  if (keys.length == 0) {
    flushEmptyElement("map", out);
    return;
  }
  flushStartTag("map", out);
  for (int i = 0; i < keys.length; i++) {
    if (values[i] != null) {
      flushEmptyElement("entry", new String[] { "key", "value" },
          new String[] { keys[i], values[i] }, out);
    }
  }
  flushEndTag("map", out);
}

代码示例来源:origin: robovm/robovm

/***************************************************************************
 * utilities for Preferences export
 **************************************************************************/
static void exportPrefs(Preferences prefs, OutputStream stream,
    boolean withSubTree) throws IOException, BackingStoreException {
  indent = -1;
  BufferedWriter out = new BufferedWriter(new OutputStreamWriter(stream, "UTF-8"));
  out.write(HEADER);
  out.newLine();
  out.newLine();
  out.write(DOCTYPE);
  out.write(" '");
  out.write(PREFS_DTD_NAME);
  out.write("'>");
  out.newLine();
  out.newLine();
  flushStartTag("preferences", new String[] { "EXTERNAL_XML_VERSION" },
      new String[] { String.valueOf(XML_VERSION) }, out);
  flushStartTag("root", new String[] { "type" },
      new String[] { prefs.isUserNode() ? "user" : "system" }, out);
  flushEmptyElement("map", out);
  StringTokenizer ancestors = new StringTokenizer(prefs.absolutePath(), "/");
  exportNode(ancestors, prefs, withSubTree, out);
  flushEndTag("root", out);
  flushEndTag("preferences", out);
  out.flush();
  out = null;
}

代码示例来源:origin: robovm/robovm

private static void exportNode(StringTokenizer ancestors,
    Preferences prefs, boolean withSubTree, BufferedWriter out)
    throws IOException, BackingStoreException {
  if (ancestors.hasMoreTokens()) {
    String name = ancestors.nextToken();
    flushStartTag("node", new String[] { "name" }, new String[] { name }, out);
    if (ancestors.hasMoreTokens()) {
      flushEmptyElement("map", out);
      exportNode(ancestors, prefs, withSubTree, out);
    } else {
      exportEntries(prefs, out);
      if (withSubTree) {
        exportSubTree(prefs, out);
      }
    }
    flushEndTag("node", out);
  }
}

代码示例来源:origin: ibinti/bugvm

private static void exportEntries(String[] keys, String[] values,
    BufferedWriter out) throws IOException {
  if (keys.length == 0) {
    flushEmptyElement("map", out);
    return;
  }
  flushStartTag("map", out);
  for (int i = 0; i < keys.length; i++) {
    if (values[i] != null) {
      flushEmptyElement("entry", new String[] { "key", "value" },
          new String[] { keys[i], values[i] }, out);
    }
  }
  flushEndTag("map", out);
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

private static void exportEntries(String[] keys, String[] values,
    BufferedWriter out) throws IOException {
  if (keys.length == 0) {
    flushEmptyElement("map", out);
    return;
  }
  flushStartTag("map", out);
  for (int i = 0; i < keys.length; i++) {
    if (values[i] != null) {
      flushEmptyElement("entry", new String[] { "key", "value" },
          new String[] { keys[i], values[i] }, out);
    }
  }
  flushEndTag("map", out);
}

代码示例来源:origin: MobiVM/robovm

private static void exportEntries(String[] keys, String[] values,
    BufferedWriter out) throws IOException {
  if (keys.length == 0) {
    flushEmptyElement("map", out);
    return;
  }
  flushStartTag("map", out);
  for (int i = 0; i < keys.length; i++) {
    if (values[i] != null) {
      flushEmptyElement("entry", new String[] { "key", "value" },
          new String[] { keys[i], values[i] }, out);
    }
  }
  flushEndTag("map", out);
}

代码示例来源:origin: com.bugvm/bugvm-rt

private static void exportEntries(String[] keys, String[] values,
    BufferedWriter out) throws IOException {
  if (keys.length == 0) {
    flushEmptyElement("map", out);
    return;
  }
  flushStartTag("map", out);
  for (int i = 0; i < keys.length; i++) {
    if (values[i] != null) {
      flushEmptyElement("entry", new String[] { "key", "value" },
          new String[] { keys[i], values[i] }, out);
    }
  }
  flushEndTag("map", out);
}

代码示例来源:origin: FlexoVM/flexovm

private static void exportEntries(String[] keys, String[] values,
    BufferedWriter out) throws IOException {
  if (keys.length == 0) {
    flushEmptyElement("map", out);
    return;
  }
  flushStartTag("map", out);
  for (int i = 0; i < keys.length; i++) {
    if (values[i] != null) {
      flushEmptyElement("entry", new String[] { "key", "value" },
          new String[] { keys[i], values[i] }, out);
    }
  }
  flushEndTag("map", out);
}

代码示例来源:origin: com.gluonhq/robovm-rt

private static void exportEntries(String[] keys, String[] values,
    BufferedWriter out) throws IOException {
  if (keys.length == 0) {
    flushEmptyElement("map", out);
    return;
  }
  flushStartTag("map", out);
  for (int i = 0; i < keys.length; i++) {
    if (values[i] != null) {
      flushEmptyElement("entry", new String[] { "key", "value" },
          new String[] { keys[i], values[i] }, out);
    }
  }
  flushEndTag("map", out);
}

代码示例来源:origin: com.bugvm/bugvm-rt

/***************************************************************************
 * utilities for Preferences export
 **************************************************************************/
static void exportPrefs(Preferences prefs, OutputStream stream,
    boolean withSubTree) throws IOException, BackingStoreException {
  indent = -1;
  BufferedWriter out = new BufferedWriter(new OutputStreamWriter(stream, "UTF-8"));
  out.write(HEADER);
  out.newLine();
  out.newLine();
  out.write(DOCTYPE);
  out.write(" '");
  out.write(PREFS_DTD_NAME);
  out.write("'>");
  out.newLine();
  out.newLine();
  flushStartTag("preferences", new String[] { "EXTERNAL_XML_VERSION" },
      new String[] { String.valueOf(XML_VERSION) }, out);
  flushStartTag("root", new String[] { "type" },
      new String[] { prefs.isUserNode() ? "user" : "system" }, out);
  flushEmptyElement("map", out);
  StringTokenizer ancestors = new StringTokenizer(prefs.absolutePath(), "/");
  exportNode(ancestors, prefs, withSubTree, out);
  flushEndTag("root", out);
  flushEndTag("preferences", out);
  out.flush();
  out = null;
}

代码示例来源:origin: MobiVM/robovm

/***************************************************************************
 * utilities for Preferences export
 **************************************************************************/
static void exportPrefs(Preferences prefs, OutputStream stream,
    boolean withSubTree) throws IOException, BackingStoreException {
  indent = -1;
  BufferedWriter out = new BufferedWriter(new OutputStreamWriter(stream, "UTF-8"));
  out.write(HEADER);
  out.newLine();
  out.newLine();
  out.write(DOCTYPE);
  out.write(" '");
  out.write(PREFS_DTD_NAME);
  out.write("'>");
  out.newLine();
  out.newLine();
  flushStartTag("preferences", new String[] { "EXTERNAL_XML_VERSION" },
      new String[] { String.valueOf(XML_VERSION) }, out);
  flushStartTag("root", new String[] { "type" },
      new String[] { prefs.isUserNode() ? "user" : "system" }, out);
  flushEmptyElement("map", out);
  StringTokenizer ancestors = new StringTokenizer(prefs.absolutePath(), "/");
  exportNode(ancestors, prefs, withSubTree, out);
  flushEndTag("root", out);
  flushEndTag("preferences", out);
  out.flush();
  out = null;
}

代码示例来源:origin: com.gluonhq/robovm-rt

/***************************************************************************
 * utilities for Preferences export
 **************************************************************************/
static void exportPrefs(Preferences prefs, OutputStream stream,
    boolean withSubTree) throws IOException, BackingStoreException {
  indent = -1;
  BufferedWriter out = new BufferedWriter(new OutputStreamWriter(stream, "UTF-8"));
  out.write(HEADER);
  out.newLine();
  out.newLine();
  out.write(DOCTYPE);
  out.write(" '");
  out.write(PREFS_DTD_NAME);
  out.write("'>");
  out.newLine();
  out.newLine();
  flushStartTag("preferences", new String[] { "EXTERNAL_XML_VERSION" },
      new String[] { String.valueOf(XML_VERSION) }, out);
  flushStartTag("root", new String[] { "type" },
      new String[] { prefs.isUserNode() ? "user" : "system" }, out);
  flushEmptyElement("map", out);
  StringTokenizer ancestors = new StringTokenizer(prefs.absolutePath(), "/");
  exportNode(ancestors, prefs, withSubTree, out);
  flushEndTag("root", out);
  flushEndTag("preferences", out);
  out.flush();
  out = null;
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/***************************************************************************
 * utilities for Preferences export
 **************************************************************************/
static void exportPrefs(Preferences prefs, OutputStream stream,
    boolean withSubTree) throws IOException, BackingStoreException {
  indent = -1;
  BufferedWriter out = new BufferedWriter(new OutputStreamWriter(stream, "UTF-8"));
  out.write(HEADER);
  out.newLine();
  out.newLine();
  out.write(DOCTYPE);
  out.write(" '");
  out.write(PREFS_DTD_NAME);
  out.write("'>");
  out.newLine();
  out.newLine();
  flushStartTag("preferences", new String[] { "EXTERNAL_XML_VERSION" },
      new String[] { String.valueOf(XML_VERSION) }, out);
  flushStartTag("root", new String[] { "type" },
      new String[] { prefs.isUserNode() ? "user" : "system" }, out);
  flushEmptyElement("map", out);
  StringTokenizer ancestors = new StringTokenizer(prefs.absolutePath(), "/");
  exportNode(ancestors, prefs, withSubTree, out);
  flushEndTag("root", out);
  flushEndTag("preferences", out);
  out.flush();
  out = null;
}

代码示例来源:origin: FlexoVM/flexovm

/***************************************************************************
 * utilities for Preferences export
 **************************************************************************/
static void exportPrefs(Preferences prefs, OutputStream stream,
    boolean withSubTree) throws IOException, BackingStoreException {
  indent = -1;
  BufferedWriter out = new BufferedWriter(new OutputStreamWriter(stream, "UTF-8"));
  out.write(HEADER);
  out.newLine();
  out.newLine();
  out.write(DOCTYPE);
  out.write(" '");
  out.write(PREFS_DTD_NAME);
  out.write("'>");
  out.newLine();
  out.newLine();
  flushStartTag("preferences", new String[] { "EXTERNAL_XML_VERSION" },
      new String[] { String.valueOf(XML_VERSION) }, out);
  flushStartTag("root", new String[] { "type" },
      new String[] { prefs.isUserNode() ? "user" : "system" }, out);
  flushEmptyElement("map", out);
  StringTokenizer ancestors = new StringTokenizer(prefs.absolutePath(), "/");
  exportNode(ancestors, prefs, withSubTree, out);
  flushEndTag("root", out);
  flushEndTag("preferences", out);
  out.flush();
  out = null;
}

代码示例来源:origin: com.bugvm/bugvm-rt

private static void exportNode(StringTokenizer ancestors,
    Preferences prefs, boolean withSubTree, BufferedWriter out)
    throws IOException, BackingStoreException {
  if (ancestors.hasMoreTokens()) {
    String name = ancestors.nextToken();
    flushStartTag("node", new String[] { "name" }, new String[] { name }, out);
    if (ancestors.hasMoreTokens()) {
      flushEmptyElement("map", out);
      exportNode(ancestors, prefs, withSubTree, out);
    } else {
      exportEntries(prefs, out);
      if (withSubTree) {
        exportSubTree(prefs, out);
      }
    }
    flushEndTag("node", out);
  }
}

代码示例来源:origin: ibinti/bugvm

private static void exportNode(StringTokenizer ancestors,
    Preferences prefs, boolean withSubTree, BufferedWriter out)
    throws IOException, BackingStoreException {
  if (ancestors.hasMoreTokens()) {
    String name = ancestors.nextToken();
    flushStartTag("node", new String[] { "name" }, new String[] { name }, out);
    if (ancestors.hasMoreTokens()) {
      flushEmptyElement("map", out);
      exportNode(ancestors, prefs, withSubTree, out);
    } else {
      exportEntries(prefs, out);
      if (withSubTree) {
        exportSubTree(prefs, out);
      }
    }
    flushEndTag("node", out);
  }
}

代码示例来源:origin: com.gluonhq/robovm-rt

private static void exportNode(StringTokenizer ancestors,
    Preferences prefs, boolean withSubTree, BufferedWriter out)
    throws IOException, BackingStoreException {
  if (ancestors.hasMoreTokens()) {
    String name = ancestors.nextToken();
    flushStartTag("node", new String[] { "name" }, new String[] { name }, out);
    if (ancestors.hasMoreTokens()) {
      flushEmptyElement("map", out);
      exportNode(ancestors, prefs, withSubTree, out);
    } else {
      exportEntries(prefs, out);
      if (withSubTree) {
        exportSubTree(prefs, out);
      }
    }
    flushEndTag("node", out);
  }
}

代码示例来源:origin: MobiVM/robovm

private static void exportNode(StringTokenizer ancestors,
    Preferences prefs, boolean withSubTree, BufferedWriter out)
    throws IOException, BackingStoreException {
  if (ancestors.hasMoreTokens()) {
    String name = ancestors.nextToken();
    flushStartTag("node", new String[] { "name" }, new String[] { name }, out);
    if (ancestors.hasMoreTokens()) {
      flushEmptyElement("map", out);
      exportNode(ancestors, prefs, withSubTree, out);
    } else {
      exportEntries(prefs, out);
      if (withSubTree) {
        exportSubTree(prefs, out);
      }
    }
    flushEndTag("node", out);
  }
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

private static void exportNode(StringTokenizer ancestors,
    Preferences prefs, boolean withSubTree, BufferedWriter out)
    throws IOException, BackingStoreException {
  if (ancestors.hasMoreTokens()) {
    String name = ancestors.nextToken();
    flushStartTag("node", new String[] { "name" }, new String[] { name }, out);
    if (ancestors.hasMoreTokens()) {
      flushEmptyElement("map", out);
      exportNode(ancestors, prefs, withSubTree, out);
    } else {
      exportEntries(prefs, out);
      if (withSubTree) {
        exportSubTree(prefs, out);
      }
    }
    flushEndTag("node", out);
  }
}

代码示例来源:origin: FlexoVM/flexovm

private static void exportNode(StringTokenizer ancestors,
    Preferences prefs, boolean withSubTree, BufferedWriter out)
    throws IOException, BackingStoreException {
  if (ancestors.hasMoreTokens()) {
    String name = ancestors.nextToken();
    flushStartTag("node", new String[] { "name" }, new String[] { name }, out);
    if (ancestors.hasMoreTokens()) {
      flushEmptyElement("map", out);
      exportNode(ancestors, prefs, withSubTree, out);
    } else {
      exportEntries(prefs, out);
      if (withSubTree) {
        exportSubTree(prefs, out);
      }
    }
    flushEndTag("node", out);
  }
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com