AttributeField.java

  1. /*
  2.  * Copyright (c) 2002-2022, City of Paris
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  *
  9.  *  1. Redistributions of source code must retain the above copyright notice
  10.  *     and the following disclaimer.
  11.  *
  12.  *  2. Redistributions in binary form must reproduce the above copyright notice
  13.  *     and the following disclaimer in the documentation and/or other materials
  14.  *     provided with the distribution.
  15.  *
  16.  *  3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
  17.  *     contributors may be used to endorse or promote products derived from
  18.  *     this software without specific prior written permission.
  19.  *
  20.  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  21.  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  22.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  23.  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
  24.  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  25.  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  26.  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  27.  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  28.  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  29.  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  30.  * POSSIBILITY OF SUCH DAMAGE.
  31.  *
  32.  * License 1.0
  33.  */
  34. package fr.paris.lutece.portal.business.user.attribute;

  35. /**
  36.  *
  37.  * AttributeField
  38.  *
  39.  */
  40. public class AttributeField
  41. {
  42.     private int _nIdField;
  43.     private IAttribute _attribute;
  44.     private String _strTitle;
  45.     private String _strValue;
  46.     private boolean _bDefaultValue;
  47.     private int _nPosition;
  48.     private int _nHeight;
  49.     private int _nWidth;
  50.     private int _nMaxSizeEnter;
  51.     private boolean _bMultiple;

  52.     /**
  53.      * Set ID field
  54.      *
  55.      * @param nIdField
  56.      *            ID Field
  57.      */
  58.     public void setIdField( int nIdField )
  59.     {
  60.         _nIdField = nIdField;
  61.     }

  62.     /**
  63.      * Get ID Field
  64.      *
  65.      * @return ID Field
  66.      */
  67.     public int getIdField( )
  68.     {
  69.         return _nIdField;
  70.     }

  71.     /**
  72.      * Set attribute
  73.      *
  74.      * @param attribute
  75.      *            attribute
  76.      */
  77.     public void setAttribute( IAttribute attribute )
  78.     {
  79.         _attribute = attribute;
  80.     }

  81.     /**
  82.      * Get attribute
  83.      *
  84.      * @return attribute
  85.      */
  86.     public IAttribute getAttribute( )
  87.     {
  88.         return _attribute;
  89.     }

  90.     /**
  91.      *
  92.      * @return the title of the field
  93.      */
  94.     public String getTitle( )
  95.     {
  96.         return _strTitle;
  97.     }

  98.     /**
  99.      * set the title of the field
  100.      *
  101.      * @param title
  102.      *            the title of the field
  103.      */
  104.     public void setTitle( String title )
  105.     {
  106.         _strTitle = title;
  107.     }

  108.     /**
  109.      *
  110.      * @return the value of the field
  111.      */
  112.     public String getValue( )
  113.     {
  114.         return _strValue;
  115.     }

  116.     /**
  117.      * set the value of the field
  118.      *
  119.      * @param value
  120.      *            the value of the field
  121.      */
  122.     public void setValue( String value )
  123.     {
  124.         _strValue = value;
  125.     }

  126.     /**
  127.      *
  128.      * @return true if the field is a default field of the entry
  129.      */
  130.     public boolean isDefaultValue( )
  131.     {
  132.         return _bDefaultValue;
  133.     }

  134.     /**
  135.      * set true if the field is a default field of the entry
  136.      *
  137.      * @param defaultValue
  138.      *            true if the field is a default field of the entry
  139.      */
  140.     public void setDefaultValue( boolean defaultValue )
  141.     {
  142.         _bDefaultValue = defaultValue;
  143.     }

  144.     /**
  145.      *
  146.      * @return the position of the field in the list of the entry's fields
  147.      */
  148.     public int getPosition( )
  149.     {
  150.         return _nPosition;
  151.     }

  152.     /**
  153.      * set the position of the field in the list of the entry's fields
  154.      *
  155.      * @param position
  156.      *            the position of the field in the list of fields
  157.      */
  158.     public void setPosition( int position )
  159.     {
  160.         _nPosition = position;
  161.     }

  162.     /**
  163.      * Get height
  164.      *
  165.      * @return height
  166.      */
  167.     public int getHeight( )
  168.     {
  169.         return _nHeight;
  170.     }

  171.     /**
  172.      * Set height
  173.      *
  174.      * @param nHeight
  175.      *            Height
  176.      */
  177.     public void setHeight( int nHeight )
  178.     {
  179.         _nHeight = nHeight;
  180.     }

  181.     /**
  182.      * Get width
  183.      *
  184.      * @return width
  185.      */
  186.     public int getWidth( )
  187.     {
  188.         return _nWidth;
  189.     }

  190.     /**
  191.      * Set width
  192.      *
  193.      * @param nWidth
  194.      *            width
  195.      */
  196.     public void setWidth( int nWidth )
  197.     {
  198.         _nWidth = nWidth;
  199.     }

  200.     /**
  201.      * Get max size enter
  202.      *
  203.      * @return max size enter
  204.      */
  205.     public int getMaxSizeEnter( )
  206.     {
  207.         return _nMaxSizeEnter;
  208.     }

  209.     /**
  210.      * Set max size enter
  211.      *
  212.      * @param nMaxSizeEnter
  213.      *            max size enter
  214.      */
  215.     public void setMaxSizeEnter( int nMaxSizeEnter )
  216.     {
  217.         _nMaxSizeEnter = nMaxSizeEnter;
  218.     }

  219.     /**
  220.      * Check if the attribute is multiple
  221.      *
  222.      * @return true if it is multiple, false otherwise
  223.      */
  224.     public boolean isMultiple( )
  225.     {
  226.         return _bMultiple;
  227.     }

  228.     /**
  229.      * Set the multiple
  230.      *
  231.      * @param bMultiple
  232.      *            mutiple
  233.      */
  234.     public void setMultiple( boolean bMultiple )
  235.     {
  236.         _bMultiple = bMultiple;
  237.     }
  238. }