Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.myfaces.custom.schedule.util
Class ScheduleUtil

    java.lang.Object
      org.apache.myfaces.custom.schedule.util.ScheduleUtil

public class ScheduleUtil
extends java.lang.Object

Some utility methods

Version:
  $Revision$
Author:
  Jurgen Lust (latest modification by $Author$), Kito Mann (some methods taken from the source code of his book 'JavaServer Faces in Action', which is also released under the Apache License, Bruno Aranda (adaptation of Jurgen's code to myfaces)

Constructor Summary
`ScheduleUtil()`

Method Summary
`static boolean` | `canModifyValue(javax.faces.component.UIComponent component)` Check if the value of the given component can be modified
`static int` | `compareDays(java.util.Date date1, java.util.Date date2)` Compare 2 dates after truncating them.
`static boolean` | `getBooleanProperty(javax.faces.component.UIComponent component, java.lang.Boolean property, java.lang.String key, boolean defaultValue)` Get the boolean value of a UIComponent, even if it is a value binding expression.
`static boolean` | `getBooleanValue(java.lang.Object attributeValue, boolean valueIfNull)` Get the boolean value of an attribute
`static float` | `getFloatProperty(javax.faces.component.UIComponent component, java.lang.Float property, java.lang.String key, float defaultValue)` Get the float value of a UIComponent, even if it is a value binding expression.
`static int` | `getHashCodeForDay(java.util.Date date)` Get the hashcode for the truncated date
`static int` | `getIntegerProperty(javax.faces.component.UIComponent component, java.lang.Integer property, java.lang.String key, int defaultValue)` Get the int value of a UIComponent, even if it is a value binding expression.
`static java.lang.Object` | `getObjectProperty(javax.faces.component.UIComponent component, java.lang.Object property, java.lang.String key, java.lang.Object defaultValue)` Get the object value of a UIComponent, even if it is a value binding expression.
`static java.lang.String` | `getStringProperty(javax.faces.component.UIComponent component, java.lang.String property, java.lang.String key, java.lang.String defaultValue)` Get the String value of a UIComponent, even if it is a value binding expression.
`static boolean` | `isBindingExpression(java.lang.Object value)` Check if the value of a UIComponent is a value or method binding expression.
`static boolean` | `isSameDay(java.util.Date date1, java.util.Date date2)` Check if the 2 dates are in the same day.
`static java.util.Date` | `truncate(java.util.Date date)` truncate the given Date to 00:00:00 that same day

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ScheduleUtil

    public ScheduleUtil()

Method Detail

### isBindingExpression

    public static boolean isBindingExpression(java.lang.Object value)

  Check if the value of a UIComponent is a value or method binding expression.

  Parameters:
    `value` - the value to check
  Returns:
    whether the value is a binding expression

### getBooleanProperty

    public static boolean getBooleanProperty(javax.faces.component.UIComponent component,
                                             java.lang.Boolean property,
                                             java.lang.String key,
                                             boolean defaultValue)

  Get the boolean value of a UIComponent, even if it is a value binding expression.

  Parameters:
    `component` - the component
    `property` - the property
    `key` - the key of the value binding
    `defaultValue` - the default value
  Returns:
    the boolean value

### getBooleanValue

    public static boolean getBooleanValue(java.lang.Object attributeValue,
                                          boolean valueIfNull)

  Get the boolean value of an attribute

  Parameters:
    `attributeValue` - the attribute value
    `valueIfNull` - the default value
  Returns:
    the boolean value

### getFloatProperty

    public static float getFloatProperty(javax.faces.component.UIComponent component,
                                         java.lang.Float property,
                                         java.lang.String key,
                                         float defaultValue)

  Get the float value of a UIComponent, even if it is a value binding expression.

  Parameters:
    `component` - the component
    `property` - the property
    `key` - the key of the value binding
    `defaultValue` - the default value
  Returns:
    the float value

### getHashCodeForDay

    public static int getHashCodeForDay(java.util.Date date)

  Get the hashcode for the truncated date

  Parameters:
    `date` - the date
  Returns:
    the hashCode of the truncated date

### getIntegerProperty

    public static int getIntegerProperty(javax.faces.component.UIComponent component,
                                         java.lang.Integer property,
                                         java.lang.String key,
                                         int defaultValue)

  Get the int value of a UIComponent, even if it is a value binding expression.

  Parameters:
    `component` - the component
    `property` - the property
    `key` - the key of the value binding
    `defaultValue` - the default value
  Returns:
    the int value

### getObjectProperty

    public static java.lang.Object getObjectProperty(javax.faces.component.UIComponent component,
                                                     java.lang.Object property,
                                                     java.lang.String key,
                                                     java.lang.Object defaultValue)

  Get the object value of a UIComponent, even if it is a value binding expression.

  Parameters:
    `component` - the component
    `property` - the property
    `key` - the key of the value binding
    `defaultValue` - the default value
  Returns:
    the object value

### isSameDay

    public static boolean isSameDay(java.util.Date date1,
                                    java.util.Date date2)

  Check if the 2 dates are in the same day.

  Parameters:
    `date1` - the first date
    `date2` - the second date
  Returns:
    whether the dates are in the same day

### getStringProperty

    public static java.lang.String getStringProperty(javax.faces.component.UIComponent component,
                                                     java.lang.String property,
                                                     java.lang.String key,
                                                     java.lang.String defaultValue)

  Get the String value of a UIComponent, even if it is a value binding expression.

  Parameters:
    `component` - the component
    `property` - the property
    `key` - the key of the value binding
    `defaultValue` - the default value
  Returns:
    the String value

### canModifyValue

    public static boolean canModifyValue(javax.faces.component.UIComponent component)

  Check if the value of the given component can be modified

  Parameters:
    `component` - the component
  Returns:
    whether the value can be modified

### compareDays

    public static int compareDays(java.util.Date date1,
                                  java.util.Date date2)

  Compare 2 dates after truncating them.

  Parameters:
    `date1` - the first date
    `date2` - the second date
  Returns:
    the comparison

### truncate

    public static java.util.Date truncate(java.util.Date date)

  truncate the given Date to 00:00:00 that same day

  Parameters:
    `date` - the date that should be truncated
  Returns:
    the truncated date

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD