當前位置: 首頁>>代碼示例>>Java>>正文


Java SAXResult.getHandler方法代碼示例

本文整理匯總了Java中javax.xml.transform.sax.SAXResult.getHandler方法的典型用法代碼示例。如果您正苦於以下問題:Java SAXResult.getHandler方法的具體用法?Java SAXResult.getHandler怎麽用?Java SAXResult.getHandler使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.xml.transform.sax.SAXResult的用法示例。


在下文中一共展示了SAXResult.getHandler方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setResult

import javax.xml.transform.sax.SAXResult; //導入方法依賴的package包/類
@Override
public void setResult(Result result) throws IllegalArgumentException
{
	SAXResult saxResult = toSAXResult(result);

	ContentHandler handler = saxResult.getHandler();
	this.nextContentHandler = handler;
	if (handler instanceof LexicalHandler)
	{
		this.nextLexicalHandler = (LexicalHandler) handler;
	}
	if (handler instanceof DTDHandler)
	{
		this.nextDtdHandler = (DTDHandler) handler;
	}

}
 
開發者ID:fluentxml4j,項目名稱:fluentxml4j,代碼行數:18,代碼來源:AbstractSAXFilter.java

示例2: setResult

import javax.xml.transform.sax.SAXResult; //導入方法依賴的package包/類
/** {@inheritDoc} */
public void setResult(Result result) throws IFException {
    if (result instanceof SAXResult) {
        SAXResult saxResult = (SAXResult)result;
        this.handler = new GenerationHelperContentHandler(
                saxResult.getHandler(), getMainNamespace());
    } else {
        this.handler = new GenerationHelperContentHandler(
                createContentHandler(result), getMainNamespace());
    }
}
 
開發者ID:pellcorp,項目名稱:fop,代碼行數:12,代碼來源:AbstractXMLWritingIFDocumentHandler.java

示例3: SaxSerializer

import javax.xml.transform.sax.SAXResult; //導入方法依賴的package包/類
public SaxSerializer(SAXResult result) {
    this(result.getHandler(),result.getLexicalHandler());
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:4,代碼來源:SaxSerializer.java

示例4: showSetters

import javax.xml.transform.sax.SAXResult; //導入方法依賴的package包/類
private static void showSetters(Connection con) {

      try {
         // Create and execute an SQL statement, retrieving an updatable result set.
         String SQL = "SELECT * FROM TestTable1;";
         Statement stmt = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
         ResultSet rs = stmt.executeQuery(SQL);
		   
         // Create an empty SQLXML object.
         SQLXML sqlxml = con.createSQLXML();
 
         // Set the result value from SAX events.
         SAXResult sxResult = sqlxml.setResult(SAXResult.class);
         ContentHandler myHandler = sxResult.getHandler();

         // Set the XML elements and attributes into the result.
         myHandler.startDocument();
         myHandler.startElement(null, "contact", "contact", null);
         myHandler.startElement(null, "name", "name", null);
         myHandler.endElement(null, "name", "name");
         myHandler.startElement(null, "phone", "phone", null);
         myHandler.endElement(null, "phone", "phone");		   
         myHandler.endElement(null, "contact", "contact");
         myHandler.endDocument();

         // Update the data in the result set.
         rs.moveToInsertRow();
         rs.updateString("Col2", "C");
         rs.updateSQLXML("Col3", sqlxml);
         rs.insertRow();
		   
         // Display the data. 
         System.out.println("showSetters method: Display data in TestTable1 => ");
         while (rs.next()) {
           System.out.println(rs.getString("Col1") + " : " + rs.getString("Col2"));
           SQLXML xml = rs.getSQLXML("Col3");              
           System.out.println("XML column : " + xml.getString());
         }
      } catch (Exception e) {
         e.printStackTrace();
      }
   }
 
開發者ID:lfkdsk,項目名稱:PracticeCode,代碼行數:43,代碼來源:sqlxmlExample.java

示例5: marshalSaxResult

import javax.xml.transform.sax.SAXResult; //導入方法依賴的package包/類
/**
 * Template method for handling {@code SAXResult}s.
 * <p>This implementation delegates to {@code marshalSaxHandlers}.
 * @param graph the root of the object graph to marshal
 * @param saxResult the {@code SAXResult}
 * @throws XmlMappingException if the given object cannot be marshalled to the result
 * @see #marshalSaxHandlers(Object, org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler)
 */
protected void marshalSaxResult(Object graph, SAXResult saxResult) throws XmlMappingException {
	ContentHandler contentHandler = saxResult.getHandler();
	Assert.notNull(contentHandler, "ContentHandler not set on SAXResult");
	LexicalHandler lexicalHandler = saxResult.getLexicalHandler();
	marshalSaxHandlers(graph, contentHandler, lexicalHandler);
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:15,代碼來源:AbstractMarshaller.java


注:本文中的javax.xml.transform.sax.SAXResult.getHandler方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。