カスタム Java™ 変換を使用した単純タイプではない入力および出力のマッピングに対して、Java MbElement クラスを使用できます。
1 つの非反復エレメント入力を 1 つの非反復エレメント出力にマップするには、以下の署名の Java メソッドを使用します。
public static MbElement mbElMove(MbElement inEl) {
For example a Java method that simply copies a sub tree:
public static MbElement mbElMove(MbElement inEl) {
MbElement outEl = null;
try {
outEl = inEl.copy();
outEl.copyElementTree(inEl);
} catch (MbException e) {
throw (new RuntimeException(e));
}
return outEl;
}
1 つの反復エレメント入力を出力反復エレメントにマップするには、以下の署名の Java メソッドを使用します。
public static List<MbElement>; customCompleTypeMove(List<MbElement>; inEls)
public static List<MbElement> customCompleTypeMove(List<MbElement> inEls)
{
List<MbElement> outEls = new ArrayList<MbElement>();
try {
Iterator<MbElement> i = inEls.iterator();
while (i.hasNext()) {
MbElement inEl = i.next();
MbElement outEl = inEl.copy();
// Do some processing of outEl
outEls.add(outEl);
}
} catch (MbException e) {
throw (new RuntimeException(e));
}
return outEls;
}