• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java FeedXMLParseException类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中it.sauronsoftware.feed4j.FeedXMLParseException的典型用法代码示例。如果您正苦于以下问题:Java FeedXMLParseException类的具体用法?Java FeedXMLParseException怎么用?Java FeedXMLParseException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

FeedXMLParseException类属于it.sauronsoftware.feed4j包,在下文中一共展示了FeedXMLParseException类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: processRow

点赞 2

import it.sauronsoftware.feed4j.FeedXMLParseException; //导入依赖的package包/类
public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException
{
	 Object[] outputRowData=null;

	try
	{
		 // Grab a row
		 outputRowData=getOneRow();
		 if (outputRowData==null)
	     {
	        setOutputDone();  // signal end to receiver(s)
	        return false; // end of data or error.
	     }
	}
	catch(Exception e)
	{
		if (getStepMeta().isDoingErrorHandling())
		{
        RowMeta errorMeta = new RowMeta();
        Object[] errorData = new Object[0];
        
        if(this.data.readrow != null) {
          errorMeta.addRowMeta(getInputRowMeta());
          errorData = this.data.readrow;
        }

        String errorCode = "UnknownError"; //$NON-NLS-1$
        
        // Determine error code
        if(e instanceof FeedXMLParseException) {
          if(e.getCause() instanceof DocumentException) {
            if(((DocumentException)e.getCause()).getNestedException() instanceof SAXParseException) {
              errorCode = "XMLError"; //$NON-NLS-1$
            } else if(((DocumentException)e.getCause()).getNestedException() instanceof FileNotFoundException) {
              errorCode = "FileNotFound"; //$NON-NLS-1$
            } else if(((DocumentException)e.getCause()).getNestedException() instanceof IOException) {
              if(((DocumentException)e.getCause()).getNestedException() instanceof UnknownHostException) {
                errorCode = "UnknownHost"; //$NON-NLS-1$
              } else {
                errorCode = "TransferError"; //$NON-NLS-1$
              }
            }             
          }
        } else if(e instanceof MalformedURLException) {
          errorCode = "BadURL"; //$NON-NLS-1$
        } else if (e instanceof UnsupportedFeedException) {
          errorCode = "BadRSSFormat"; //$NON-NLS-1$
        }

        putError(errorMeta, errorData, 1, e.toString(), this.data.currenturl, errorCode);
        errors++;
        logError(BaseMessages.getString(PKG, "RssInput.ErrorProcessing.Run",e.toString())); //$NON-NLS-1$
        
        ByteArrayOutputStream byteOS = new ByteArrayOutputStream();
        e.printStackTrace(new PrintStream(byteOS));
        logDebug(byteOS.toString());
		}
		else
		{
			logError(BaseMessages.getString(PKG, "RssInput.Exception.Run",e.toString())); //$NON-NLS-1$
			logError(Const.getStackTracker(e));
			setErrors(1);
			throw new KettleException(e);
	
		}
	}

	return true;

}
 

开发者ID:yintaoxue,
项目名称:read-open-source-code,
代码行数:71,
代码来源:RssInput.java

示例2: processRow

点赞 2

