Class ListOfValues

  • All Implemented Interfaces:
    java.io.Serializable

    public class ListOfValues
    extends java.lang.Object
    implements java.io.Serializable
    List of values
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ListOfValues​(Grant g)
      Constructor for loading all standard lists of values
      ListOfValues​(Grant g, java.lang.String name)
      Constructor for loading a standard list of values
      ListOfValues​(Grant g, java.lang.String name, java.lang.String datasource, java.lang.String sql)
      Constructor for loading a custom single list of values from a SQL statement
    • Method Summary

      Modifier and Type Method Description
      java.lang.String getCode​(java.lang.String name, java.lang.String value, java.lang.String lang)
      Get a code of a value of a list
      java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getCodes()
      Codes
      java.util.List<java.lang.String> getCodes​(java.lang.String name)
      Get all codes of a list
      java.lang.String[] getCodesArray​(java.lang.String name)
      Get all codes of a list as array
      ListOfValuesData getData()  
      java.lang.String getDefaultLabel​(java.lang.String name)
      Get default label
      java.util.Map<java.lang.String,​java.lang.String> getDefaultLabels()
      Default Labels
      java.util.Map<java.lang.String,​ObjectFieldList.ListLink> getLinkedLists​(ObjectDB obj, ObjectFieldList flist)
      Load linked lists of one object field
      java.util.List<java.lang.String> getLists()
      List of lists
      java.lang.String getValue​(java.lang.String name, java.lang.String code)
      Get the code value
      java.util.Map<java.lang.String,​java.lang.String> getValues()
      Values in a language
      java.util.List<java.lang.String> getValues​(java.lang.String name)
      Get all values of a list
      java.lang.String[] getValuesArray​(java.lang.String name)
      Get all values of a list as array
      int size​(java.lang.String name)
      Get a list size
      java.lang.String toHTML​(java.lang.String lov)
      Publish specified list of values to raw HTML
      void toHTML​(java.lang.String lov, java.io.PrintWriter out)
      Publish specified list of values to raw HTML on specified print writer
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ListOfValues

        public ListOfValues​(Grant g)
        Constructor for loading all standard lists of values
        Parameters:
        g - Grant
      • ListOfValues

        public ListOfValues​(Grant g,
                            java.lang.String name)
        Constructor for loading a standard list of values
        Parameters:
        g - Grant
        name - Name of list, if null then load all lists of values
      • ListOfValues

        public ListOfValues​(Grant g,
                            java.lang.String name,
                            java.lang.String datasource,
                            java.lang.String sql)
        Constructor for loading a custom single list of values from a SQL statement
        Parameters:
        name - Name of list
        datasource - Data source name (null for default data source)
        sql - SQL statement to load a list (the statement must return ordered couples of codes and values)
    • Method Detail

      • getLists

        public java.util.List<java.lang.String> getLists()
        List of lists
      • getCodes

        public java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getCodes()
        Codes
      • getValues

        public java.util.Map<java.lang.String,​java.lang.String> getValues()
        Values in a language
      • getDefaultLabels

        public java.util.Map<java.lang.String,​java.lang.String> getDefaultLabels()
        Default Labels
      • getValue

        public java.lang.String getValue​(java.lang.String name,
                                         java.lang.String code)
        Get the code value
        Parameters:
        name - List name
        code - Code
        Returns:
        value
      • size

        public int size​(java.lang.String name)
        Get a list size
        Parameters:
        name - List name
        Returns:
        size
      • getCodes

        public java.util.List<java.lang.String> getCodes​(java.lang.String name)
        Get all codes of a list
        Parameters:
        name - List name
        Returns:
        Ordered codes
      • getDefaultLabel

        public java.lang.String getDefaultLabel​(java.lang.String name)
        Get default label
        Parameters:
        name - List name
        Returns:
        Default label of the list
      • getCodesArray

        public java.lang.String[] getCodesArray​(java.lang.String name)
        Get all codes of a list as array
        Parameters:
        name - List name
        Returns:
        Ordered codes
      • getCode

        public java.lang.String getCode​(java.lang.String name,
                                        java.lang.String value,
                                        java.lang.String lang)
        Get a code of a value of a list
      • getLinkedLists

        public java.util.Map<java.lang.String,​ObjectFieldList.ListLink> getLinkedLists​(ObjectDB obj,
                                                                                             ObjectFieldList flist)
        Load linked lists of one object field
        Parameters:
        obj - Object
        flist - Field list
        Returns:
        Linked fields with there code/list mapping
      • getValues

        public java.util.List<java.lang.String> getValues​(java.lang.String name)
        Get all values of a list
        Parameters:
        name - List name
        Returns:
        Ordered values
      • getValuesArray

        public java.lang.String[] getValuesArray​(java.lang.String name)
        Get all values of a list as array
        Parameters:
        name - List name
        Returns:
        Ordered values
      • toHTML

        public java.lang.String toHTML​(java.lang.String lov)
        Publish specified list of values to raw HTML
      • toHTML

        public void toHTML​(java.lang.String lov,
                           java.io.PrintWriter out)
        Publish specified list of values to raw HTML on specified print writer