LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.info
Class LyArrayFieldInfo

java.lang.Object
  extended by leon.info.LyTag
      extended by leon.info.LyInfo
          extended by leon.info.LyObjectInfo
              extended by leon.info.LyFieldInfo
                  extended by leon.info.LyArrayFieldInfo
All Implemented Interfaces:
java.lang.Cloneable, LyField, LyCommentInterface

public class LyArrayFieldInfo
extends LyFieldInfo

This class represents an array for a given field info.


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.LyFieldInfo
MARK_APP_ID, MARK_AUTO_COMPLETION, MARK_CHART, MARK_COMPLEX_TABLE, MARK_CONSULT, MARK_CREATE, MARK_CREATE_CONSULT, MARK_DISABLE, MARK_FILTER, MARK_FIND, MARK_HIDDEN, MARK_ID, MARK_LOAD, MARK_LOCAL, MARK_MAIN, MARK_NAME, MARK_NEED_POST, MARK_NO_CAPTION, MARK_NOT_NULL, MARK_OPTIONAL, MARK_PRIVATE, MARK_PROVIDER_VALUE, MARK_READ_ONLY, MARK_SEARCH, MARK_SECRET, MARK_SET, MARK_SET_CONSULT, MARK_SORT, MARK_STATUS, MARK_TABLE, MARK_TRANSLATE, MARK_UNIQUE, SECRET_VALUE, STRONG_DEPENDENCY_VALUE, WEAK_DEPENDENCY_VALUE
 
Fields inherited from class leon.info.LyObjectInfo
__VERSION, NULL, PART_ALL, PART_BIND, PART_DATA, PART_GUI, PART_LABEL
 
Fields inherited from interface leon.data.LyField
__VERSION
 
Method Summary
 LyValue buildFieldValue(java.lang.Object value)
          Builds the appropriate LyValue corresponding to this field from a value provided as an Object.
 java.lang.String checkValue(LyEnvironment environment, java.lang.Object fieldValue)
          Unitary check of the given value and produce a legible message to the end user if the value is incorrect.
 int compare(java.lang.Object value1, java.lang.Object value2, java.util.BitSet modifiers)
          Compares two values for the specified field.
 boolean contains(java.lang.Object value1, java.lang.Object value2, java.util.BitSet modifiers)
          Checks if the second value is contained in the first one, for this field.
 java.lang.String controlValue(LyEnvironment environment, java.lang.Object fieldValue)
          Unitary control of the given value and produce a legible message to the end user if the value is incorrect.
 boolean deepEquals(java.lang.Object value1, java.lang.Object value2, java.util.BitSet modifiers)
          Compares two objects for this fieldInfo.
 boolean endsWith(java.lang.Object value1, java.lang.Object value2, java.util.BitSet modifiers)
          Checks if the second value ends the first one, for this field.
 boolean equals(java.lang.Object value1, java.lang.Object value2, java.util.BitSet modifiers)
          Compares two values for equality on this field.
 java.lang.Object[] getArray(int length)
          Returns an array of the specified length for building valid values.
 LyArrayDaemon getDaemon()
          Gets the definition of the daemon managing this field.
 LyFieldInfo getFieldInfo()
          Gets the field info defined in this array.
 LyFilterExpression.Condition[] getFilterConditions()
          Returns the filter conditions authorized on this field.
 short[] getFilterModifiers()
          Returns the filter modifiers authorized on this field.
 short getMaxCardinality()
          Gets maximum cardinality.
 short getMinCardinality()
          Gets minimum cardinality.
 int getNRows()
          Gets the preferred number of rows shown to the user.
 java.lang.Object getPeerValue(java.lang.Object value, java.lang.Class<?> objectClass, LyObject instance)
          Returns an object of the given class from a value of this fieldInfo.
 java.lang.Object[] getPeerValues(java.lang.Object value, java.lang.Class<?>[] objectClasses, LyObject instance)
          Returns a table of objects for the given classes from a value of this fieldInfo.
 java.lang.Object getValue(java.lang.Object fieldValue, int index)
          Get the value at given index from value table.
 java.lang.Class<?> getValueClass()
          Returns class of values for this field.
 int getValueCount(java.lang.Object fieldValue)
          Get the number of values found in the given value table.
 java.lang.Object getValueFromObject(java.lang.Object object, LyObject instance)
          Builds a logical value for this fieldInfo from a physical (peer) value.
 java.lang.Object parse(java.lang.String stringValue)
          This method allows to create a value from a string for this field.
 boolean startsWith(java.lang.Object value1, java.lang.Object value2, java.util.BitSet modifiers)
          Checks if the second value starts the first one, for this field.
 java.lang.String toName(java.lang.Object fieldValue)
          Returns a "displayable string" (string that can be shown to the end-user) of the specified value for this field.
 java.lang.String toName(java.lang.Object fieldValue, java.lang.String separator)
          Returns a "displayable string" (string that can be shown to the end-user) of the specified value for this field.
 java.lang.String toShortName(java.lang.Object fieldValue)
          Returns the specified value for this field as a short "displayable" string (short string that can be shown to the end-user).
 java.lang.String toString(java.lang.Object fieldValue)
          Converts the specified value for this field to an "internal" string (string that enables reconstruction through parse, but not shown to the user).
 
