LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.info
Class LyChoiceOption

java.lang.Object
  extended by leon.info.LyTag
      extended by leon.info.LyInfo
          extended by leon.info.LyChoiceOption
All Implemented Interfaces:
java.lang.Cloneable, LyChoiceItem, LyCommentInterface

public final class LyChoiceOption
extends LyInfo
implements LyChoiceItem

This class implements the description of an option stored in an instance of LyChoiceFieldInfo.
One option is a possible choice in an enumerated fieldInfo.
An option has the following attributes :

See Also:
LyChoiceFieldInfo, LyRule

Nested Class Summary
 
Nested classes/interfaces inherited from class leon.info.LyTag
LyTag.Model
 
Field Summary
static java.lang.String __version
           
 
Fields inherited from class leon.info.LyInfo
__VERSION
 
Method Summary
 java.lang.String getAlias()
          Accessor for alias (shortname) of this instance.
 java.lang.String getInternalAlias()
          Accessor for alias (shortname) of this instance.
 LyInfoLabel getLabel(int index)
          Returns the label of this option at the given index.
 LyInfoLabel getLabel(LyInfoLabel.Type type)
          Returns the the label of this option for the specified type.
 int getLabelCount()
          Returns the number of labels of this option.
 java.lang.String getName()
          Accessor to the name of this option.
 LyRule getRule(short index)
          Gets a rule from the rules list at a given position.
 short getRuleCount()
          Gets rules count.
 LyInfoList<LyRule> getRules()
          Returns the list of rules defined on this option;
 short getShortValue()
          Gets the short value corresponding to the internal value.
 LyInfoLabel getUserLabel(int i)
          Returns the user label at the given position.
 LyInfoLabel getUserLabel(java.lang.String subType)
          Returns the user label for the given subType.
 int getUserLabelCount()
          Returns the number of labels of this option.
 java.lang.Object getValue()
          Gets the internal value (value transmitted to the data provider when this option is chosen).
 boolean hasRule()
          Tests is this option has one or more rules
 boolean hasTableMark()
          Tests is this option is shown as column in edit tables.
 boolean isDefault()
          Tests is this option is a default one.
 boolean isDisable()
          Sets if this option is disabled or not.
 boolean isUnknown()
          Tests is this option is used to redirect unknown values when reading datas.
 
Methods inherited from class leon.info.LyInfo
getApplication, getFile, getId, getInclude, isIncluded, isInternal, isInternal, isLoaded, isLocked, load, setApplication, setFile, toString
 
Methods inherited from class leon.info.LyTag
clone, getCommentsEnd, getCommentsStart, getEnvironment, getModelType, getParent, getRootProject, hasAncestor, isExtern, setCommentsEnd, setCommentsStart, wasCloned
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface leon.info.LyChoiceItem
getId
 
Methods inherited from interface leon.parser.LyCommentInterface
getCommentsEnd, getCommentsStart, setCommentsEnd, setCommentsStart
 

Field Detail

__version

public static final java.lang.String __version
See Also:
Constant Field Values
Method Detail

getName

public java.lang.String getName()
Accessor to the name of this option.

Specified by:
getName in interface LyChoiceItem
Overrides:
getName in class LyInfo
Returns:
Name of this option.

getAlias

public final java.lang.String getAlias()
Accessor for alias (shortname) of this instance.

Specified by:
getAlias in interface LyChoiceItem
Overrides:
getAlias in class LyInfo
Returns:
Alias of this instance. If the alias is null, this method returns the name.

getInternalAlias

public final java.lang.String getInternalAlias()
Accessor for alias (shortname) of this instance. This method doesn't compute a value if it is null

Returns:
Alias of this instance.

getValue

public java.lang.Object getValue()
Gets the internal value (value transmitted to the data provider when this option is chosen).

Specified by:
getValue in interface LyChoiceItem
Returns:
Internal value corresponding to this option.

isDefault

public boolean isDefault()
Tests is this option is a default one.

Returns:
True if this option is a default option, false otherwise.

isDisable

public boolean isDisable()
Sets if this option is disabled or not.

Returns:
True if this option is disable, false otherwise.

isUnknown

public boolean isUnknown()
Tests is this option is used to redirect unknown values when reading datas.

Returns:
True if this option is used for unknown values, false otherwise.

hasTableMark

public boolean hasTableMark()
Tests is this option is shown as column in edit tables.

Returns:
True if this option is shown as column in edit tables, false otherwise.

hasRule

public boolean hasRule()
Tests is this option has one or more rules

Returns:
True if this option has one or more rules, false otherwise.

getRule

public LyRule getRule(short index)
Gets a rule from the rules list at a given position.

Parameters:
index - Position of the searched rule. If index is negative (-1) return null
Returns:
Rule at the given index if it exists.

getRuleCount

public short getRuleCount()
Gets rules count.

Returns:
Return the number of rules in this option.

getRules

public LyInfoList<LyRule> getRules()
Returns the list of rules defined on this option;

Returns:
List of rules, or null if no rule was registered on this option.

getShortValue

public short getShortValue()
Gets the short value corresponding to the internal value. Used to optimize processings when internal values are shorts.

Specified by:
getShortValue in interface LyChoiceItem
Returns:
Short value corresponding to this option, 1 if value can't be casted to a short.

getLabelCount

public int getLabelCount()
Returns the number of labels of this option.


getLabel

public LyInfoLabel getLabel(LyInfoLabel.Type type)
Returns the the label of this option for the specified type.


getLabel

public LyInfoLabel getLabel(int index)
Returns the label of this option at the given index.


getUserLabelCount

public int getUserLabelCount()
Returns the number of labels of this option.


getUserLabel

public LyInfoLabel getUserLabel(int i)
Returns the user label at the given position.


getUserLabel

public LyInfoLabel getUserLabel(java.lang.String subType)
Returns the user label for the given subType.


(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com