gpt4 book ai didi

org.eclipse.pde.internal.core.XMLPrintHandler类的使用及代码示例

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

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

XMLPrintHandler介绍

暂无

代码示例

代码示例来源:origin: org.eclipse/org.eclipse.pde.core

public void write(String indent, PrintWriter writer) {
  StringBuffer buffer = new StringBuffer();
  String newIndent = indent + XMLPrintHandler.XML_INDENT;
  try {
    // Print repeated-subitem element
    buffer.append(ELEMENT_REPEATED_SUBITEM);
    // Print values attribute
    if ((fValues != null) && 
        (fValues.length() > 0)) {
      // Write as is. Do not translate
      buffer.append(XMLPrintHandler.wrapAttribute(
          ATTRIBUTE_VALUES, fValues));
    }
    // Start element
    XMLPrintHandler.printBeginElement(writer, buffer.toString(),
        indent, false);
    // Print subitem
    if (fSubItem != null) {
      fSubItem.write(newIndent, writer);
    }
    // End element
    XMLPrintHandler.printEndElement(writer, ELEMENT_REPEATED_SUBITEM, indent);
    
  } catch (IOException e) {
    // Suppress
    //e.printStackTrace();
  }                 
  
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.pde.core

printHead(xmlWriter, encoding);
printNode(xmlWriter, ((Document) node).getDocumentElement(), encoding, indent);
break;
  for (int i = 0; i < attributeList.getLength(); i++) {
    Node attribute = attributeList.item(i);
    tempElementString.append(wrapAttributeForPrint(attribute.getNodeName(), attribute.getNodeValue()));
printBeginElement(xmlWriter, tempElementString.toString(), indent, length == 0);
  printNode(xmlWriter, childNodes.item(i), encoding, indent + "\t"); //$NON-NLS-1$
  printEndElement(xmlWriter, node.getNodeName(), indent);
break;
xmlWriter.write(encode(node.getNodeValue()).toString());
break;

代码示例来源:origin: org.eclipse/org.eclipse.pde.core

protected void saveExtensions(State state, File dir) {
  try {
    File file = new File(dir, CACHE_EXTENSION); //$NON-NLS-1$
    XMLPrintHandler.writeFile(createExtensionDocument(state), file);
  } catch (IOException e) {
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.pde.core

public void write(String indent, PrintWriter writer) {
  String newIndent = indent + XMLPrintHandler.XML_INDENT;
  
  try {
    // Start element
    XMLPrintHandler.printBeginElement(writer, ELEMENT_ONCOMPLETION,
        indent, false);
    // Print contents
    if ((fContent != null) &&
        (fContent.length() > 0)) {
      writer.write(newIndent
          + PDETextHelper.translateWriteText(fContent.trim(),
              TAG_EXCEPTIONS, SUBSTITUTE_CHARS) + "\n");				 //$NON-NLS-1$
    }
    // End element
    XMLPrintHandler.printEndElement(writer, ELEMENT_ONCOMPLETION, indent);
  } catch (IOException e) {
    // Suppress
    //e.printStackTrace();
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.pde.core

XMLPrintHandler.printHead(writer, ATTRIBUTE_VALUE_ENCODING);
  buffer.append(XMLPrintHandler.wrapAttribute(
      ATTRIBUTE_TITLE, 
      PDETextHelper.translateWriteText(
XMLPrintHandler.printBeginElement(writer, buffer.toString(),
    indent, false);
XMLPrintHandler.printEndElement(writer, ELEMENT_CHEATSHEET, indent);

代码示例来源:origin: org.eclipse/org.eclipse.pde.core

protected void writeAttributes(StringBuffer buffer) {
  // Print task attribute
  if ((fFieldTask != null) && 
      (fFieldTask.length() > 0)) {
    // Trim leading and trailing whitespace
    // Encode characters
    buffer.append(XMLPrintHandler.wrapAttribute(
        ATTRIBUTE_TASK, 
        PDETextHelper.translateWriteText(
            fFieldTask.trim(), DEFAULT_SUBSTITUTE_CHARS)));
  }    
}

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ua.core

@Override
public void write(String indent, PrintWriter writer) {
  try {
    // Print XML decl
    XMLPrintHandler.printHead(writer, ATTRIBUTE_VALUE_ENCODING);
    super.write(indent, writer);
  } catch (IOException e) {
    // Suppress
    // e.printStackTrace();
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.pde.core

public static void printText(Writer xmlWriter, String text, String indent) throws IOException{
  StringBuffer temp = new StringBuffer(indent);
  temp.append(encode(text).toString());
  temp.append("\n"); //$NON-NLS-1$
  xmlWriter.write(temp.toString());
}

代码示例来源:origin: org.eclipse/org.eclipse.pde.core

public static void writeFile(Document doc, File file) throws IOException {
  Writer writer = null;
  OutputStream out = null;
  try {
    out = new FileOutputStream(file);
    writer = new OutputStreamWriter(out, "UTF-8"); //$NON-NLS-1$
    XMLPrintHandler.printNode(writer, doc, "UTF-8", ""); //$NON-NLS-1$ //$NON-NLS-2$
  } finally {
    try {
      if (writer != null)
        writer.close();
    } catch (IOException e1) {
    }
    try {
      if (out != null)
        out.close();
    } catch (IOException e1) {
    }
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.pde.core

public void write(String indent, PrintWriter writer) {
  
  String newIndent = indent + XMLPrintHandler.XML_INDENT;
  
  try {
    // Start element
    XMLPrintHandler.printBeginElement(writer, ELEMENT_DESCRIPTION,
        indent, false);
    // Print contents
    if ((fContent != null) &&
        (fContent.length() > 0)) {
      writer.write(newIndent
          + PDETextHelper.translateWriteText(fContent.trim(),
              TAG_EXCEPTIONS, SUBSTITUTE_CHARS) + "\n"); //$NON-NLS-1$
    }
    // End element
    XMLPrintHandler.printEndElement(writer, ELEMENT_DESCRIPTION, indent);
  } catch (IOException e) {
    // Suppress
    //e.printStackTrace();
  }
}

代码示例来源:origin: org.eclipse.pde.ua/core

protected void writeAttributes(StringBuffer buffer) {
  // Print task attribute
  if ((fFieldTask != null) && (fFieldTask.length() > 0)) {
    // Trim leading and trailing whitespace
    // Encode characters
    buffer.append(XMLPrintHandler.wrapAttribute(ATTRIBUTE_TASK,
        PDETextHelper.translateWriteText(fFieldTask.trim(),
            DEFAULT_SUBSTITUTE_CHARS)));
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.pde.core

public void write(String indent, PrintWriter writer) {
  
  try {
    // Print XML decl
    XMLPrintHandler.printHead(writer, ATTRIBUTE_VALUE_ENCODING);
    super.write(indent, writer);
  } catch (IOException e) {
    // Suppress
    //e.printStackTrace();
  }             
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.pde.core

public static void printText(Writer xmlWriter, String text, String indent) throws IOException {
  StringBuffer temp = new StringBuffer(indent);
  temp.append(encode(text).toString());
  temp.append("\n"); //$NON-NLS-1$
  xmlWriter.write(temp.toString());
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.pde.core

public static void writeFile(Document doc, File file) throws IOException {
  Writer writer = null;
  OutputStream out = null;
  try {
    out = new FileOutputStream(file);
    writer = new OutputStreamWriter(out, "UTF-8"); //$NON-NLS-1$
    XMLPrintHandler.printNode(writer, doc, "UTF-8", ""); //$NON-NLS-1$ //$NON-NLS-2$
  } finally {
    try {
      if (writer != null)
        writer.close();
    } catch (IOException e1) {
    }
    try {
      if (out != null)
        out.close();
    } catch (IOException e1) {
    }
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.pde.core

(fSerialization.length() > 0)) {
  buffer.append(XMLPrintHandler.wrapAttribute(
      ATTRIBUTE_SERIALIZATION, fSerialization));
    (fReturns.length() > 0)) {
  buffer.append(XMLPrintHandler.wrapAttribute(
      ATTRIBUTE_RETURNS, fReturns));
buffer.append(XMLPrintHandler.wrapAttribute(
    ATTRIBUTE_CONFIRM, new Boolean(fConfirm).toString()));
    (fWhen.length() > 0)) {
  buffer.append(XMLPrintHandler.wrapAttribute(
      ATTRIBUTE_WHEN, fWhen));
  buffer.append(XMLPrintHandler.wrapAttribute(
      ATTRIBUTE_TRANSLATE, fTranslate));
XMLPrintHandler.printBeginElement(writer, buffer.toString(),
    indent, false);
XMLPrintHandler.printEndElement(writer, ELEMENT_COMMAND, indent);

代码示例来源:origin: org.eclipse/org.eclipse.pde.core

printHead(xmlWriter,encoding);
printNode(xmlWriter, ((Document) node).getDocumentElement(),encoding, indent);
break;
  for(int i= 0; i <attributeList.getLength();i++){
    Node attribute = attributeList.item(i);
    tempElementString.append(wrapAttributeForPrint(attribute.getNodeName(),attribute.getNodeValue()));
printBeginElement(xmlWriter,tempElementString.toString(), indent, length == 0);
  printNode(xmlWriter, childNodes.item(i),encoding, indent + "\t"); //$NON-NLS-1$
  printEndElement(xmlWriter,node.getNodeName(), indent);
break;
xmlWriter.write(encode(node.getNodeValue()).toString());
break;

代码示例来源:origin: org.eclipse.pde.ua/core

public void write(String indent, PrintWriter writer) {
  StringBuffer buffer = new StringBuffer();
  try {
    // Assemble start element
    buffer.append(getElement());
    // Assemble attributes
    writeAttributes(buffer);
    // Print start element and attributes
    XMLPrintHandler.printBeginElement(writer, buffer.toString(),
        indent, false);
    // Print elements
    writeElements(indent, writer);
    // Print end element
    XMLPrintHandler.printEndElement(writer, getElement(), indent);
  } catch (IOException e) {
    // Suppress
    // e.printStackTrace();
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.pde.core

XMLPrintHandler.writeFile(doc, new File(dir, CACHE_EXTENSION)); 
} catch (Exception e) {
  PDECore.log(e);

代码示例来源:origin: org.eclipse.pde.ua/core

protected void writeAttributes(StringBuffer buffer) {
  // Print name attribute
  if ((fFieldName != null) && (fFieldName.length() > 0)) {
    // Trim leading and trailing whitespace
    // Encode characters
    buffer.append(XMLPrintHandler.wrapAttribute(ATTRIBUTE_NAME,
        PDETextHelper.translateWriteText(fFieldName.trim(),
            DEFAULT_SUBSTITUTE_CHARS)));
  }
}

代码示例来源:origin: org.eclipse.pde.ua/core

public void write(String indent, PrintWriter writer) {
  try {
    // Print XML decl
    XMLPrintHandler.printHead(writer, ATTRIBUTE_VALUE_ENCODING);
    super.write(indent, writer);
  } catch (IOException e) {
    // Suppress
    // e.printStackTrace();
  }
}

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