Methods inherited from class leon.info.LyFieldInfo
addConstraint, addDepend, addDepend, buildLyValue, checkJavaName, compare, compute, compute, compute, compute, contains, convertFromFieldUnit, convertToFieldUnit, encodeValue, equals, fromFieldTag, getBean, getBeans, getBehaviorClass, getBehaviorClassName, getBinding, getCaptionConstraint, getConstraint, getConstraint, getConstraints, getControl, getControlCount, getControls, getDefaultJavaName, getDefaultValue, getDepends, getDepends, getFieldBean, getFieldGroup, getFieldTab, getFieldUnit, getFormat, getFormula, getFormulaFields, getFormulaImports, getGenericMarks, getImport, getJavaName, getLabel, getLabel, getLabelCount, getLabels, getLyFormula, getMark, getMark, getMarkName, getMarks, getPath, getSpecificMarks, getTab, getUnits, getUserLabel, getUserLabel, getUserLabelCount, hasMark, isCalculated, isComputed, isImported, isLocal, isMultiple, processValue, setImport, setPath, toName
 
Methods inherited from class leon.info.LyObjectInfo
clone, getAlias, getData, getDataList, getDatas, getFilePrefix, getGroup, getInternalAlias, getInternalFilePrefix, getInternalName, getMarks, getName, getTemplate, getTip, getUserData, hasMark, hasMarks, hasTemplate, isTemplate, putData, putData, removeData, toName
 
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
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.data.LyField
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

getValue

public java.lang.Object getValue(java.lang.Object fieldValue,
                                 int index)
Get the value at given index from value table.

Parameters:
fieldValue - The value table.
index - Index of the desired value.
Returns:
The value if it exists, null otherwise.

getValueCount

public int getValueCount(java.lang.Object fieldValue)
Get the number of values found in the given value table.

Parameters:
fieldValue - The value table.
Returns:
Number of values.

getValueClass

public java.lang.Class<?> getValueClass()
Returns class of values for this field.

Specified by:
getValueClass in interface LyField
Specified by:
getValueClass in class LyFieldInfo
Returns:
Effective class of values built by this fieldInfo.
See Also:
LyObject.getValue(leon.info.LyFieldInfo)

getArray

public java.lang.Object[] getArray(int length)
Returns an array of the specified length for building valid values.

Parameters:
length - The length of the desired array.
Returns:
An array of the specified length.

buildFieldValue

public LyValue buildFieldValue(java.lang.Object value)
Builds the appropriate LyValue corresponding to this field from a value provided as an Object.

Specified by:
buildFieldValue in interface LyField
Overrides:
buildFieldValue in class LyFieldInfo
Parameters:
value - Value from which the LyValue is built.
Returns:
An instance of a class that inherits from LyValue corresponding the given value.

parse

public java.lang.Object parse(java.lang.String stringValue)
                       throws LyFieldInfoFormatException
This method allows to create a value from a string for this field. The class of the returned value is the one given by getValueClass method.

Specified by:
parse in class LyFieldInfo
Parameters:
stringValue - The value presented as a string as produced by the toString method.
Returns:
The value decoded from the given string.
Throws:
LyFieldInfoFormatException - If the string can't be parsed properly.
See Also:
LyFieldInfo.toString(java.lang.Object), LyFieldInfo.getValueClass()

toName

public java.lang.String toName(java.lang.Object fieldValue)
Returns a "displayable string" (string that can be shown to the end-user) of the specified value for this field.

Specified by:
toName in class LyFieldInfo
Parameters:
value - The internal value to convert to a displayable string. The expected class of this value is the one returned from the getValueClass method.
Returns:
The value presented as a displayable String.
See Also:
LyFieldInfo.getValueClass()

toName

public java.lang.String toName(java.lang.Object fieldValue,
                               java.lang.String separator)
Returns a "displayable string" (string that can be shown to the end-user) of the specified value for this field.

Parameters:
value - The internal value to convert to a displayable string. The expected class of this value is the one returned from the getValueClass method.
String - separator : The value of separator between field values.
Returns:
The value presented as a displayable String.
See Also:
LyFieldInfo.getValueClass()

