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


Java Format.setOmitDeclaration方法代码示例

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


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

示例1: write

import org.jdom.output.Format; //导入方法依赖的package包/类
static void write(File file) throws FileNotFoundException, IOException{
	Document document = new Document();
	Element root = new Element("document");
	root.setAttribute("version", Main.VERSION_ID);
	for(Blueprint bp : Main.blueprints){
		
		Element blueprint = writeGraphEditor(bp);
		
		for(VFunction f : bp.getFunctions()){
			blueprint.addContent(writeGraphEditor(f.getEditor()));
		}
		
		root.addContent(blueprint);
	}
	document.setRootElement(root);
	XMLOutputter output = new XMLOutputter();
	Format format = Format.getPrettyFormat();//getRawFormat();
	format.setOmitDeclaration(true);
	format.setOmitEncoding(true);
	format.setTextMode(TextMode.PRESERVE);
	output.setFormat(format);
	output.output(document, new FileOutputStream(file));
}
 
开发者ID:QuinnFreedman,项目名称:THINK-VPL,代码行数:24,代码来源:SaveFileIO.java

示例2: JPFClasspathFixProcessor

import org.jdom.output.Format; //导入方法依赖的package包/类
public JPFClasspathFixProcessor()
{
	super();
	sax = new SAXBuilder();
	sax.setValidation(false);
	sax.setReuseParser(true);
	sax.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
	Format format = Format.getRawFormat();
	format.setOmitEncoding(true);
	format.setOmitDeclaration(true);
	format.setLineSeparator("\n");
	format.setEncoding("UTF-8");

	xmlOut = new XMLOutputter(format);
}
 
开发者ID:equella,项目名称:Equella,代码行数:16,代码来源:JPFClasspathFixProcessor.java

示例3: NewPluginWizard

import org.jdom.output.Format; //导入方法依赖的package包/类
public NewPluginWizard()
{
	fFirstPage = new NewJPFPluginWizardPageOne();
	fSecondPage = new NewJavaProjectWizardPageTwo(fFirstPage);
	Format format = Format.getPrettyFormat();
	format.setIndent("\t");
	format.setOmitEncoding(true);
	format.setOmitDeclaration(true);
	format.setLineSeparator("\n");
	format.setEncoding("UTF-8");
	xmlOut = new XMLOutputter(format);
}
 
开发者ID:equella,项目名称:Equella,代码行数:13,代码来源:NewPluginWizard.java

示例4: toCompactString

