You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2010/10/12 05:23:37 UTC
svn commit: r1021613 - in
/myfaces/commons/trunk/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter:
BooleanConverter.java DateTimeConverter.java EnumConverter.java
TypedNumberConverter.java
Author: lu4242
Date: Tue Oct 12 03:23:36 2010
New Revision: 1021613
URL: http://svn.apache.org/viewvc?rev=1021613&view=rev
Log:
MFCOMMONS-18 Use myfaces builder annotations instead doclets
Modified:
myfaces/commons/trunk/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/BooleanConverter.java
myfaces/commons/trunk/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/DateTimeConverter.java
myfaces/commons/trunk/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/EnumConverter.java
myfaces/commons/trunk/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/TypedNumberConverter.java
Modified: myfaces/commons/trunk/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/BooleanConverter.java
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/BooleanConverter.java?rev=1021613&r1=1021612&r2=1021613&view=diff
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/BooleanConverter.java (original)
+++ myfaces/commons/trunk/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/BooleanConverter.java Tue Oct 12 03:23:36 2010
@@ -19,12 +19,15 @@
package org.apache.myfaces.commons.converter;
-import javax.faces.component.UIComponent;
import javax.faces.component.StateHolder;
+import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFConverter;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFProperty;
+
/**
* Converter that translates between boolean values (true/false)
* and alternate versions of those boolean values like
@@ -39,13 +42,12 @@ import javax.faces.convert.ConverterExce
* The values are case sensitive.
* <p/>
*
- * @JSFConverter
- * name = "mcc:convertBoolean"
- * tagClass = "org.apache.myfaces.commons.converter.ConvertBooleanTag"
- * serialuidtag = "-6004262065580818687L"
- *
* @author Ken Weiner
*/
+@JSFConverter(
+ name = "mcc:convertBoolean",
+ tagClass = "org.apache.myfaces.commons.converter.ConvertBooleanTag",
+ serialuidtag = "-6004262065580818687L")
public class BooleanConverter implements Converter, StateHolder
{
@@ -64,8 +66,8 @@ public class BooleanConverter implements
/**
* Value representing a boolean false, e.g. FALSE, no, 0, etc.
*
- * @JSFProperty
*/
+ @JSFProperty
public String getFalseValue()
{
return falseValue;
@@ -79,8 +81,8 @@ public class BooleanConverter implements
/**
* Value representing a boolean true, e.g. TRUE, yes, 1, etc.
*
- * @JSFProperty
*/
+ @JSFProperty
public String getTrueValue()
{
return trueValue;
Modified: myfaces/commons/trunk/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/DateTimeConverter.java
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/DateTimeConverter.java?rev=1021613&r1=1021612&r2=1021613&view=diff
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/DateTimeConverter.java (original)
+++ myfaces/commons/trunk/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/DateTimeConverter.java Tue Oct 12 03:23:36 2010
@@ -22,22 +22,24 @@ package org.apache.myfaces.commons.conve
import java.util.Locale;
import java.util.TimeZone;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFConverter;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFProperty;
+
/**
* Simple convert that overrides the spec DateTimeConverter and uses TimeZone.getDefault() as the
* base timezone, rather than GMT.
*
* Convert date time using normal system timezone like it should
*
- * @JSFConverter
- * name = "mcc:convertDateTime"
- * tagClass = "org.apache.myfaces.commons.converter.ConvertDateTimeTag"
- * tagSuperclass = "org.apache.myfaces.commons.converter.ConverterTag"
- * serialuidtag = "1542071733367150635L"
- *
* User: treeder
* Date: Oct 28, 2005
* Time: 7:19:01 PM
*/
+@JSFConverter(
+ name = "mcc:convertDateTime",
+ tagClass = "org.apache.myfaces.commons.converter.ConvertDateTimeTag",
+ tagSuperclass = "org.apache.myfaces.commons.converter.ConverterTag",
+ serialuidtag = "1542071733367150635L")
public class DateTimeConverter extends javax.faces.convert.DateTimeConverter
{
public static final String CONVERTER_ID = "org.apache.myfaces.custom.convertDateTime.DateTimeConverter";
@@ -50,9 +52,8 @@ public class DateTimeConverter extends j
/**
* longDesc = "default|short|medium|long|full"
*
- * @JSFProperty
- * inheritedTag = "false"
*/
+ @JSFProperty(inheritedTag = false)
public String getDateStyle()
{
return super.getDateStyle();
@@ -61,9 +62,8 @@ public class DateTimeConverter extends j
/**
* longDesc = "locale"
*
- * @JSFProperty name = "locale"
- * inheritedTag = "false"
*/
+ @JSFProperty(inheritedTag = false)
public Locale getLocale()
{
return super.getLocale();
@@ -72,9 +72,8 @@ public class DateTimeConverter extends j
/**
* Custom formatting pattern
*
- * @JSFProperty
- * inheritedTag = "false"
*/
+ @JSFProperty(inheritedTag = false)
public String getPattern()
{
return super.getPattern();
@@ -83,9 +82,8 @@ public class DateTimeConverter extends j
/**
* default|short|medium|long|full
*
- * @JSFProperty
- * inheritedTag = "false"
*/
+ @JSFProperty(inheritedTag = false)
public String getTimeStyle()
{
return super.getTimeStyle();
@@ -94,9 +92,8 @@ public class DateTimeConverter extends j
/**
* timeZome
*
- * @JSFProperty
- * inheritedTag = "false"
*/
+ @JSFProperty(inheritedTag = false)
public TimeZone getTimeZone()
{
return super.getTimeZone();
@@ -105,9 +102,8 @@ public class DateTimeConverter extends j
/**
* date|time|both
*
- * @JSFProperty
- * inheritedTag = "false"
*/
+ @JSFProperty(inheritedTag = false)
public String getType()
{
return super.getType();
Modified: myfaces/commons/trunk/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/EnumConverter.java
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/EnumConverter.java?rev=1021613&r1=1021612&r2=1021613&view=diff
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/EnumConverter.java (original)
+++ myfaces/commons/trunk/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/EnumConverter.java Tue Oct 12 03:23:36 2010
@@ -18,27 +18,29 @@
*/
package org.apache.myfaces.commons.converter;
-import org.apache.myfaces.commons.util.MessageUtils;
-
+import javax.faces.application.FacesMessage;
import javax.faces.component.StateHolder;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
-import javax.faces.application.FacesMessage;
+
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFConverter;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFProperty;
+import org.apache.myfaces.commons.util.MessageUtils;
/**
* Converts a Java 5 Enum.
*
* see Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.2/docs/api/index.html">JSF Specification</a>
*
- * @JSFConverter
- * name = "mcc:convertEnum"
- * tagClass = "org.apache.myfaces.commons.converter.ConvertEnumTag"
- * serialuidtag = "3864584277821896141L"
*
* @author Stan Silvert
*/
+@JSFConverter(
+ name = "mcc:convertEnum",
+ tagClass = "org.apache.myfaces.commons.converter.ConvertEnumTag",
+ serialuidtag = "3864584277821896141L")
public class EnumConverter implements Converter, StateHolder {
public static final String CONVERTER_ID = "org.apache.myfaces.commons.converter.Enum";
@@ -184,8 +186,8 @@ public class EnumConverter implements Co
/**
* The enum class to be used for this converter as reference
*
- * @JSFProperty
*/
+ @JSFProperty
public Class getTargetClass()
{
return targetClass;
Modified: myfaces/commons/trunk/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/TypedNumberConverter.java
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/TypedNumberConverter.java?rev=1021613&r1=1021612&r2=1021613&view=diff
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/TypedNumberConverter.java (original)
+++ myfaces/commons/trunk/myfaces-commons-converters/src/main/java/org/apache/myfaces/commons/converter/TypedNumberConverter.java Tue Oct 12 03:23:36 2010
@@ -34,6 +34,8 @@ import javax.faces.convert.ConverterExce
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.beanutils.Converter;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFConverter;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFProperty;
import org.apache.myfaces.commons.util.MessageUtils;
/**
@@ -46,13 +48,13 @@ import org.apache.myfaces.commons.util.M
*
* Unless otherwise specified, all attributes accept static values or EL expressions.
*
- * @JSFConverter
- * name = "mcc:convertNumber"
- * tagClass = "org.apache.myfaces.commons.converter.TypedNumberConverterTag"
- * serialuidtag = "-6592309048440572608L"
*
* @author imario@apache.org
*/
+@JSFConverter(
+ name = "mcc:convertNumber",
+ tagClass = "org.apache.myfaces.commons.converter.TypedNumberConverterTag",
+ serialuidtag = "-6592309048440572608L")
public class TypedNumberConverter implements javax.faces.convert.Converter, StateHolder
{
public static final String CONVERTER_ID = "org.apache.myfaces.custom.convertNumber.TypedNumberConverter";
@@ -344,8 +346,8 @@ public class TypedNumberConverter implem
/**
* ISO 4217 currency code
*
- * @JSFProperty
*/
+ @JSFProperty
public String getCurrencyCode()
{
return _currencyCode != null ?
@@ -363,8 +365,8 @@ public class TypedNumberConverter implem
*
* Defaults to the currency symbol for locale.
*
- * @JSFProperty
*/
+ @JSFProperty
public String getCurrencySymbol()
{
return _currencySymbol != null ?
@@ -382,8 +384,8 @@ public class TypedNumberConverter implem
*
* Default: true.
*
- * @JSFProperty
*/
+ @JSFProperty
public boolean isGroupingUsed()
{
return _groupingUsed;
@@ -399,8 +401,8 @@ public class TypedNumberConverter implem
*
* Default: false.
*
- * @JSFProperty
*/
+ @JSFProperty
public boolean isIntegerOnly()
{
return _integerOnly;
@@ -415,8 +417,8 @@ public class TypedNumberConverter implem
* The name of the locale to be used, instead of the default as specified
* in the faces configuration file.
*
- * @JSFProperty
*/
+ @JSFProperty
public Locale getLocale()
{
if (_locale != null) return _locale;
@@ -432,8 +434,8 @@ public class TypedNumberConverter implem
/**
* The maximum number of digits in the fractional portion of the number.
*
- * @JSFProperty
*/
+ @JSFProperty
public int getMaxFractionDigits()
{
return _maxFractionDigits;
@@ -448,8 +450,8 @@ public class TypedNumberConverter implem
/**
* The maximum number of digits in the integer portion of the number.
*
- * @JSFProperty
*/
+ @JSFProperty
public int getMaxIntegerDigits()
{
return _maxIntegerDigits;
@@ -464,8 +466,8 @@ public class TypedNumberConverter implem
/**
* The minimum number of digits in the fractional portion of the number.
*
- * @JSFProperty
*/
+ @JSFProperty
public int getMinFractionDigits()
{
return _minFractionDigits;
@@ -480,8 +482,8 @@ public class TypedNumberConverter implem
/**
* The minimum number of digits in the integer portion of the number.
*
- * @JSFProperty
*/
+ @JSFProperty
public int getMinIntegerDigits()
{
return _minIntegerDigits;
@@ -496,8 +498,8 @@ public class TypedNumberConverter implem
/**
* A custom Date formatting pattern, in the format used by java.text.SimpleDateFormat.
*
- * @JSFProperty
*/
+ @JSFProperty
public String getPattern()
{
return _pattern;
@@ -523,8 +525,8 @@ public class TypedNumberConverter implem
*
* Values include: number, currency, and percentage. Default: number.
*
- * @JSFProperty
*/
+ @JSFProperty
public String getType()
{
return _type;