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 */
016package org.opengion.hayabusa.html;
017
018import org.opengion.hayabusa.db.DBTableModel;
019import org.opengion.hayabusa.resource.ResourceManager;
020
021
022
023/**
024 * JSONをテーブルモデルに変換するJsonReader_xxxのインタフェイスです。
025 *
026 *
027 * @og.group 画面表示
028 * @og.rev 5.9.21.0 (2017/06/02) 新規作成
029 *
030 * @version  4.0
031 * @author       Takahashi Masakazu
032 * @since    JDK5.0,
033 */
034public interface JsonReader {
035        
036        /**
037         * JSON文字列からDBTableModelを作成します。
038         *
039         *
040         * @param   json JSON文字列
041         */
042        void readDBTable( final String json ) ;
043        
044        /**
045         * リソースマネージャーをセットします。
046         * これは、言語(ロケール)に応じた DBColumn をあらかじめ設定しておく為に
047         * 必要です。
048         * リソースマネージャーが設定されていない、または、所定のキーの DBColumn が
049         * リソースに存在しない場合は、内部で DBColumn オブジェクトを作成します。
050         *
051         *
052         * @param  resource リソースマネージャー
053         */
054        void setResourceManager( final ResourceManager resource ) ;
055        
056        /**
057         * 内部の DBTableModel を返します。
058         *
059         * @return      テーブルモデル
060         */
061         DBTableModel getDBTableModel();
062        
063        /**
064         * DBTableModelのデータとして登録する最大件数をこの値に設定します。
065         * サーバーのメモリ資源と応答時間の確保の為です。
066         *
067         * @return  最大検索件数
068         */
069        int getMaxRowCount() ;
070
071        /**
072         * DBTableModelのデータとして登録する最大件数をこの値に設定します。
073         * サーバーのメモリ資源と応答時間の確保の為です。
074         *
075         * @param   maxRowCount 最大検索件数
076         */
077        void setMaxRowCount( final int maxRowCount ) ;
078        
079        /**
080         * データの読み飛ばし件数を設定します。
081         *
082         * JSON形式の場合、通常は読み飛ばし不要です。
083         *
084         *
085         * @param       count 読み始めの初期値
086         */
087        void setSkipRowCount( final int count ) ;
088
089        /**
090         * 読取処理でラベルをコードリソースに逆変換を行うかどうかを指定します。
091         *
092         * 
093         * ここでは、コードリソースのカラムに対して、ラベルからコードを求める逆変換を行うことで、
094         * Renderer 系で出力したデータを取り込むことができるようにします。
095         * 通常は利用しません。
096         *
097         *
098         * @param       useRenderer     コードリソースのラベル逆変換を行うかどうかを指定
099         */
100        void setUseRenderer( final boolean useRenderer ) ;
101        
102        /**
103         * デバッグ情報を出力するかどうかを指定します。
104         *
105         * 
106         * 初期値は、false:デバッグ情報を出力しない です。
107         *
108         *
109         * @param       useDebug        デバッグ情報を出力するかどうかを指定
110         */
111        void setDebug( final boolean useDebug ) ;
112        
113        /**
114         * 文字列をオプションで渡せるようにしておきます。
115         * 
116         * @param strings オプション文字列
117         * 
118         */
119        void setOptions( final String... strings ) ;
120}