import org.jdom.output.Format; //导入方法依赖的package包/类
public String toCompactString() {
    Format format = Format.getCompactFormat();
    format.setOmitDeclaration(true);
    String xml = toString(format);
    xml = xml.replaceAll("\\r","");
    xml = xml.replaceAll("\\n","");
    return xml;
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:9,代码来源:Container.java

示例5: toCompactString

import org.jdom.output.Format; //导入方法依赖的package包/类
public String toCompactString() {
    Format format = Format.getCompactFormat();
    format.setOmitDeclaration(true);
    String xml = toString(format);
    xml = xml.replaceAll("\\r","");
    xml = xml.replaceAll("\\n","");
    return "<?xml version=\"1.0\"?>"+xml;
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:9,代码来源:LASDocument.java

示例6: toEncodedURLString

import org.jdom.output.Format; //导入方法依赖的package包/类
public String toEncodedURLString() throws UnsupportedEncodingException {
    Format format = Format.getCompactFormat();
    format.setOmitDeclaration(true);
    String xml = toString(format);
    xml = xml.replaceAll("\\r\\n","");
    xml = xml.replaceAll("\\r","");
    xml = xml.replaceAll("\\n","");
    return URLEncoder.encode("<?xml version=\"1.0\"?>"+xml, "UTF-8");
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:10,代码来源:LASDocument.java

示例7: toEncodedJavaScriptSafeURLString

import org.jdom.output.Format; //导入方法依赖的package包/类
public String toEncodedJavaScriptSafeURLString() throws UnsupportedEncodingException  {
    Format format = Format.getCompactFormat();
    format.setOmitDeclaration(true);
    String xml = toString(format);
    
    //xml = xml.replaceAll("\"","\\\\\"");
    xml = xml.replaceAll("'","\\\\'");;
    xml = xml.replaceAll("\\r\\n","");
    xml = xml.replaceAll("\\r","");
    xml = xml.replaceAll("\\n","");
    return URLEncoder.encode("<?xml version=\"1.0\"?>"+xml, "UTF-8");
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:13,代码来源:LASDocument.java

示例8: toJavaScriptSafeString

import org.jdom.output.Format; //导入方法依赖的package包/类
public String toJavaScriptSafeString() {
    Format format = Format.getCompactFormat();
    format.setOmitDeclaration(true);
    String xml = toString(format);
    xml="<?xml version=\"1.0\"?>"+xml;
    xml = xml.replaceAll("'","\\\\'");
    xml = xml.replaceAll("\"","\\\\\"");
    xml = xml.replaceAll("\\r\\n","");
    xml = xml.replaceAll("\\r","");
    xml = xml.replaceAll("\\n","");
    return xml;
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:13,代码来源:LASDocument.java

示例9: toEncodedURLString

import org.jdom.output.Format; //导入方法依赖的package包/类
/**
 * Returns the document encoded by the URLEncoder class after striping carriage returns and line feeds.
 * @return the encoded string
 * @throws UnsupportedEncodingException
 */
public String toEncodedURLString() throws UnsupportedEncodingException {
    Format format = Format.getCompactFormat();
    format.setOmitDeclaration(true);
    String xml = toString(format);
    xml = xml.replaceAll("\\r\\n","");
    xml = xml.replaceAll("\\r","");
    xml = xml.replaceAll("\\n","");
    return URLEncoder.encode("<?xml version=\"1.0\"?>"+xml, "UTF-8");
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:15,代码来源:IOSPDocument.java

示例10: toEncodedJavaScriptSafeURLString

import org.jdom.output.Format; //导入方法依赖的package包/类
/**
 * An attempt to return an encoded string that is usable in JavaScript variable assignments.
 * @return the encoded string
 * @throws UnsupportedEncodingException
 */
public String toEncodedJavaScriptSafeURLString() throws UnsupportedEncodingException  {
    Format format = Format.getCompactFormat();
    format.setOmitDeclaration(true);
    String xml = toString(format);
    
    xml = xml.replaceAll("\"","\\\\\"");
    xml = xml.replaceAll("'","\\\\'");;
    xml = xml.replaceAll("\\r\\n","");
    xml = xml.replaceAll("\\r","");
    xml = xml.replaceAll("\\n","");
    return URLEncoder.encode("<?xml version=\"1.0\"?>"+xml, "UTF-8");
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:18,代码来源:IOSPDocument.java

示例11: toJavaScriptSafeString

import org.jdom.output.Format; //导入方法依赖的package包/类
/**
 * Attempt to return the document as a string that can be used in a JavaScript variable assignment.
 * @return the docuement as a string
 */
public String toJavaScriptSafeString() {
    Format format = Format.getCompactFormat();
    format.setOmitDeclaration(true);
    String xml = toString(format);
    xml = xml.replaceAll("'","\\\\'");
    xml = xml.replaceAll("\"","\\\\\"");
    xml = xml.replaceAll("\\r\\n","");
    xml = xml.replaceAll("\\r","");
    xml = xml.replaceAll("\\n","");
    return "<?xml version=\"1.0\"?>"+xml;
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:16,代码来源:IOSPDocument.java

示例12: cswUPDATETransaction

import org.jdom.output.Format; //导入方法依赖的package包/类
private String cswUPDATETransaction(String query) throws KettleException, UnsupportedEncodingException{
	try {
		
		StringBuilder st = new StringBuilder("<response>");
		Element rootElement=fromStringToJDOMDocument("<root>"+query+"</root>").getRootElement();
		List<?> list=rootElement.getChildren();
		final Iterator<?> it=list.iterator();
		while (it.hasNext()){
			Element courant1=(Element)it.next();
			Element courant=(Element) courant1.clone();
			StringBuilder sb = new StringBuilder(ENTETE_TRANSACTION_UPDATE);
			courant.detach();
			Format fmt = Format.getPrettyFormat();
			fmt.setOmitDeclaration(true);
			
		    XMLOutputter outputter = new XMLOutputter(fmt);
	        String xmlString = outputter.outputString(new Document(courant));
			sb.append(xmlString);
			sb.append(getFilter(courant));
			sb.append(FOOTPAGE_TRANSACTION_UPDATE);
			sb = new StringBuilder (new String(sb.toString().getBytes(),"UTF-8"));
			st.append(CSWPOST(sb.toString()));
			st.delete(st.indexOf("<?"),st.indexOf("?>")+2);
		}
		st.append("</response>");
		return st.toString();
		
	} catch (KettleException e) {			
		throw new KettleException(e);
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:32,代码来源:CSWWriter.java

示例13: toCompactString

import org.jdom.output.Format; //导入方法依赖的package包/类
/**
 * Returns the document as a String without any extra white space.
 * @return the document as a compact string.
 */
public String toCompactString() {
    Format format = Format.getCompactFormat();
    format.setOmitDeclaration(true);
    return "<?xml version=\"1.0\"?>"+toString(format);
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:10,代码来源:IOSPDocument.java


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