当前位置: 首页>>代码示例>>Java>>正文


Java CharArrayWriter.close方法代码示例

本文整理汇总了Java中java.io.CharArrayWriter.close方法的典型用法代码示例。如果您正苦于以下问题:Java CharArrayWriter.close方法的具体用法?Java CharArrayWriter.close怎么用?Java CharArrayWriter.close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.io.CharArrayWriter的用法示例。


在下文中一共展示了CharArrayWriter.close方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: parseScriptText

import java.io.CharArrayWriter; //导入方法依赖的package包/类
private String parseScriptText(String tx) {
    CharArrayWriter cw = new CharArrayWriter();
    int size = tx.length();
    int i = 0;
    while (i < size) {
        char ch = tx.charAt(i);
        if (i + 2 < size && ch == '%' && tx.charAt(i + 1) == '\\'
                && tx.charAt(i + 2) == '>') {
            cw.write('%');
            cw.write('>');
            i += 3;
        } else {
            cw.write(ch);
            ++i;
        }
    }
    cw.close();
    return cw.toString();
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:20,代码来源:Parser.java

示例2: parseScriptText

import java.io.CharArrayWriter; //导入方法依赖的package包/类
private String parseScriptText(String tx) {
	CharArrayWriter cw = new CharArrayWriter();
	int size = tx.length();
	int i = 0;
	while (i < size) {
		char ch = tx.charAt(i);
		if (i + 2 < size && ch == '%' && tx.charAt(i + 1) == '\\' && tx.charAt(i + 2) == '>') {
			cw.write('%');
			cw.write('>');
			i += 3;
		} else {
			cw.write(ch);
			++i;
		}
	}
	cw.close();
	return cw.toString();
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:19,代码来源:Parser.java

示例3: verifyWriterCorrect

import java.io.CharArrayWriter; //导入方法依赖的package包/类
private boolean verifyWriterCorrect() throws Exception {
    final String IDENTITY_XSLT_WITH_INDENT =
            "<xsl:stylesheet version='1.0' " + // NOI18N
            "xmlns:xsl='http://www.w3.org/1999/XSL/Transform' " + // NOI18N
            "xmlns:xalan='http://xml.apache.org/xslt' " + // NOI18N
            "exclude-result-prefixes='xalan'>" + // NOI18N
            "<xsl:output method='xml' indent='yes' xalan:indent-amount='4'/>" + // NOI18N
            "<xsl:template match='@*|node()'>" + // NOI18N
            "<xsl:copy>" + // NOI18N
            "<xsl:apply-templates select='@*|node()'/>" + // NOI18N
            "</xsl:copy>" + // NOI18N
            "</xsl:template>" + // NOI18N
            "</xsl:stylesheet>"; // NOI18N
    String data = "<root xmlns='root'/>"; // NOI18N
    Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(data)));
    doc.getDocumentElement().appendChild(doc.createElementNS("child", "child")); // NOI18N
    Transformer t = TransformerFactory.newInstance().newTransformer(
            new StreamSource(new StringReader(IDENTITY_XSLT_WITH_INDENT)));
    Source source = new DOMSource(doc);
    CharArrayWriter output = new CharArrayWriter();
    Result result = new StreamResult(output);
    t.transform(source, result);
    
    output.close();
    
    String text = output.toString();
    
    return text.indexOf("\"child\"") != (-1) || text.indexOf("'child'") != (-1); // NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:30,代码来源:AntProjectModule.java

示例4: getText

import java.io.CharArrayWriter; //导入方法依赖的package包/类
String getText(Mark start, Mark stop) throws JasperException {
    Mark oldstart = mark();
    reset(start);
    CharArrayWriter caw = new CharArrayWriter();
    while (!markEquals(stop)) {
        caw.write(nextChar());
    }
    caw.close();
    setCurrent(oldstart);
    return caw.toString();
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:12,代码来源:JspReader.java

示例5: getText

import java.io.CharArrayWriter; //导入方法依赖的package包/类
String getText(Mark start, Mark stop) throws JasperException {
    Mark oldstart = mark();
    reset(start);
    CharArrayWriter caw = new CharArrayWriter();
    while (!stop.equals(mark()))
        caw.write(nextChar());
    caw.close();
    reset(oldstart);
    return caw.toString();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:JspReader.java

示例6: getText

import java.io.CharArrayWriter; //导入方法依赖的package包/类
String getText(Mark start, Mark stop) throws JasperException {
	Mark oldstart = mark();
	reset(start);
	CharArrayWriter caw = new CharArrayWriter();
	while (!markEquals(stop)) {
		caw.write(nextChar());
	}
	caw.close();
	setCurrent(oldstart);
	return caw.toString();
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:12,代码来源:JspReader.java


注:本文中的java.io.CharArrayWriter.close方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。