當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。