1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 */ 19 20 package org.apache.myfaces.tobago.internal.taglib.component; 21 22 23 import org.apache.myfaces.tobago.apt.annotation.ConverterTag; 24 import org.apache.myfaces.tobago.apt.annotation.Tag; 25 import org.apache.myfaces.tobago.apt.annotation.TagAttribute; 26 import org.apache.myfaces.tobago.convert.DateTimeConverter; 27 import org.apache.myfaces.tobago.internal.taglib.declaration.HasFor; 28 29 import javax.el.ValueExpression; 30 31 /** 32 * Register a DateTimeConverter instance on the UIComponent associated with the closest parent UIComponent custom 33 * action. 34 */ 35 @Tag(name = "convertDateTime") 36 @ConverterTag( 37 converterId = DateTimeConverter.CONVERTER_ID, 38 faceletHandler = "org.apache.myfaces.tobago.facelets.ConvertDateTimeHandler") 39 public interface ConvertDateTimeTagDeclaration extends HasFor { 40 41 /** 42 * A ValueExpression that evaluates to an instance of 43 * {@link org.apache.myfaces.tobago.facelets.ConvertDateTimeHandler}. 44 */ 45 @TagAttribute(name = "binding", type = "org.apache.myfaces.tobago.convert.DateTimeConverter") 46 void setBinding(ValueExpression binding); 47 48 /** 49 * Locale whose predefined styles for dates and times are used during formatting or parsing. If not specified, the 50 * Locale returned by FacesContext.getViewRoot().getLocale() will be used. Value must be either a VB expression that 51 * evaluates to a java.util.Locale instance, or a String that is valid to pass as the first argument to the 52 * constructor java.util.Locale(String language, String country). The empty string is passed as the second argument. 53 */ 54 @TagAttribute(type = "java.lang.Object") 55 void setLocale(ValueExpression locale); 56 57 /** 58 * Custom formatting pattern which determines how the date/time string should be formatted and parsed. 59 * Pattern chars 'G', 'W', 'F', 'K', 'z' and 'X' are not supported. 60 */ 61 @TagAttribute() 62 void setPattern(String pattern); 63 64 /** 65 * Time zone in which to interpret any time information in the date String. Value must be either a VB expression that 66 * evaluates to a java.util.TimeZone instance, or a String that is a timezone ID as described in the javadocs for 67 * java.util.TimeZone.getTimeZone(). 68 */ 69 @TagAttribute(type = "java.lang.Object") 70 void setTimeZone(ValueExpression timeZone); 71 72 73 /** 74 * Specifies what contents the string value will be formatted to include, or parsed expecting. Valid values are 75 * "date", "time", "both", "calendar", "localDate", "localDateTime", "localTime", "offsetTime", "offsetDateTime", and 76 * "zonedDateTime". The values starting with "local", "offset" and "zoned" correspond to Java SE 8 Date Time API 77 * classes in package java.time with the name derived by upper casing the first letter. For example, 78 * java.time.LocalDate for the value "localDate". Default value is "date". 79 */ 80 @TagAttribute() 81 void setType(String type); 82 }