use of jp.ossc.nimbus.service.journal.JournalEditor in project nimbus by nimbus-org.
the class ObjectMappedEditorFinderService method startService.
/* (非 Javadoc)
* @see jp.ossc.nimbus.core.ServiceBaseSupport#startService()
*/
public void startService() throws Exception {
// 上位リポジトリの取得
if (mFinderServiceName != null) {
this.mParentFinder = (EditorFinder) ServiceManagerFactory.getServiceObject(this.mFinderServiceName);
}
ServiceNameEditor editor = new ServiceNameEditor();
editor.setServiceManagerName(getServiceManagerName());
// 自分が管理するエディターサービスの設定
Iterator iterator = mEditorMap.keySet().iterator();
while (iterator.hasNext()) {
String classAndKey = (String) iterator.next();
String key = null;
String clsName = null;
final int index = classAndKey.indexOf(',');
if (index == -1) {
clsName = classAndKey;
} else {
clsName = classAndKey.substring(0, index);
if (index != classAndKey.length() - 1) {
key = classAndKey.substring(index + 1);
}
}
Class cls = convertStringToClass(clsName);
JournalEditor journalEditor = null;
Object value = mEditorMap.get(classAndKey);
if (value instanceof String) {
String serviceName = (String) value;
editor.setAsText(serviceName);
ServiceName name = (ServiceName) editor.getValue();
journalEditor = (JournalEditor) ServiceManagerFactory.getServiceObject(name);
} else if (value instanceof JournalEditor) {
journalEditor = (JournalEditor) value;
}
Map keyEditorMap = (Map) mEditorRepository.getValueOf(cls);
if (keyEditorMap == null) {
keyEditorMap = new HashMap();
mEditorRepository.add(cls, keyEditorMap);
}
keyEditorMap.put(key, journalEditor);
}
}
use of jp.ossc.nimbus.service.journal.JournalEditor in project nimbus by nimbus-org.
the class DebugService method getParameterString.
/**
* Object→String変換を行う。<p>
* このメソッドには、以下の実装が行われている。<br>
* <ol>
* <li>対応するエディタを取得する</li>
* <li>エディタを使用してStringに変換する</li>
* </ol>
*/
private String getParameterString(Object param) {
if (param != null) {
// 対応するエディタを取得して文字列に変換する
final JournalEditor editor = mEditorFinder.findEditor(param.getClass());
final String str = (String) editor.toObject(mEditorFinder, null, param);
// @変換に引っかからないように$に変換する
if (str != null)
str.replace('@', ATMARK_REPLACE_CHAR);
return str;
} else {
return "null";
}
}
use of jp.ossc.nimbus.service.journal.JournalEditor in project nimbus by nimbus-org.
the class JSONJournalEditorService method appendUnknownValue.
protected StringBuilder appendUnknownValue(StringBuilder buf, EditorFinder finder, Class type, Object value) {
JournalEditor editor = finder.findEditor(value);
if (editor != null && editor != this) {
value = editor.toObject(finder, null, value);
if (editor instanceof JSONJournalEditorService) {
buf.append(value.toString());
} else {
buf.append(STRING_ENCLOSURE);
buf.append(escape(value.toString()));
buf.append(STRING_ENCLOSURE);
}
} else {
buf.append(STRING_ENCLOSURE);
buf.append(escape(value.toString()));
buf.append(STRING_ENCLOSURE);
}
return buf;
}
use of jp.ossc.nimbus.service.journal.JournalEditor in project nimbus by nimbus-org.
the class DynaPropertyCSVJournalEditorService 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));
}
}
use of jp.ossc.nimbus.service.journal.JournalEditor in project nimbus by nimbus-org.
the class ServletResponseCSVJournalEditorService 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));
}
}
Aggregations