|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.info.LyTag
leon.info.LyInfo
leon.info.LyObjectInfo
leon.info.LyFieldInfo
leon.info.LyDateFieldInfo
public final class LyDateFieldInfo
This class implements the description of a Date field.
A date fieldInfo is the implementation of a date attribute in a application class.
Types for this fieldInfo indicate how much information is shown to the user (year, month, day, hour, minute, seconds). Specific format may also be used. Supported types are declared as public static named TYPE_XXX
See also tag
Nested Class Summary | |
---|---|
static class |
LyDateFieldInfo.Type
Date types. |
Nested classes/interfaces inherited from class leon.info.LyTag |
---|
LyTag.Model |
Field Summary | |
---|---|
static java.lang.String |
__version
|
static java.lang.String |
DEFAULT_PEER_FORMAT
Default peer date format when peer type is String. |
static java.lang.String |
VALUE_DAY
Value : day. |
static java.lang.String |
VALUE_NOW
Value : now. |
static java.lang.String |
VALUE_TODAY
Value : today. |
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 for the given value object. |
static java.lang.String |
checkDate(java.lang.String val,
java.text.SimpleDateFormat currentDateFormat)
Checks the date value according to a date format. |
int |
compare(java.lang.Object value1,
java.lang.Object value2,
java.util.BitSet modifiers)
Compare two values of this fieldInfo. |
java.lang.Object |
convertFromFieldUnit(java.lang.Object value,
LyUnit unit)
Convert a value to the field unit from another unit. |
java.lang.Object |
convertToFieldUnit(java.lang.Object value,
LyUnit unit)
Convert a value from the field unit to the given unit. |
java.text.DateFormat |
dateFormatFactory()
Creates a new DateFormat instance of the given type. |
static java.util.Date[] |
getDay(LyDateFieldInfo fieldInfo,
java.lang.String value)
|
java.lang.Object |
getDefaultValue()
Gets default value for this date field. |
java.lang.String |
getDisplayFormat()
Accessor for the display format property of this date field. |
LyFilterExpression.Condition[] |
getFilterConditions()
Returns the filter conditions authorized on this field. |
java.lang.String |
getFormat()
Gets the internal format as a string : the format used for selecting dates inside views. |
java.lang.String |
getInternalDefaultValue()
Gets the raw default value as it is stored in the meta-model, without any translation or formatting. |
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.String |
getStringDateFormat()
Returns the string representing the date format of the given type. |
static java.util.Date[] |
getTodayDate()
Gets a table containing the begin and end date of the current day |
LyDateFieldInfo.Type |
getType()
Accessor to the date type. |
java.lang.Class<?> |
getValueClass()
Returns class of values for this field. |
java.lang.Object |
getValueFromObject(java.lang.Object object,
LyObject instance)
Constructs a value for this fieldInfo from an object for a given instance. |
boolean |
isWithTimeZone()
Checks whether this date field is using time zone during input |
java.lang.Object |
parse(java.lang.String stringValue)
Builds internal value for an instance of LyDateFieldInfo from a string (previously constructed by toString). |
java.lang.Object |
parse(java.lang.String stringValue,
java.lang.String timeZone)
Builds internal value for an instance of LyDateFieldInfo from a string (previously constructed by toString). |
java.lang.String |
toName(java.lang.Object fieldValue)
Returns the specified value for this field as a "displayable" string. |
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 method). |
java.lang.String |
toString(java.lang.Object fieldValue,
boolean ignoreFormat)
Converts the specified value for this field to an "internal" string (string that enables reconstruction through parse method). |
java.lang.String |
toString(java.lang.Object fieldValue,
boolean ignoreFormat,
java.lang.String timeZone)
Converts the specified value for this field to an "internal" string (string that enables reconstruction through parse method). |
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 |
---|
public static final java.lang.String __version
public static java.lang.String VALUE_NOW
public static java.lang.String VALUE_TODAY
public static java.lang.String VALUE_DAY
public static java.lang.String DEFAULT_PEER_FORMAT
Method Detail |
---|
public java.lang.Class<?> getValueClass()
getValueClass
in interface LyField
getValueClass
in class LyFieldInfo
LyObject.getValue(leon.info.LyFieldInfo)
public LyValue buildFieldValue(java.lang.Object value)
buildFieldValue
in interface LyField
buildFieldValue
in class LyFieldInfo
value
- Value from which the LyValue is built.
LyDateValue
public static java.util.Date[] getTodayDate()
public static java.util.Date[] getDay(LyDateFieldInfo fieldInfo, java.lang.String value)
_value
-
public java.lang.Object parse(java.lang.String stringValue, java.lang.String timeZone) throws LyFieldInfoFormatException
stringValue
- the value to parsetimeZone
- the reference timezone
LyFieldInfoFormatException
toString(java.lang.Object)
public java.lang.Object parse(java.lang.String stringValue) throws LyFieldInfoFormatException
parse
in class LyFieldInfo
stringValue
- The value presented as a string as produced by the toString method.
LyFieldInfoFormatException
- If the string can't be parsed properly.toString(java.lang.Object)
public int compare(java.lang.Object value1, java.lang.Object value2, java.util.BitSet modifiers)
compare
in class LyFieldInfo
value1
- First value.value2
- Second value.modifiers
- Modifiers used for checking (see MOD_XXX constants of LyFilterExpression).
LyFieldInfo.getValueClass()
public LyFilterExpression.Condition[] getFilterConditions()
getFilterConditions
in class LyFieldInfo
LyFilterExpression
public java.lang.String toShortName(java.lang.Object fieldValue)
toShortName
in class LyFieldInfo
value
- The internal value to convert to a short displayable string. The excepted class
of this value is the one returned from the getValueClass method.
LyFieldInfo.getValueClass()
,
LyFieldInfo.toName(java.lang.Object)
public java.lang.String toName(java.lang.Object fieldValue)
toName
in class LyFieldInfo
LyFieldInfo.getValueClass()
public java.lang.String toString(java.lang.Object fieldValue)
toString
in class LyFieldInfo
parse(java.lang.String, java.lang.String)
public java.lang.String toString(java.lang.Object fieldValue, boolean ignoreFormat)
parse(java.lang.String, java.lang.String)
public java.lang.String toString(java.lang.Object fieldValue, boolean ignoreFormat, java.lang.String timeZone)
timeZone
- the time zone to displaypublic java.lang.Object getValueFromObject(java.lang.Object object, LyObject instance)
Date, Long, String | Date |
getValueFromObject
in class LyFieldInfo
object
- The peer value.instance
- Instance containing the required value (could be null). This instance is
provided to be able to construct a value for complex bindings (bindings
involving other fields).
LyUnsupportedFieldBindingException
- If the requested conversion if none of the
supported conversions.LyFieldInfo.getPeerValue(java.lang.Object, java.lang.Class>, leon.data.LyObject)
,
LyFieldBinding
public java.lang.Object getPeerValue(java.lang.Object value, java.lang.Class<?> objectClass, LyObject instance)
Date | Date, Long, String |
getPeerValue
in class LyFieldInfo
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).
LyUnsupportedFieldBindingException
- If the requested conversion if none of the
supported conversions.LyFieldInfo.getValueClass()
public LyDateFieldInfo.Type getType()
public java.lang.Object getDefaultValue()
getDefaultValue
in class LyFieldInfo
public java.lang.String getInternalDefaultValue()
public java.lang.String getDisplayFormat()
public java.lang.String getFormat()
getFormat
in class LyFieldInfo
public boolean isWithTimeZone()
public static java.lang.String checkDate(java.lang.String val, java.text.SimpleDateFormat currentDateFormat)
val
- string to parse as a datecurrentDateFormat
- expected for the date
public java.text.DateFormat dateFormatFactory()
LyEnvironment.dateFormatFactory(int)
public java.lang.String getStringDateFormat()
LyEnvironment.dateFormatFactory(int)
public java.lang.Object convertToFieldUnit(java.lang.Object value, LyUnit unit)
convertToFieldUnit
in class LyFieldInfo
value
- The value to convert.unit
- The new unit.
public java.lang.Object convertFromFieldUnit(java.lang.Object value, LyUnit unit)
convertFromFieldUnit
in class LyFieldInfo
value
- The value to convert.unit
- The old unit.
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |