public class YearBean extends Object implements Serializable
Constructor and Description |
---|
YearBean() |
Modifier and Type | Method and Description |
---|---|
int |
getCurrentYear()
Gets the current year.
|
static int |
getYearFromDateObject(Object dateObject)
Gets the year from the supplied dateObject.
|
String |
getYearRange(Object minDate,
Object maxDate)
Gets a range of years from the supplied minDate and maxDate.
|
List<javax.faces.model.SelectItem> |
getYearsAsSelectItems(int minYear,
int maxYear)
Gets the supplied range (minYear and maxYear) of years as a List of
SelectItems.
|
public List<javax.faces.model.SelectItem> getYearsAsSelectItems(int minYear, int maxYear)
minYear
- The minimum year.maxYear
- The maximum year.public int getCurrentYear()
public String getYearRange(Object minDate, Object maxDate) throws InvalidArgumentException
minDate
- The minimum date.maxDate
- The maximum date.InvalidArgumentException
- When either the minDate or maxDate is neither a String nor a Date.public static int getYearFromDateObject(Object dateObject) throws InvalidArgumentException
dateObject
- The date object to get the year from.IllegalArgumentException
- When the supplied dateObject is non null and neither a String nor a Date.InvalidArgumentException
- When the supplied dateObject is of type String and could not be parsed as a date.Copyright © 2008–2018. All rights reserved.