gpt4 book ai didi

org.znerd.xmlenc.XMLOutputter.startTag()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 05:39:05 25 4
gpt4 key购买 nike

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

XMLOutputter.startTag介绍

暂无

代码示例

代码示例来源:origin: ch.cern.hadoop/hadoop-hdfs

/**
 * create XML block from general exception.
 */
private static void createGeneralException(XMLOutputter doc,
  String clusterid, String eMsg) throws IOException {
 doc.startTag("cluster");
 doc.attribute("clusterId", clusterid);
 doc.startTag("message");
 doc.startTag("item");
 doc.attribute("msg", eMsg);
 doc.endTag(); // item
 doc.endTag(); // message
 doc.endTag(); // cluster
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

/**
 * create XML block from general exception.
 */
private static void createGeneralException(XMLOutputter doc,
  String clusterid, String eMsg) throws IOException {
 doc.startTag("cluster");
 doc.attribute("clusterId", clusterid);
 doc.startTag("message");
 doc.startTag("item");
 doc.attribute("msg", eMsg);
 doc.endTag(); // item
 doc.endTag(); // message
 doc.endTag(); // cluster
}

代码示例来源:origin: ch.cern.hadoop/hadoop-hdfs

/**
 * create the XML for exceptions that we encountered when connecting to
 * namenode.
 */
private static void createNamenodeExceptionMsg(XMLOutputter doc,
  Map<String, Exception> exceptionMsg) throws IOException {
 if (exceptionMsg.size() > 0) {
  doc.startTag("unreportedNamenodes");
  for (Map.Entry<String, Exception> m : exceptionMsg.entrySet()) {
   doc.startTag("node");
   doc.attribute("name", m.getKey());
   doc.attribute("exception",
     StringUtils.stringifyException(m.getValue()));
   doc.endTag();// node
  }
  doc.endTag(); // unreportedNamnodes
 }
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

/**
 * create the XML for exceptions that we encountered when connecting to
 * namenode.
 */
private static void createNamenodeExceptionMsg(XMLOutputter doc,
  Map<String, Exception> exceptionMsg) throws IOException {
 if (exceptionMsg.size() > 0) {
  doc.startTag("unreportedNamenodes");
  for (Map.Entry<String, Exception> m : exceptionMsg.entrySet()) {
   doc.startTag("node");
   doc.attribute("name", m.getKey());
   doc.attribute("exception",
     StringUtils.stringifyException(m.getValue()));
   doc.endTag();// node
  }
  doc.endTag(); // unreportedNamnodes
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-hdfs

/** Write the object to XML format */
protected void writeXml(Exception except, String path, XMLOutputter doc)
  throws IOException {
 doc.startTag(RemoteException.class.getSimpleName());
 doc.attribute("path", path);
 if (except instanceof RemoteException) {
  doc.attribute("class", ((RemoteException) except).getClassName());
 } else {
  doc.attribute("class", except.getClass().getName());
 }
 String msg = except.getLocalizedMessage();
 int i = msg.indexOf("\n");
 if (i >= 0) {
  msg = msg.substring(0, i);
 }
 doc.attribute("message", msg.substring(msg.indexOf(":") + 1).trim());
 doc.endTag();
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

/** Write the object to XML format */
public void writeXml(String path, XMLOutputter doc) throws IOException {
 doc.startTag(RemoteException.class.getSimpleName());
 doc.attribute("path", path);
 doc.attribute("class", getClassName());
 String msg = getLocalizedMessage();
 int i = msg.indexOf("\n");
 if (i >= 0) {
  msg = msg.substring(0, i);
 }
 doc.attribute("message", msg.substring(msg.indexOf(":") + 1).trim());
 doc.endTag();
}

代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core

/** Write the object to XML format */
public void writeXml(String path, XMLOutputter doc) throws IOException {
 doc.startTag(RemoteException.class.getSimpleName());
 doc.attribute("path", path);
 doc.attribute("class", getClassName());
 String msg = getLocalizedMessage();
 int i = msg.indexOf("\n");
 if (i >= 0) {
  msg = msg.substring(0, i);
 }
 doc.attribute("message", msg.substring(msg.indexOf(":") + 1).trim());
 doc.endTag();
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

/** Write the object to XML format */
protected void writeXml(Exception except, String path, XMLOutputter doc)
  throws IOException {
 doc.startTag(RemoteException.class.getSimpleName());
 doc.attribute("path", path);
 if (except instanceof RemoteException) {
  doc.attribute("class", ((RemoteException) except).getClassName());
 } else {
  doc.attribute("class", except.getClass().getName());
 }
 String msg = except.getLocalizedMessage();
 int i = msg.indexOf("\n");
 if (i >= 0) {
  msg = msg.substring(0, i);
 }
 doc.attribute("message", msg.substring(msg.indexOf(":") + 1).trim());
 doc.endTag();
}

代码示例来源:origin: ch.cern.hadoop/hadoop-hdfs

/**
 * Generate a XML block as such, <item label="Node" value="hostname"
 * link="http://hostname:50070" />
 */
private static void toXmlItemBlockWithLink(XMLOutputter doc, String value,
  URL url, String label) throws IOException {
 doc.startTag("item");
 doc.attribute("label", label);
 doc.attribute("value", value);
 doc.attribute("link", url.toString());
 doc.endTag(); // item
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

/** Write that object to xml output. */
public static void write(XMLOutputter xml, MD5MD5CRC32FileChecksum that
  ) throws IOException {
 xml.startTag(MD5MD5CRC32FileChecksum.class.getName());
 if (that != null) {
  xml.attribute("bytesPerCRC", "" + that.bytesPerCRC);
  xml.attribute("crcPerBlock", "" + that.crcPerBlock);
  xml.attribute("md5", "" + that.md5);
 }
 xml.endTag();
}

代码示例来源:origin: ch.cern.hadoop/hadoop-hdfs

/**
 * Generate a XML block as such, <item label=key value=value/>
 */
private static void toXmlItemBlock(XMLOutputter doc, String key, String value)
  throws IOException {
 doc.startTag("item");
 doc.attribute("label", key);
 doc.attribute("value", value);
 doc.endTag();
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

/**
 * Generate a XML block as such, <item label=key value=value/>
 */
private static void toXmlItemBlock(XMLOutputter doc, String key, String value)
  throws IOException {
 doc.startTag("item");
 doc.attribute("label", key);
 doc.attribute("value", value);
 doc.endTag();
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

/**
 * Generate a XML block as such, <item label="Node" value="hostname"
 * link="http://hostname:50070" />
 */
private static void toXmlItemBlockWithLink(XMLOutputter doc, String value,
  URL url, String label) throws IOException {
 doc.startTag("item");
 doc.attribute("label", label);
 doc.attribute("value", value);
 doc.attribute("link", url.toString());
 doc.endTag(); // item
}

代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core

/** Write that object to xml output. */
public static void write(XMLOutputter xml, MD5MD5CRC32FileChecksum that
  ) throws IOException {
 xml.startTag(MD5MD5CRC32FileChecksum.class.getName());
 if (that != null) {
  xml.attribute("bytesPerCRC", "" + that.bytesPerCRC);
  xml.attribute("crcPerBlock", "" + that.crcPerBlock);
  xml.attribute("md5", "" + that.md5);
 }
 xml.endTag();
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

/** Write that object to xml output. */
public static void write(XMLOutputter xml, MD5MD5CRC32FileChecksum that
  ) throws IOException {
 xml.startTag(MD5MD5CRC32FileChecksum.class.getName());
 if (that != null) {
  xml.attribute("bytesPerCRC", "" + that.bytesPerCRC);
  xml.attribute("crcPerBlock", "" + that.crcPerBlock);
  xml.attribute("crcType", ""+ that.getCrcType().name());
  xml.attribute("md5", "" + that.md5);
 }
 xml.endTag();
}

代码示例来源:origin: io.hops/hadoop-common

/** Write that object to xml output. */
public static void write(XMLOutputter xml, MD5MD5CRC32FileChecksum that
  ) throws IOException {
 xml.startTag(MD5MD5CRC32FileChecksum.class.getName());
 if (that != null) {
  xml.attribute("bytesPerCRC", "" + that.bytesPerCRC);
  xml.attribute("crcPerBlock", "" + that.crcPerBlock);
  xml.attribute("crcType", ""+ that.getCrcType().name());
  xml.attribute("md5", "" + that.md5);
 }
 xml.endTag();
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

/** Write that object to xml output. */
public static void write(XMLOutputter xml, MD5MD5CRC32FileChecksum that
  ) throws IOException {
 xml.startTag(MD5MD5CRC32FileChecksum.class.getName());
 if (that != null) {
  xml.attribute("bytesPerCRC", "" + that.bytesPerCRC);
  xml.attribute("crcPerBlock", "" + that.crcPerBlock);
  xml.attribute("crcType", ""+ that.getCrcType().name());
  xml.attribute("md5", "" + that.md5);
 }
 xml.endTag();
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

/** Write that object to xml output. */
public static void write(XMLOutputter xml, MD5MD5CRC32FileChecksum that
  ) throws IOException {
 xml.startTag(MD5MD5CRC32FileChecksum.class.getName());
 if (that != null) {
  xml.attribute("bytesPerCRC", "" + that.bytesPerCRC);
  xml.attribute("crcPerBlock", "" + that.crcPerBlock);
  xml.attribute("crcType", ""+ that.getCrcType().name());
  xml.attribute("md5", "" + that.md5);
 }
 xml.endTag();
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

/**
 * Write a node to output.
 * Node information includes path, modification, permission, owner and group.
 * For files, it also includes size, replication and block-size. 
 */
static void writeInfo(String parent, HdfsFileStatus i, XMLOutputter doc) throws IOException {
 final SimpleDateFormat ldf = df.get();
 doc.startTag(i.isDir() ? "directory" : "file");
 doc.attribute("path", i.getFullPath(new Path(parent)).toUri().getPath());
 doc.attribute("modified", ldf.format(new Date(i.getModificationTime())));
 doc.attribute("accesstime", ldf.format(new Date(i.getAccessTime())));
 if (!i.isDir()) {
  doc.attribute("size", String.valueOf(i.getLen()));
  doc.attribute("replication", String.valueOf(i.getReplication()));
  doc.attribute("blocksize", String.valueOf(i.getBlockSize()));
 }
 doc.attribute("permission", (i.isDir()? "d": "-") + i.getPermission());
 doc.attribute("owner", i.getOwner());
 doc.attribute("group", i.getGroup());
 doc.endTag();
}

代码示例来源:origin: ch.cern.hadoop/hadoop-hdfs

/**
 * Write a node to output.
 * Node information includes path, modification, permission, owner and group.
 * For files, it also includes size, replication and block-size. 
 */
static void writeInfo(final Path fullpath, final HdfsFileStatus i,
  final XMLOutputter doc) throws IOException {
 final SimpleDateFormat ldf = df.get();
 doc.startTag(i.isDir() ? "directory" : "file");
 doc.attribute("path", ServletUtil.encodePath(fullpath.toUri().getPath()));
 doc.attribute("modified", ldf.format(new Date(i.getModificationTime())));
 doc.attribute("accesstime", ldf.format(new Date(i.getAccessTime())));
 if (!i.isDir()) {
  doc.attribute("size", String.valueOf(i.getLen()));
  doc.attribute("replication", String.valueOf(i.getReplication()));
  doc.attribute("blocksize", String.valueOf(i.getBlockSize()));
 }
 doc.attribute("permission", (i.isDir()? "d": "-") + i.getPermission());
 doc.attribute("owner", i.getOwner());
 doc.attribute("group", i.getGroup());
 doc.endTag();
}

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