META-INF.maven-faces-plugin.validators.trinidad.ByteLength.xml Maven / Gradle / Ivy
<?xml version="1.0" ?> <!-- 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. --> <faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:tr="http://myfaces.apache.org/trinidad" xmlns:mfp="http://myfaces.apache.org/maven-faces-plugin" xmlns:fmd="http://java.sun.com/xml/ns/javaee/faces/design-time-metadata"> <validator> <description><![CDATA[Validate the byte length of strings when encoded.]]></description> <display-name>validateByteLength</display-name> <validator-id>org.apache.myfaces.trinidad.ByteLength</validator-id> <validator-class>org.apache.myfaces.trinidadinternal.validator.ByteLengthValidator</validator-class> <property> <description><![CDATA[Whether the converter should be disabled, default to false.]]> </description> <property-name>disabled</property-name> <property-class>boolean</property-class> <default-value>false</default-value> </property> <property> <description><![CDATA[maximum number of allowable bytes when the string is encoded]]></description> <property-name>maximum</property-name> <property-class>int</property-class> <property-extension> <mfp:property-metadata/> <fmd:property-metadata> <fmd:preferred>true</fmd:preferred> </fmd:property-metadata> </property-extension> </property> <property> <description><![CDATA[the Java encoding used for the string.]]></description> <property-name>encoding</property-name> <property-class>java.lang.String</property-class> <default-value>iso-8859-1</default-value> <property-extension> <mfp:property-metadata/> <fmd:property-metadata> <fmd:preferred>true</fmd:preferred> </fmd:property-metadata> </property-extension> </property> <property> <description><![CDATA[<p> Custom error message to be used, for creating detail part of faces message, when conversion fails for input that exceeds the maximum byte length. </p> <p> <strong> Parameters: </strong> <ul> <li> {0} the label that identifies the component </li> <li> {1} value entered by the user </li> <li> {2} the maximum length </li> </ul> </p>]]> </description> <property-name>messageDetailMaximum</property-name> <property-class>java.lang.String</property-class> <property-extension> <mfp:property-metadata> <mfp:translatable>true</mfp:translatable> </mfp:property-metadata> </property-extension> </property> <validator-extension> <mfp:tag-name>tr:validateByteLength</mfp:tag-name> <mfp:tag-class>org.apache.myfaces.trinidadinternal.taglib.validator.ValidateByteLengthTag</mfp:tag-class> <mfp:long-description><![CDATA[ <html:p>Validates the byte length of strings when encoded. The "maximumLength" attribute of inputText is similar, but it limits the number of characters that the user can enter. In some circumstances, the server must also limit the number of bytes required to store the string. This is very undesirable from a user interface perspective, since it is difficult for users to understand why they might be able to enter only 2 Japanese characters but 6 English characters! However, in cases where the backend will report this as an error anyway, it is better to report the problem before.</html:p> <html:p>The element allows developers to specify the encoding that should be used to define the byte length. This must be an encoding supported by the Java runtime, if not it will result in an exception and not a validation failure</html:p> <html:p>If the encoding is supported by JVM, and is a encoding that is not supported in the client side, then client side validation is disabled for this instance, while server side validation will continue to take place.</html:p> <html:p>The list of encodings that can be supported at the client side is as given below. <html:b>Note:</html:b> All the encodings listed might not be supported by JVM, and there can be other encodings, which the JVM may support, but might not be supported at the client side. </html:p> <html:p>Supported encodings are grouped as UTF-8, CJK encodings and Single byte encodings. Supported client side CJK encodings and Single byte encodings table:</html:p><html:br/> <html:table> <html:tr> <html:th>Single Byte Encodings</html:th> <html:th>CJK Encodings</html:th> </html:tr> <html:tr> <html:td>ascii</html:td> <html:td>shift_jis</html:td> </html:tr> <html:tr> <html:td>iso646-us</html:td> <html:td>ms_kanji</html:td> </html:tr> <html:tr> <html:td>iso_8859-1:1987</html:td> <html:td>csshiftjis</html:td> </html:tr> <html:tr> <html:td>iso-ir-100</html:td> <html:td>windows-31j</html:td> </html:tr> <html:tr> <html:td>iso_8859-1</html:td> <html:td>cswindows31j</html:td> </html:tr> <html:tr> <html:td>iso-8859-1</html:td> <html:td>ks_c_5601-1987</html:td> </html:tr> <html:tr> <html:td>latin1</html:td> <html:td>iso-ir-149</html:td> </html:tr> <html:tr> <html:td>l1</html:td> <html:td>ks_c_5601-1989</html:td> </html:tr> <html:tr> <html:td>ibm819</html:td> <html:td>ksc_5601</html:td> </html:tr> <html:tr> <html:td>cp819</html:td> <html:td>korean</html:td> </html:tr> <html:tr> <html:td>csisolatin1</html:td> <html:td>csksc56011987</html:td> </html:tr> <html:tr> <html:td>iso_8859-2:1987</html:td> <html:td>euc-kr</html:td> </html:tr> <html:tr> <html:td>iso-ir-101</html:td> <html:td>cseuckr</html:td> </html:tr> <html:tr> <html:td>iso_8859-2</html:td> <html:td>windows-949</html:td> </html:tr> <html:tr> <html:td>iso-8859-2</html:td> <html:td>gb2312</html:td> </html:tr> <html:tr> <html:td>latin2</html:td> <html:td>csgb2312</html:td> </html:tr> <html:tr> <html:td>l2</html:td> <html:td>chinese</html:td> </html:tr> <html:tr> <html:td>csisolatin2</html:td> <html:td>csiso58gb231280</html:td> </html:tr> <html:tr> <html:td>iso_8859-3:1988</html:td> <html:td>hz-gb-2312</html:td> </html:tr> <html:tr> <html:td>iso-ir-109</html:td> <html:td>gbk</html:td> </html:tr> <html:tr> <html:td>iso_8859-3</html:td> <html:td>cp936</html:td> </html:tr> <html:tr> <html:td>iso-8859-3</html:td> <html:td>ms936</html:td> </html:tr> <html:tr> <html:td>latin3</html:td> <html:td>windows-936</html:td> </html:tr> <html:tr> <html:td>l3</html:td> <html:td>big5</html:td> </html:tr> <html:tr> <html:td>csisolatin3</html:td> <html:td>csbig5</html:td> </html:tr> <html:tr> <html:td>iso_8859-4:1988</html:td> <html:td>windows-950</html:td> </html:tr> <html:tr> <html:td>iso-ir-110</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>iso_8859-4</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>iso-8859-4</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>latin4</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>l4</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>csisolatin4</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>iso_8859-5:1988</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>iso-ir-144</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>iso_8859-5</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>iso-8859-5</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cyrillic</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>csisolatincyrillic</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>iso_8859-6:1987</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>iso-ir-127</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>iso_8859-6</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>iso-8859-6</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ecma-114</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>asmo-708</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>arabic</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>csisolatinarabic</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>iso_8859-7:1987</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>iso-ir-126</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>iso_8859-7</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>iso-8859-7</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>elot_928</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ecma-118</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>greek</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>greek8</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>csisolatingreek</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>iso_8859-8:1988</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>iso-ir-138</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>iso_8859-8</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>iso-8859-8</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>hebrew</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>csisolatinhebrew</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>iso-ir-148</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>iso_8859-9</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>iso-8859-9</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>latin5</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>l5</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>csisolatin5</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>iso-8859-13</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>iso-8859-15</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>iso_8859-15</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm037</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp037</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm273</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp273</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm277</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm278</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp278</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>278</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm280</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp280</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm284</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp284</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm285</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp285</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm297</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp297</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm420</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp420</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>420</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm424</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp424</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm437</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp437</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>437</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cspc8codepage437</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm500</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp500</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm775</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp775</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm850</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp850</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>850</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cspc850multilingual</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm852</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp852</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>852</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cspcp852</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm855</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp855</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>855</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cspcp855</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm857</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp857</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>857</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>csibm857</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm860</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp860</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>860</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>csibm860</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm861</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp861</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp-is</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>861</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>csibm861</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm862</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp862</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>862</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cspc862latinhebrew</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm863</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp863</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>863</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>csibm863</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm864</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp864</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>csibm864</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm865</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp865</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>865</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>csibm865</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm866</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp866</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>866</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>csibm866</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm868</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp868</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm869</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp869</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>869</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp-gr</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>csibm869</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm870</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp870</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm871</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp871</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm918</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp918</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>ibm1026</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cp1026</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>windows-1250</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>windows-1251</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>windows-1252</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>windows-1253</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>windows-1254</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>windows-1255</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>windows-1256</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>windows-1257</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>windows-1258</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>koi8-r</html:td> <html:td> </html:td> </html:tr> <html:tr> <html:td>cskoi8r</html:td> <html:td> </html:td> </html:tr> </html:table> ]]> </mfp:long-description> <mfp:example> <mfp:source-code><![CDATA[<tr:inputText value="Four" label="Byte Length validation"> <tr:validateByteLength encoding="ISO-8859-1" maximum="4"/> </tr:inputText>]]> </mfp:source-code> </mfp:example> <mfp:author>Adam Winer</mfp:author> <mfp:validator-metadata> <mfp:favorite-property>maximum</mfp:favorite-property> </mfp:validator-metadata> </validator-extension> </validator> </faces-config>