001 /*
002 * Copyright (c) 2009 The openGion Project.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
013 * either express or implied. See the License for the specific language
014 * governing permissions and limitations under the License.
015 */
016 package org.opengion.fukurou.xml;
017
018 /**
019 * こã?クラスは、HybsXMLHandler に設定すã‚?Listener インターフェースですã?
020 * これは、HybsXMLHandler#setTagElementListener( TagElementListener ) することでã€?
021 * ROW 毎に å†?ƒ¨æƒ??ã‚?TagElement オブジェクト化しã?action( TagElement )
022 * が呼び出されますã?こã? Listener を介してã€?¼‘レコードずつ処ç�?�™ることã�?
023 * 可能ですã?
024 *
025 * こã? Listener ã‚?implements したクラスをå?別に作æ?することでã€?
026 * XML処ç�?‚’、ã?ラグイン可能にしますã?
027 *
028 * @version 4.0
029 * @author Kazuhiko Hasegawa
030 * @since JDK5.0,
031 */
032 public interface TagElementListener {
033
034 /**
035 * <ROWSET> タグのä¸?•ªæœ??に呼び出されますã?
036 * ROWSET の属æ?である、table 属æ?と、dbid 属æ? をã?TagElement の
037 * get メソãƒ?ƒ‰で取得できますã?
038 * 取得時のキーは、それぞれã?"TABLE" と "DBID" ですã?
039 *
040 * @param tag タグエレメンãƒ?
041 * @see org.opengion.fukurou.xml.TagElement
042 * @see HybsXMLHandler#setTagElementListener( TagElementListener )
043 */
044 void actionInit( TagElement tag ) ;
045
046 /**
047 * <ROW> タグの endElement 処ç�?¯Žに呼び出されますã?
048 * こã? Listener をセãƒ?ƒˆすることにより、行データを取得é?度ã€?
049 * TagElement オブジェクトを作æ?しã?こã?メソãƒ?ƒ‰が呼び出されますã?
050 *
051 * @param tag タグエレメンãƒ?
052 * @see org.opengion.fukurou.xml.TagElement
053 * @see HybsXMLHandler#setTagElementListener( TagElementListener )
054 */
055 void actionRow( TagElement tag ) ;
056
057 /**
058 * <EXEC_SQL> タグの endElement 処ç�?¯Žに呼び出されますã?
059 * getBody メソãƒ?ƒ‰を使用して、このタグのBODY部のæ–?—å?を取得しますã?
060 * こã? Listener をセãƒ?ƒˆすることにより、EXEC_SQL ãƒ??タを取得é?度ã€?
061 * TagElement オブジェクトを作æ?しã?こã?メソãƒ?ƒ‰が呼び出されますã?
062 *
063 * @param tag タグエレメンãƒ?
064 * @see org.opengion.fukurou.xml.TagElement
065 * @see HybsXMLHandler#setTagElementListener( TagElementListener )
066 */
067 void actionExecSQL( TagElement tag ) ;
068
069 /**
070 * <MERGE_SQL> タグの endElement 処ç�?™‚に呼び出されますã?
071 * getBody メソãƒ?ƒ‰を使用して、このタグのBODY部のæ–?—å?を取得しますã?
072 * MERGE_SQLタグは、ã?ージ処ç�?�—たいãƒ??タ部よりも上位に記述しておく
073 * å¿?¦�がありますが、中間部に記述しても構いません。たã�?�—ã€?¼‘回のみですã?
074 * こã?タグが現れるまでは、INSERT のみ実行されますã?こã?タグ以降ã?ã€?
075 * ä¸?—¦ UPDATE しã?結果ã�??�件の場合ã?、INSERTする流れになりますã?
076 * 完å?に INSERT のみであるãƒ??タを前半に、UPDATE/INSERTを行う
077 * ãƒ??タを後半に、その間に、MERGE_SQL タグをå?れることで、無意味な
078 * UPDATE を避けることが可能ですã?
079 * こã? Listener をセãƒ?ƒˆすることにより、MERGE_SQL ãƒ??タを取得é?度ã€?
080 * TagElement オブジェクトを作æ?しã?こã?メソãƒ?ƒ‰が呼び出されますã?
081 *
082 * @param tag タグエレメンãƒ?
083 * @see org.opengion.fukurou.xml.TagElement
084 * @see HybsXMLHandler#setTagElementListener( TagElementListener )
085 */
086 void actionMergeSQL( TagElement tag ) ;
087 }