当前位置: 首页>>代码示例>>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;未经允许,请勿转载。