toShortName

public java.lang.String toShortName(java.lang.Object fieldValue)
Returns the specified value for this field as a short "displayable" string (short string that can be shown to the end-user). Default implementation consists of returning same result as toName.

Overrides:
toShortName in class LyFieldInfo
Parameters:
value - The internal value to convert to a short displayable string. The expected class of this value is the one returned from the getValueClass method.
Returns:
The value presented as a short displayable String.
See Also:
LyFieldInfo.getValueClass(), LyFieldInfo.toName(java.lang.Object)

toString

public java.lang.String toString(java.lang.Object fieldValue)
Converts the specified value for this field to an "internal" string (string that enables reconstruction through parse, but not shown to the user). This string may not be significant to the end-user and usually should not be displayed.

Specified by:
toString in class LyFieldInfo
Parameters:
value - The internal value to convert to an internal string. The expected class of this value is the one returned from the getValueClass method.
Returns:
the value as an internal String.
See Also:
LyFieldInfo.parse(java.lang.String), LyFieldInfo.getValueClass()

controlValue

public java.lang.String controlValue(LyEnvironment environment,
                                     java.lang.Object fieldValue)
Unitary control of the given value and produce a legible message to the end user if the value is incorrect. This method is called when validating a form containing this field info. Default implementation calls check value to prevent cases where it was not done on changes.

Overrides:
controlValue in class LyFieldInfo
Parameters:
environment - Environment giving the user language if a message has to be produced.
value - Value to control. The expected class of this value is the one returned from the getValueClass method.
Returns:
Returns an error message if the value is incorrect, null otherwise.
See Also:
LyFieldInfo.getValueClass()

checkValue

public java.lang.String checkValue(LyEnvironment environment,
                                   java.lang.Object fieldValue)
Unitary check of the given value and produce a legible message to the end user if the value is incorrect. This method is called when changing in a form the value corresponding to this field info.

Overrides:
checkValue in class LyFieldInfo
Parameters:
environment - Environment giving the user language if a message has to be produced.
value - Value to check. The expected class of this value is the one returned from the getValueClass method.
Returns:
Returns an error message if the value is incorrect, null otherwise.
See Also:
LyFieldInfo.getValueClass()

equals

public boolean equals(java.lang.Object value1,
                      java.lang.Object value2,
                      java.util.BitSet modifiers)
Compares two values for equality on this field. The excepted class of the values to compare is the one returned from the getValueClass method. The default implementation consits of comparing values using compare method and returning true when result is 0. Due to the fact that this method can be called often, this method is provided to speed up this compare when it's possible to do better.

Overrides:
equals in class LyFieldInfo
Parameters:
value1 - First value.
value2 - Second value.
modifiers - Modifiers used for checking (see MOD_XXX constants of LyFilterExpression).
Returns:
True if the values are equals, else false.
See Also:
LyFieldInfo.compare(java.lang.Object, java.lang.Object, java.util.BitSet), LyFieldInfo.getValueClass()

compare

public int compare(java.lang.Object value1,
                   java.lang.Object value2,
                   java.util.BitSet modifiers)
Compares two values for the specified field. The expected class of the values to compare is the one returned from the getValueClass method.

Specified by:
compare in class LyFieldInfo
Parameters:
value1 - First value.
value2 - Second value.
modifiers - Modifiers used for checking (see MOD_XXX constants of LyFilterExpression).
Returns:
0 If the two values are identical for the specified fieldInfo, a positive number if value1 is "greater" than value2. If value2 is "greater" than value1, a negative number is returned.
See Also:
LyFieldInfo.getValueClass()

contains

public boolean contains(java.lang.Object value1,
                        java.lang.Object value2,
                        java.util.BitSet modifiers)
Checks if the second value is contained in the first one, for this field. Warning ! This kind of check does not make sense for every type of field and an exception can be thrown in that case. The expected class of the values is the one returned from the getValueClass method.

Overrides:
contains in class LyFieldInfo
Parameters:
value1 - First value.
value2 - Second value.
modifiers - Modifiers used for checking (see MOD_XXX constants of LyFilterExpression).
Returns:
True if the second value is contained in the first one, else returns false.
Throws:
LyUnsupportedComparisonException - If it does not make sense to check if a value is contained in an other one from this field "point of view".

startsWith

public boolean startsWith(java.lang.Object value1,
                          java.lang.Object value2,
                          java.util.BitSet modifiers)
Checks if the second value starts the first one, for this field. Warning ! This kind of check does not make sense for every type of field and an exception can be thrown in that case. The expected class of the values is the one returned from the getValueClass method.

