LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.info.misc
Class LyFormat

java.lang.Object
  extended by leon.info.LyTag
      extended by leon.info.misc.LyFormat
All Implemented Interfaces:
java.lang.Cloneable

public class LyFormat
extends LyTag

This class is used to store a format on a unit. A parameter is composed of a value, an editable property, a size and a java name (name of a java class that implements LyFormatterInterface).


Nested Class Summary
 
Nested classes/interfaces inherited from class leon.info.LyTag
LyTag.Model
 
Field Summary
static java.lang.String __VERSION
           
 
Constructor Summary
LyFormat(java.lang.String value, boolean editable, int nCols, java.lang.String javaName)
          Constructor.
 
Method Summary
 java.lang.String completeValue(LyFieldInfo fieldInfo, java.lang.String value, LyUnit unit)
          Methode to complete the given partial value.
 java.lang.String getJavaName()
          Accessor for javaName property.
 int getNCols()
          Accessor for nCols property.
 java.lang.String getValue()
          Accessor for value.
 boolean isEditable()
          Accessor for editable property.
 java.lang.Object parse(LyFieldInfo fieldInfo, java.lang.String value, LyUnit unit)
          Method to parse a string value with a given unit.
 java.lang.String toName(LyFieldInfo fieldInfo, java.lang.Object value, LyUnit unit)
          Method to format a value to a displayable string with the given unit.
 java.lang.String toShortName(LyFieldInfo fieldInfo, java.lang.Object value, LyUnit unit)
          Method to format a value to a short displayable string with the given unit.
 java.lang.String toString(LyFieldInfo fieldInfo, java.lang.Object value, LyUnit unit)
          Method to format a value to a string with the given unit.
 
Methods inherited from class leon.info.LyTag
clone, getApplication, getCommentsEnd, getCommentsStart, getEnvironment, getId, getModelType, getParent, getRootProject, hasAncestor, isExtern, setCommentsEnd, setCommentsStart, wasCloned
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values
Constructor Detail

LyFormat

public LyFormat(java.lang.String value,
                boolean editable,
                int nCols,
                java.lang.String javaName)
Constructor.

Method Detail

getValue

public java.lang.String getValue()
Accessor for value.


isEditable

public boolean isEditable()
Accessor for editable property.


getNCols

public int getNCols()
Accessor for nCols property.


getJavaName

public java.lang.String getJavaName()
Accessor for javaName property.


toString

public java.lang.String toString(LyFieldInfo fieldInfo,
                                 java.lang.Object value,
                                 LyUnit unit)
Method to format a value to a string with the given unit.

Parameters:
fieldInfo - the fieldInfo for which a value is formatted
value - the value to format
unit - the destination unit of the string value
Returns:
The string corresponding to the given value and unit.

toName

public java.lang.String toName(LyFieldInfo fieldInfo,
                               java.lang.Object value,
                               LyUnit unit)
Method to format a value to a displayable string with the given unit.

Parameters:
fieldInfo - the fieldInfo for which a value is formatted
value - the value to format
unit - the destination unit of the string value
Returns:
The displayable string corresponding to the given value and unit.

toShortName

public java.lang.String toShortName(LyFieldInfo fieldInfo,
                                    java.lang.Object value,
                                    LyUnit unit)
Method to format a value to a short displayable string with the given unit.

Parameters:
fieldInfo - the fieldInfo for which a value is formatted
value - the value to format
unit - the destination unit of the string value
Returns:
The short displayable string corresponding to the given value and unit.

parse

public java.lang.Object parse(LyFieldInfo fieldInfo,
                              java.lang.String value,
                              LyUnit unit)
Method to parse a string value with a given unit.

Parameters:
fieldInfo - the fieldInfo for which the string value is parsed.
value - the string value to parse
source - the unit of the string value
Returns:
The value corresponding to the given string and unit.

completeValue

public java.lang.String completeValue(LyFieldInfo fieldInfo,
                                      java.lang.String value,
                                      LyUnit unit)
Methode to complete the given partial value.

Parameters:
fieldInfo - the fieldInfo for which the string value is completed.
value - the string value to complete
unit - the unit of the string value
Returns:
the completed String or null if the generic completion has to be done.

(c) January 2013 - W4 S.A.

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