uCosminexus Interschema ユーザーズガイド
Java言語の出口関数で実行時のコンテキストを判断するために,Translator.execメソッド呼び出し時に指定したObjectクラスのインスタンスを,Java言語の出口関数に渡すことができます。
Java言語の出口関数へのオブジェクトを渡す場合の記述例を次に示します。
/* ユーザーが定義した任意のオブジェクト */ String usrObj = new String(“Hello.”); try{ Translator trans = new Translator(); MDLInfo mdlinfo = new MDLInfo(“Sample.mdl”); ・・・ trans.exec(mdlinfo, sources, dests, usrObj); /* このデータ変換で呼び出された */ /* 出口関数にusrObjが渡されます */ }catch(TranslatorException e){ }
Java言語の出口関数でオブジェクトを利用する場合の記述例を次に示します。
・・・ public class UFunc { public static String printHello throws ExitFuncException (Object obj){ if ( obj == null ) throw new ExitFuncException(-1); System.out.println((String)obj); return (String)obj; } }
All Rights Reserved, Copyright (C) 2000, Information-technology Promotion Agency, Japan.
All Rights Reserved. Copyright (C) 2005, 2008, Hitachi, Ltd.
All Rights Reserved, Copyright (C) 1985-1998, Microsoft Corporation.