Search in sources :

Example 11 with JournalEditor

use of jp.ossc.nimbus.service.journal.JournalEditor in project nimbus by nimbus-org.

the class ServletRequestCSVJournalEditorService method processCSV.

protected void processCSV(EditorFinder finder, Object key, Object value) {
    for (int i = 0; i < outputElementKeys.length; i++) {
        final JournalEditor editor = findElementEditor(outputElementKeys[i]);
        addElement(editor.toObject(finder, key, value));
    }
}
Also used : JournalEditor(jp.ossc.nimbus.service.journal.JournalEditor)

Example 12 with JournalEditor

use of jp.ossc.nimbus.service.journal.JournalEditor in project nimbus by nimbus-org.

the class ObjectMappedEditorFinderService method findEditor.

public JournalEditor findEditor(Object key, Class paramClass) {
    Map keyEditorMap = (Map) mEditorRepository.getValue(paramClass);
    if (keyEditorMap == null) {
        return mParentFinder != null ? mParentFinder.findEditor(key, paramClass) : null;
    }
    JournalEditor ret = (JournalEditor) keyEditorMap.get(key);
    if (ret == null && key != null) {
        ret = (JournalEditor) keyEditorMap.get(null);
    }
    if (ret == null && mParentFinder != null) {
        ret = mParentFinder.findEditor(key, paramClass);
    }
    return ret;
}
Also used : JournalEditor(jp.ossc.nimbus.service.journal.JournalEditor) Map(java.util.Map) HashMap(java.util.HashMap)

Example 13 with JournalEditor

use of jp.ossc.nimbus.service.journal.JournalEditor in project nimbus by nimbus-org.

the class TraceService method getParameterStrings.

// 表示用ヘルパ関数
/**
 * Object→String変換を行う。<p>
 * このメソッドには、以下の実装が行われている。<br>
 * <ol>
 *   <li>対応するエディタを取得する</li>
 *   <li>呼び出し元の関数とライン番号を取得する</li>
 * </ol>
 */
private String getParameterStrings(Object[] params) {
    final StringBuilder buff = new StringBuilder();
    if (params == null) {
        buff.append(params);
        return buff.toString();
    }
    for (int i = 0; i < params.length; i++) {
        Object param = params[i];
        if (param != null) {
            // 対応するエディタを取得して文字列に変換する
            final JournalEditor editor = mEditorFinderService.findEditor(param.getClass());
            String str = (String) editor.toObject(mEditorFinderService, null, param);
            // @変換に引っかからないように$に変換する
            if (str != null)
                str.replace('@', ATMARK_REPLACE_CHAR);
            buff.append(str);
            if (i != params.length - 1)
                buff.append(separator);
        } else {
            buff.append(param);
        }
        if (i != params.length - 1)
            buff.append(separator);
    }
    return buff.toString();
}
Also used : JournalEditor(jp.ossc.nimbus.service.journal.JournalEditor)

Aggregations

JournalEditor (jp.ossc.nimbus.service.journal.JournalEditor)13 HashMap (java.util.HashMap)2 Map (java.util.Map)2 Iterator (java.util.Iterator)1 ServiceNameEditor (jp.ossc.nimbus.beans.ServiceNameEditor)1 ServiceName (jp.ossc.nimbus.core.ServiceName)1 JournalRecord (jp.ossc.nimbus.service.journal.JournalRecord)1 RequestJournal (jp.ossc.nimbus.service.journal.RequestJournal)1