*
* @see com.sun.facelets.tag.ObjectHandler#setAttributes(com.sun.facelets.FaceletContext,
* java.lang.Object)
*/
protected void setAttributes(FaceletContext ctx, Object obj) {
DateTimeConverter c = (DateTimeConverter) obj;
if (this.locale != null) {
c.setLocale(ComponentSupport.getLocale(ctx, this.locale));
}
if (this.pattern != null) {
c.setPattern(this.pattern.getValue(ctx));
} else {
if (this.type != null) {
c.setType(this.type.getValue(ctx));
}
if (this.dateStyle != null) {
c.setDateStyle(this.dateStyle.getValue(ctx));
}
if (this.timeStyle != null) {
c.setTimeStyle(this.timeStyle.getValue(ctx));
}
}
if (this.timeZone != null) {
Object t = this.timeZone.getObject(ctx);
if(t != null) {
if (t instanceof TimeZone) {
c.setTimeZone((TimeZone) t);
} else if (t instanceof String) {
TimeZone tz = TimeZone.getTimeZone((String) t);
c.setTimeZone(tz);
} else {
throw new TagAttributeException(
this.tag,
this.timeZone,
"Illegal TimeZone, must evaluate to either a java.util.TimeZone or String, is type: "