Coverage Report - org.seasar.cubby.action.FieldInfo
 
Classes in this File Line Coverage Branch Coverage Complexity
FieldInfo
100%
8/8
N/A
1
 
 1  
 /*
 2  
  * Copyright 2004-2008 the Seasar Foundation and the Others.
 3  
  *
 4  
  * Licensed under the Apache License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  *     http://www.apache.org/licenses/LICENSE-2.0
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 13  
  * either express or implied. See the License for the specific language
 14  
  * governing permissions and limitations under the License.
 15  
  */
 16  
 package org.seasar.cubby.action;
 17  
 
 18  
 /**
 19  
  * HTMLフォームにおけるフィールドの情報です。
 20  
  * 
 21  
  * @author baba
 22  
  * @since 1.0.0
 23  
  */
 24  
 public class FieldInfo {
 25  
 
 26  
         /** フィールド名。 */
 27  
         private final String name;
 28  
 
 29  
         /** インデックス。 */
 30  
         private final Integer index;
 31  
 
 32  
         /**
 33  
          * 指定されたフィールド名のフィールドの情報をインスタンス化します。
 34  
          * 
 35  
          * @param name
 36  
          *            フィールド名
 37  
          */
 38  
         public FieldInfo(final String name) {
 39  7
                 this(name, null);
 40  7
         }
 41  
 
 42  
         /**
 43  
          * 指定されたフィールド名とインデックスのフィールドの情報をインスタンス化します。
 44  
          * 
 45  
          * @param name
 46  
          *            フィールド名
 47  
          * @param index
 48  
          *            インデックス
 49  
          */
 50  18
         public FieldInfo(final String name, final Integer index) {
 51  18
                 this.name = name;
 52  18
                 this.index = index;
 53  18
         }
 54  
 
 55  
         /**
 56  
          * フィールド名を取得します。
 57  
          * 
 58  
          * @return フィールド名
 59  
          */
 60  
         public String getName() {
 61  10
                 return name;
 62  
         }
 63  
 
 64  
         /**
 65  
          * インデックスを取得します。
 66  
          * <p>
 67  
          * コンストラクタでインデックスを指定しなかった場合は <code>null</code> を返します。
 68  
          * </p>
 69  
          * 
 70  
          * @return インデックス
 71  
          */
 72  
         public Integer getIndex() {
 73  10
                 return index;
 74  
         }
 75  
 
 76  
 }