jp.ne.mki.wedge.rule.common.file
クラス WriteCsvFileFromItem

java.lang.Object
  上位を拡張 jp.ne.mki.wedge.rule.base.AbstractBase
      上位を拡張 jp.ne.mki.wedge.rule.base.AbstractCommon
          上位を拡張 jp.ne.mki.wedge.rule.common.file.WriteCsvFileFromItem
すべての実装されたインタフェース:
CommonInterface, RuleEngineInterface
直系の既知のサブクラス:
AddCsvFileFromItem

public class WriteCsvFileFromItem
extends AbstractCommon

入力レコードで渡されたアイテムを指定されたファイルに出力


アイテムに書かれているデータを、ファイルに保存します。

エンコード、改行文字列は ロジッククラスパラメータで設定をします。
また、パラメータに設定せず Constants.wdgにて記述をすることも可能です。
その時の指定は

の形式となります。
パラメータにも改行文字にも指定されていない場合は、OSの文字コードと 改行文字LFが使用されます。

対象データが存在しなかった場合、USER_ERRORを設定


[I/O RECORD]

InputRecord OutputRecord
  1. 出力ファイル名(TEXT)
  2. 出力するデータを保持するアイテム(TEXT or COLTEXT)

[RULE PARAMETER]

Parameter
  • 処理区分 : -ow(上書き)
  • ファイルの文字コード : -encoding [文字コード]
  • 改行文字列 : -lineseparator [改行コード]
    (改行コードに設定できる文字列:CR or LF or CRLF or DEFAULT DEFAULTは デフォルトエンコードを使用する。)
  • ダブルクォート : -dq [true or false or need] (trueは常にダブルクォートをつけて出力をする。 needは必要であればダブルクォートをつけて出力をする。 デフォルトはfalse。)

バージョン:
1.0

フィールドの概要
protected static java.lang.String CONSTANT_ENCODING
          エンコード(定数ファイルキー)
protected static java.lang.String CONSTANT_LINE_SEPARATOR
          改行文字(f定数ファイルキー)
protected static java.lang.String DQ_MODE
          ダブルクォート変換
protected  java.lang.String dqMode
           
protected static java.lang.String ENCODING
          エンコード文字(パラメータ)
protected  int inCount
           
protected  DataInterface[] inData
          CSVデータ
protected static java.lang.String LINE_SEPARATOR
          改行文字(パラメータ)
protected  DataInterface outFileName
          ファイル名
protected static java.lang.String OVERWRITE
          上書き指示(パラメータ)
protected static java.lang.String SEPARATOR
           
 
クラス jp.ne.mki.wedge.rule.base.AbstractBase から継承されたフィールド
controlRecord, engineManager, errorMessage, executeType, id, inputRecord, logicalName, logicClassDelegate, outputRecord, physicalName, ruleParameter, ruleType, serverParameter, userConstant
 
インタフェース jp.ne.mki.wedge.rule.base.interfaces.CommonInterface から継承されたフィールド
CANCEL, ERROR, EXECUTE_BOTH, EXECUTE_CLIENT, EXECUTE_DEBUG, EXECUTE_HTMLGATEWAY, EXECUTE_SERVER, EXECUTE_SERVERDC, IO_ERROR, IO_ERROR_EXECUTE_PARAMETER, IO_ERROR_IN, IO_ERROR_IO_MUST_SAME_COUNT, IO_ERROR_ITEM_TYPE, IO_ERROR_OUT, IO_ERROR_PARAMETER, NONE, OK, PARAMETER_DELIMITER, SKIP, USER_ERROR
 
コンストラクタの概要
WriteCsvFileFromItem()
           
 
メソッドの概要
 java.lang.String convertLineSeparator(java.lang.String param)
           
 java.lang.String doubleQuoteConvert(java.lang.String _value)
           
 int execute()
          処理を実行します。
 void exit()
          終了処理。
 boolean fileCheck(java.io.File file, boolean isOverWrite)
           
 int getIOParameter()
          IOパラメータ取得。
 boolean isAppend()
           
 
クラス jp.ne.mki.wedge.rule.base.AbstractCommon から継承されたメソッド
getLogicClassType, getManager, terminate
 
