setDocumentメソッド
このメソッドは、ルール・ファイルを格納するために使用します。このメソッドは、文字列のdoc
値を返します。この値は、ルール・ディクショナリ・エディタのタスク・フローを使用して実行されたユーザーの編集を基に更新されたディクショナリの名前です。ルール・ファイルはMDSまたはファイル・システムに格納する必要があります。次のコード・サンプルに、ローカル・ファイル・システムにドキュメントを保存する方法を示します。
public void setDocument(String string) { URL url = null; try { url = new URL(RULES_FILE1); } catch (MalformedURLException e) { System.err.println(e); return; } Writer writer = null; try { //os = new FileWriter(url.getPath()); writer = new OutputStreamWriter(new FileOutputStream(url.getPath()), "UTF-8"); } catch (FileNotFoundException e) { System.err.println(e); return; } catch (IOException e) { System.err.println(e); return; } try { writer.write(string); } catch (IOException e) { System.err.println(e); } finally { if (writer != null) { try { writer.close(); } catch (IOException ioe) { System.err.println(ioe); } } } }