Overrides:
startsWith in class LyFieldInfo
Parameters:
value1 - First value.
value2 - Second value.
modifiers - Modifiers used for checking (see MOD_XXX constants of LyFilterExpression).
Returns:
True if the second value starts the first one, else returns false.
Throws:
LyUnsupportedComparisonException - If it does not make sense to check if a value starts the other one from this field "point of view".

endsWith

public boolean endsWith(java.lang.Object value1,
                        java.lang.Object value2,
                        java.util.BitSet modifiers)
Checks if the second value ends the first one, for this field. Warning ! This kind of check does not make sense for every type of field and an exception can be thrown in that case. The expected class of the values is the one returned from the getValueClass method.

Overrides:
endsWith in class LyFieldInfo
Parameters:
value1 - First value.
value2 - Second value.
modifiers - Modifiers used for checking (see MOD_XXX constants of LyFilterExpression).
Returns:
True if the second value ends the first one, else returns false.
Throws:
LyUnsupportedComparisonException - If it does not make sense to check if a value ends the other one from this field "point of view".

getFilterConditions

public LyFilterExpression.Condition[] getFilterConditions()
Returns the filter conditions authorized on this field. The values must match the short constants defined in LyFilterExpression.

Overrides:
getFilterConditions in class LyFieldInfo
Returns:
An array of conditions corresponding to the authorized conditions on this field.
See Also:
LyFilterExpression

getFilterModifiers

public short[] getFilterModifiers()
Returns the filter modifiers authorized on this field. The values must match the short constants defined in LyFilterExpression.

Overrides:
getFilterModifiers in class LyFieldInfo
Returns:
An array of short corresponding to the authorized modifiers on this field.
See Also:
LyFilterExpression

getValueFromObject

public java.lang.Object getValueFromObject(java.lang.Object object,
                                           LyObject instance)
Builds a logical value for this fieldInfo from a physical (peer) value. This method is used when the binding specified for this field is a LyFieldBinding.

Overrides:
getValueFromObject in class LyFieldInfo
Parameters:
object - The peer value.
instance - Instance containing the requiered value (could be null). This instance is provided to be able to construct a value for complex bindings (bindings involving other fields).
Returns:
The logical value that was built (instance of the class returned from getValueClass).
Throws:
LyUnsupportedFieldBindingException - Thrown if we don't known how to build a value from the given object.
See Also:
LyFieldInfo.getPeerValue(java.lang.Object, java.lang.Class, leon.data.LyObject), LyFieldBinding

getPeerValue

public java.lang.Object getPeerValue(java.lang.Object value,
                                     java.lang.Class<?> objectClass,
                                     LyObject instance)
Returns an object of the given class from a value of this fieldInfo. The purpose of this method is to support transformations from logical to physical representation when simple bindings are used.

Overrides:
getPeerValue in class LyFieldInfo
Parameters:
value - Value of this fieldInfo. This value is an instance of the class returned by getValueClass method.
objectClass - Expected class of the physical value.
instance - Instance containing the given value (could be null).
Throws:
LyUnsupportedFieldBindingException - Thrown if we don't known how to build a peer value from the given parameters.
See Also:
LyFieldInfo.getValueClass()

getPeerValues

public java.lang.Object[] getPeerValues(java.lang.Object value,
                                        java.lang.Class<?>[] objectClasses,
                                        LyObject instance)
Returns a table of objects for the given classes from a value of this fieldInfo.

Overrides:
getPeerValues in class LyFieldInfo
Parameters:
value - Value of this fieldInfo.
objectClasses - Expected classes of the physical values.
instance - Instance containing the given value (could be null).
Throws:
LyUnsupportedFieldBindingException - If we don't known how to build the peer values from the given parameters.
See Also:
LyFieldInfo.getValueClass()

getFieldInfo

public LyFieldInfo getFieldInfo()
Gets the field info defined in this array.


getMinCardinality

public short getMinCardinality()
Gets minimum cardinality.

Returns:
The minimum cardinality of this field.

getMaxCardinality

public short getMaxCardinality()
Gets maximum cardinality.

Returns:
The maximum cardinality of this field.

getDaemon

public LyArrayDaemon getDaemon()
Gets the definition of the daemon managing this field.

Returns:
The daemon managing this field.

getNRows

public int getNRows()
Gets the preferred number of rows shown to the user.

Returns:
Number of rows, or -1 if no preference is given.

deepEquals

public boolean deepEquals(java.lang.Object value1,
                          java.lang.Object value2,
                          java.util.BitSet modifiers)
Compares two objects for this fieldInfo.


(c) January 2013 - W4 S.A.

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