クラス jp.ne.mki.wedge.rule.base.AbstractBase から継承されたメソッド
callDispose, checkDelegate, createErrorMessage, createLogicErrorLogRecord, createLogicExceptionLogRecord, createLogicLogRecord, dataClearOfOutRecord, dataClearOfRecord, dispose, executeRule, getAppAccount, getAppAuthority, getAppMenu, getAppPassword, getClassErrorName, getClientId, getConnectionId, getConnectionPoolId, getConstantKeys, getConstantValue, getConstantValueAsStringArray, getControlRecord, getDbAccessCount, getDbErrorCode, getDbErrorMessage, getDbStatus, getDbUpdatedRecordCount, getEngineManager, getErrorMessage, getErrorMessage, getErrorMessage, getExceptionMessage, getExecuteType, getId, getInputRecordIterator, getInRecord, getInRecord, getInRecord, getInRecordCount, getInRecordList, getIpAddress_G_Index, getIpAddress_P_Index, getLogicalErrorName, getLogicalName, getLogicClassDelegate, getOutputHtml, getOutputRecordIterator, getOutRecord, getOutRecord, getOutRecord, getOutRecordCount, getOutRecordList, getPhysicalErrorName, getPhysicalName, getProjectId, getQueryEndLine, getQueryMaxCount, getQueryPageCount, getQueryStartLine, getReturnString, getRowSize, getRowSizeOfInRecord, getRuleParameter, getRuleParameters, getRuleParameters, getRuleParameters, getRuleType, getRuleTypeName, getServerMessage, getServerParameter, getServerStatus, getServerSubName, getServerSubRevision, getServerTran, getUpdateErrorLine, getUpdateTargetCount, getWebServerIpAddress, isExecutable, isJDK15, log, logDebug, logError, logError, logFatal, logFatal, logInfo, logTrace, logWarn, logWarn, loopInOutRecord, loopInOutRecordSub, loopInRecord, loopInRecordSub, loopOutRecord, loopOutRecordSub, setControlRecord, setEngineManager, setErrorMessage, setErrorMessageMustInRecord, setErrorMessageMustOutRecord, setErrorMessageMustParamIsNumber, setExecuteType, setFatalError, setId, setInRecord, setLogicalName, setLogicClassDelegate, setOutputHtml, setOutRecord, setPhysicalName, setPropertyFromEngine, setRuleParameter, setRuleType, setServerParameter, setUserConstant, showErrorDialog, showErrorDialogAddRuleName, writeErrorLog, writeErrorLog, writeLog, writeLog, writeLog, writeTraceLog
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

OVERWRITE

protected static final java.lang.String OVERWRITE
上書き指示(パラメータ)

関連項目:
定数フィールド値

ENCODING

protected static final java.lang.String ENCODING
エンコード文字(パラメータ)

関連項目:
定数フィールド値

LINE_SEPARATOR

protected static final java.lang.String LINE_SEPARATOR
改行文字(パラメータ)

関連項目:
定数フィールド値

DQ_MODE

protected static final java.lang.String DQ_MODE
ダブルクォート変換

関連項目:
定数フィールド値

CONSTANT_ENCODING

protected static final java.lang.String CONSTANT_ENCODING
エンコード(定数ファイルキー)

関連項目:
定数フィールド値

CONSTANT_LINE_SEPARATOR

protected static final java.lang.String CONSTANT_LINE_SEPARATOR
改行文字(f定数ファイルキー)

関連項目:
定数フィールド値

SEPARATOR

protected static final java.lang.String SEPARATOR
関連項目:
定数フィールド値

inCount

protected int inCount

outFileName

protected DataInterface outFileName
ファイル名


inData

protected DataInterface[] inData
CSVデータ


dqMode

protected java.lang.String dqMode
コンストラクタの詳細

WriteCsvFileFromItem

public WriteCsvFileFromItem()
メソッドの詳細

execute

public int execute()
処理を実行します。

戻り値:
int BusinessRuleの戻り値を参照

fileCheck

public boolean fileCheck(java.io.File file,
                         boolean isOverWrite)

isAppend

public boolean isAppend()

convertLineSeparator

public java.lang.String convertLineSeparator(java.lang.String param)

doubleQuoteConvert

public java.lang.String doubleQuoteConvert(java.lang.String _value)

getIOParameter

public int getIOParameter()
IOパラメータ取得。execute の前に実行される。

戻り値:
int OK=処理続行、ERROR=異常終了、CANCEL=処理を中断(正常終了)

exit

public void exit()
終了処理。保持していた変数などを開放する処理を記述します。
execute の後に実行されます。
正常終了・異常終了などに関わらず必ず実行されます。