// WARNING: This file was automatically generated. Do not edit it directly, // or you will lose your changes. /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package $utils.getPackageFromFullClass($converter.tagClass); import javax.faces.context.FacesContext; import javax.faces.convert.Converter; import javax.faces.el.ValueBinding; import javax.faces.webapp.UIComponentTag; import javax.servlet.jsp.JspException; import javax.servlet.jsp.PageContext; $utils.importTagClasses($converter) // Generated from class ${converter.sourceClassName}. // // WARNING: This file was automatically generated. Do not edit it directly, // or you will lose your changes. public class $utils.getClassFromFullClass($converter.tagClass) #if (${converter.tagSuperclass}) extends ${converter.tagSuperclass} #else extends javax.faces.webapp.ConverterTag #end { #if ($converter.serialuidtag) private static final long serialVersionUID = ${converter.serialuidtag}; #end public $utils.getClassFromFullClass($converter.tagClass)() { setConverterId("$converter.converterId"); } #set ($propertyList = ${converter.propertyTagList}) #foreach( $property in $propertyList ) #set ($field = $property.fieldName) #set ($type = $utils.getJspPropertyType11($property)) private $type $field; #set ($var = $utils.getVariableFromName($property.name)) public void $utils.getPrefixedPropertyName("set", $property.jspName)($type $var) { $field = $var; } #end public void setPageContext(PageContext context) { super.setPageContext(context); setConverterId("$converter.converterId"); } protected Converter createConverter() throws JspException { FacesContext facesContext = FacesContext.getCurrentInstance(); $converter.className converter = ($converter.className)super.createConverter(); #foreach( $property in $propertyList ) #set ($field = $property.fieldName) #set ($type = $utils.getJspPropertyType11($property)) #set ($className = $utils.getPrimitiveType($property.className)) if ($field != null) { if (UIComponentTag.isValueReference($field)) { ValueBinding vb = facesContext.getApplication().createValueBinding($field); #if ($utils.isPrimitiveClass($property.className)) converter.${utils.getPrefixedPropertyName("set",$property.name)}(${utils.getBoxedClass($className)}.valueOf(vb.getValue(facesContext).toString()).${property.className}Value()); #elseif ($utils.isPrimitiveClass($className)) converter.${utils.getPrefixedPropertyName("set",$property.name)}(${utils.getBoxedClass($className)}.valueOf(vb.getValue(facesContext).toString())); #elseif ($utils.getClassFromFullClass($property.className) == "String") converter.${utils.getPrefixedPropertyName("set",$property.name)}(new String(vb.getValue(facesContext).toString())); #elseif ($utils.getClassFromFullClass($property.className) == "Object") converter.${utils.getPrefixedPropertyName("set",$property.name)}(vb.getValue(facesContext)); #elseif ($utils.getClassFromFullClass($property.className) == "Locale") Object ${field}Value = vb.getValue(facesContext); if(${field}Value instanceof java.util.Locale) { converter.${utils.getPrefixedPropertyName("set",$property.name)}( (java.util.Locale) ${field}Value); } else { converter.${utils.getPrefixedPropertyName("set",$property.name)}( org.apache.myfaces.shared_tomahawk.util.LocaleUtils.converterTagLocaleFromString($field)); } #elseif ($utils.getClassFromFullClass($property.className) == "TimeZone") Object ${field}Value = vb.getValue(facesContext); if(${field}Value instanceof java.util.TimeZone) { converter.${utils.getPrefixedPropertyName("set",$property.name)}( (java.util.TimeZone) ${field}Value); } else { converter.${utils.getPrefixedPropertyName("set",$property.name)}( java.util.TimeZone.getTimeZone($field)); } #else converter.${utils.getPrefixedPropertyName("set",$property.name)}(($property.className) vb.getValue(facesContext)); #end } else { #if ($utils.isPrimitiveClass($property.className)) converter.${utils.getPrefixedPropertyName("set",$property.name)}(${utils.getBoxedClass($className)}.valueOf($field).${property.className}Value()); #elseif ($utils.isPrimitiveClass($className)) converter.${utils.getPrefixedPropertyName("set",$property.name)}(${utils.getBoxedClass($className)}.valueOf($field)); #elseif ($utils.getClassFromFullClass($property.className) == "Locale") converter.${utils.getPrefixedPropertyName("set",$property.name)}( org.apache.myfaces.shared_tomahawk.util.LocaleUtils.converterTagLocaleFromString($field)); #elseif ($utils.getClassFromFullClass($property.className) == "TimeZone") converter.${utils.getPrefixedPropertyName("set",$property.name)}( java.util.TimeZone.getTimeZone($field)); #elseif ($utils.getClassFromFullClass($property.className) == "Class") try { converter.${utils.getPrefixedPropertyName("set",$property.name)}( org.apache.myfaces.shared_tomahawk.util.ClassUtils.classForName($field)); } catch (ClassNotFoundException e) { throw new JspException(e); } #else converter.${utils.getPrefixedPropertyName("set",$property.name)}($field); #end } } #end return converter; } public void release() { super.release(); #foreach( $property in $propertyList ) #set ($field = $property.fieldName) #if($utils.getJspPropertyType11($property) == "boolean") #set ($empty = "false") #else #set ($empty = "null") #end $field = $empty; #end } }