import it.sauronsoftware.feed4j.FeedXMLParseException; //导入依赖的package包/类
public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException
{
	 Object[] outputRowData=null;

	try
	{
		 // Grab a row
		 outputRowData=getOneRow();
		 if (outputRowData==null)
	     {
	        setOutputDone();  // signal end to receiver(s)
	        return false; // end of data or error.
	     }
	}
	catch(Exception e)
	{
		if (getStepMeta().isDoingErrorHandling())
		{
        RowMeta errorMeta = new RowMeta();
        Object[] errorData = new Object[0];
        
        if(this.data.readrow != null) {
          errorMeta.addRowMeta(getInputRowMeta());
          errorData = this.data.readrow;
        }

        String errorCode = "UnknownError"; //$NON-NLS-1$
        
        // Determine error code
        if(e instanceof FeedXMLParseException) {
          if(e.getCause() instanceof DocumentException) {
            if(((DocumentException)e.getCause()).getNestedException() instanceof SAXParseException) {
              errorCode = "XMLError"; //$NON-NLS-1$
            } else if(((DocumentException)e.getCause()).getNestedException() instanceof FileNotFoundException) {
              errorCode = "FileNotFound"; //$NON-NLS-1$
            } else if(((DocumentException)e.getCause()).getNestedException() instanceof IOException) {
              if(((DocumentException)e.getCause()).getNestedException() instanceof UnknownHostException) {
                errorCode = "UnknownHost"; //$NON-NLS-1$
              } else {
                errorCode = "TransferError"; //$NON-NLS-1$
              }
            }             
          }
        } else if(e instanceof MalformedURLException) {
          errorCode = "BadURL"; //$NON-NLS-1$
        } else if (e instanceof UnsupportedFeedException) {
          errorCode = "BadRSSFormat"; //$NON-NLS-1$
        }

        putError(errorMeta, errorData, 1, e.toString(), this.data.currenturl, errorCode);
        logError(BaseMessages.getString(PKG, "RssInput.ErrorProcessing.Run",e.toString())); //$NON-NLS-1$
        
        ByteArrayOutputStream byteOS = new ByteArrayOutputStream();
        e.printStackTrace(new PrintStream(byteOS));
        logDebug(byteOS.toString());
		}
		else
		{
			logError(BaseMessages.getString(PKG, "RssInput.Exception.Run",e.toString())); //$NON-NLS-1$
			logError(Const.getStackTracker(e));
			setErrors(1);
			throw new KettleException(e);
	
		}
	}

	return true;

}
 

开发者ID:jjeb,
项目名称:kettle-trunk,
代码行数:70,
代码来源:RssInput.java

示例3: processRow

点赞 2

import it.sauronsoftware.feed4j.FeedXMLParseException; //导入依赖的package包/类
public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException {
  Object[] outputRowData = null;

  try {
    // Grab a row
    outputRowData = getOneRow();
    if ( outputRowData == null ) {
      setOutputDone(); // signal end to receiver(s)
      return false; // end of data or error.
    }
  } catch ( Exception e ) {
    if ( getStepMeta().isDoingErrorHandling() ) {
      RowMeta errorMeta = new RowMeta();
      Object[] errorData = new Object[0];

      if ( this.data.readrow != null ) {
        errorMeta.addRowMeta( getInputRowMeta() );
        errorData = this.data.readrow;
      }

      String errorCode = "UnknownError";

      // Determine error code
      if ( e instanceof FeedXMLParseException ) {
        if ( e.getCause() instanceof DocumentException ) {
          if ( ( (DocumentException) e.getCause() ).getNestedException() instanceof SAXParseException ) {
            errorCode = "XMLError";
          } else if ( ( (DocumentException) e.getCause() ).getNestedException() instanceof FileNotFoundException ) {
            errorCode = "FileNotFound";
          } else if ( ( (DocumentException) e.getCause() ).getNestedException() instanceof IOException ) {
            if ( ( (DocumentException) e.getCause() ).getNestedException() instanceof UnknownHostException ) {
              errorCode = "UnknownHost";
            } else {
              errorCode = "TransferError";
            }
          }
        }
      } else if ( e instanceof MalformedURLException ) {
        errorCode = "BadURL";
      } else if ( e instanceof UnsupportedFeedException ) {
        errorCode = "BadRSSFormat";
      }

      putError( errorMeta, errorData, 1, e.toString(), this.data.currenturl, errorCode );
      logError( BaseMessages.getString( PKG, "RssInput.ErrorProcessing.Run", e.toString() ) );

      ByteArrayOutputStream byteOS = new ByteArrayOutputStream();
      e.printStackTrace( new PrintStream( byteOS ) );
      logDebug( byteOS.toString() );
    } else {
      logError( BaseMessages.getString( PKG, "RssInput.Exception.Run", e.toString() ) );
      logError( Const.getStackTracker( e ) );
      setErrors( 1 );
      throw new KettleException( e );

    }
  }

  return true;

}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:62,
代码来源:RssInput.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)