JSCAPE MFT Server

com.jscape.util.reflection.types
Class ChoiceField

java.lang.Object
  extended by com.jscape.util.reflection.FieldType
      extended by com.jscape.util.reflection.types.ChoiceField

public class ChoiceField
extends FieldType

Drop-down choice field component.


Field Summary
 boolean optional
           
 java.lang.String[] variants
           
 
Constructor Summary
ChoiceField(boolean optional)
          Creates new instance with empty String options.
ChoiceField(boolean optional, java.lang.String... variants)
          Creates new instance of String options.
ChoiceField(java.lang.String... variants)
          Creates new instance of String options.
 
Method Summary
static ChoiceField createRangeChoice(int lowerBound, int upperBound)
          Creates new instance using integer range.
static ChoiceField createRangeChoice(int lowerBound, int upperBound, boolean optional)
          Creates new instance using integer range.
 java.lang.String[] getVariants()
          Returns field variants.
 boolean isOptional()
          Returns if field is optional.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

variants

public final java.lang.String[] variants

optional

public final boolean optional
Constructor Detail

ChoiceField

public ChoiceField(boolean optional,
                   java.lang.String... variants)
Creates new instance of String options.

Parameters:
optional - if field is optional
variants - the string variants

ChoiceField

public ChoiceField(java.lang.String... variants)
Creates new instance of String options.

Parameters:
variants - the string variants

ChoiceField

public ChoiceField(boolean optional)
Creates new instance with empty String options.

Parameters:
optional - if field is optional
Method Detail

createRangeChoice

public static ChoiceField createRangeChoice(int lowerBound,
                                            int upperBound)
Creates new instance using integer range.

Parameters:
lowerBound - the lower bound
upperBound - the upper bound
Returns:

createRangeChoice

public static ChoiceField createRangeChoice(int lowerBound,
                                            int upperBound,
                                            boolean optional)
Creates new instance using integer range.

Parameters:
lowerBound - the lower bound
upperBound - the upper bound
optional - if field is optional
Returns:

getVariants

public java.lang.String[] getVariants()
Returns field variants.

Returns:
the string variants

isOptional

public boolean isOptional()
Returns if field is optional.

Returns:
true if field is optional

toString

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

JSCAPE MFT Server

Copyright © JSCAPE LLC. 1999-2015. All Rights Reserved