Version: ${maven.project.version}

org.soaplab.services.metadata
Class ListDef

java.lang.Object
  extended by org.soaplab.services.metadata.ListDef

public class ListDef
extends java.lang.Object

A data structure defining a static list of string values, possibly hierarchically nested (like a 'menu' structure'). The values are used as the 'allowed' values for the parameter where his structure is used.

The list is "static" which means that there are no methods for moving or removing values once they are here.

 Explanation of the individual members
 (remember that some features are useful only for clients and some only
  for servers, but they all live here together)

 name
    the list name is usually used as a title for a client-side menu
    displaying the list
 type
    FULL  ... values of such list cover (express) the whole value of
              the related parameter (this is the usual list type)
    SLICE ... values of such list cover only part of a parameter
              value (the parts are called 'slices')
    An example:
       A parameter value should be like this (a date): 1999/12/31.
       This parameter can have attached a FULL list with values
       such as: 1999/12/31
                2000/12/31
                2001/12/31,
       or it can have attached one or more SLICE lists, such as:
                12
                11
                ...  (a list covering months)
       and
                1999
                2000
                ...  (a list covering available years)

       (btw, a parameter can have both FULL and SLICE lists).
 slice
    a one-based serial number of a slice covered by this list
    (it makes sense only for list of type SLICE)
 items (defined in ListItemDef.java)
    An array of list values. They are in the order how they should
    be presented by client - for nested items (which are anyway stored
    here flatted but with attribute) the order is top-to-down and
    left-to-right - see example in 'level' below.

    Each item has this attributes:
       value     ... the real value
       shown_as  ... a string used on the client-side to display the value
                     (an example: value = 12
                                  shown_as = December)
       type      ... an item can be a real one (REGULAR),
                     or a node in a 'menu' (NODE),
                     or just a menu separator (SEPARATOR)
       level     ... zero-based index of item nesting (defaul is 0)
                     An example: The following (client-side) menu:
                        Europe
                           UK
                              Scotland
                           France
                              Provence
                        America
                           North
                              USA
                              Canada
                           South
                        Asia
                           Japan

                     would be flattened with the following 'levels':

                        0 Europe
                        1 UK
                        2 Scotland
                        1 France
                        2 Provence
                        0 America
                        1 North
                        2 USA
                        2 Canada
                        1 South
                        0 Asia
                        1 Japan

Version:
$Id: ListDef.java,v 1.2 2007/04/19 22:17:06 marsenger Exp $
Author:
Martin Senger

Field Summary
static int FULL
           
 ListItemDef[] items
           
 java.lang.String name
           
 int slice
           
static int SLICE
           
 int type
           
 
Constructor Summary
ListDef()
          Constructor.
 
Method Summary
 java.lang.String format(int indent)
          As toString() but with indentations.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FULL

public static final int FULL
See Also:
Constant Field Values

SLICE

public static final int SLICE
See Also:
Constant Field Values

name

public java.lang.String name

type

public int type

slice

public int slice

items

public ListItemDef[] items
Constructor Detail

ListDef

public ListDef()
Constructor. Actually, no need... the members are public...

Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

format

public java.lang.String format(int indent)
As toString() but with indentations.


Version: ${maven.project.version}

Submit a bug or feature
Generated: Tue Jun 14 15:18:14 AST 2011