incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r488571 - in /incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal: convert/ validator/
Date Tue, 19 Dec 2006 07:46:01 GMT
Author: matzew
Date: Mon Dec 18 23:46:00 2006
New Revision: 488571

URL: http://svn.apache.org/viewvc?view=rev&rev=488571
Log:
polish the converters/validators

Modified:
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ByteConverter.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ColorConverter.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ConverterUtils.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DoubleConverter.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/FloatConverter.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/IntegerConverter.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/LongConverter.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ShortConverter.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/ByteLengthValidator.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DateRestrictionValidator.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DateTimeRangeValidator.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DoubleRangeValidator.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/LongRangeValidator.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/RegExpValidator.java

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ByteConverter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ByteConverter.java?view=diff&rev=488571&r1=488570&r2=488571
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ByteConverter.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ByteConverter.java
Mon Dec 18 23:46:00 2006
@@ -124,7 +124,7 @@
       String maxVal,
       String minVal)
     {
-      StringBuffer outBuffer = new StringBuffer(250);
+      StringBuilder outBuffer = new StringBuilder(250);
 
       outBuffer.append("new TrByteConverter(");
 

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ColorConverter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ColorConverter.java?view=diff&rev=488571&r1=488570&r2=488571
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ColorConverter.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ColorConverter.java
Mon Dec 18 23:46:00 2006
@@ -70,7 +70,7 @@
     if (clientId != null)
     {
       // FIX - figure out size!!!
-      StringBuffer buff = new StringBuffer();
+      StringBuilder buff = new StringBuilder();
 
       Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
       // =-=JRF Only if Javascript...
@@ -142,9 +142,9 @@
     int patternsArgSize = _getPatternsArgSize();
 
     int size = 19 + patternsArgSize + 19;
-    StringBuffer sb = new StringBuffer(size);
+    StringBuilder sb = new StringBuilder(size);
 
-    StringBuffer patterns = new StringBuffer();
+    StringBuilder patterns = new StringBuilder();
     String[] setPatterns = getPatterns();
     for (int i = 0; i < setPatterns.length ; i++)
     {
@@ -225,8 +225,8 @@
     return size;
   }
 
-  // Appends the patterns argument to the StringBuffer
-  private void _appendPatternsArg(StringBuffer buffer)
+  // Appends the patterns argument to the StringBuilder
+  private void _appendPatternsArg(StringBuilder buffer)
   {
     String[] patterns = getPatterns();
     int count = patterns.length;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ConverterUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ConverterUtils.java?view=diff&rev=488571&r1=488570&r2=488571
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ConverterUtils.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ConverterUtils.java
Mon Dec 18 23:46:00 2006
@@ -217,7 +217,7 @@
     boolean isConverter,
     String validatorType)
   {
-    StringBuffer outBuffer = new StringBuffer(250);
+    StringBuilder outBuffer = new StringBuilder(250);
 
     if (isConverter)
       outBuffer.append("new TrNumberConverter(");
@@ -276,7 +276,7 @@
     UIComponent component,
     String defaultId)
   {
-    StringBuffer outBuffer = new StringBuffer(250);
+    StringBuilder outBuffer = new StringBuilder(250);
 
       outBuffer.append("new TrNumberConverter(");
 

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DoubleConverter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DoubleConverter.java?view=diff&rev=488571&r1=488570&r2=488571
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DoubleConverter.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DoubleConverter.java
Mon Dec 18 23:46:00 2006
@@ -94,7 +94,7 @@
       FacesContext context,
       UIComponent component)
     {
-      StringBuffer outBuffer = new StringBuffer(250);
+      StringBuilder outBuffer = new StringBuilder(250);
 
       outBuffer.append("new TrDoubleConverter(");
       outBuffer.append("'");

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/FloatConverter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/FloatConverter.java?view=diff&rev=488571&r1=488570&r2=488571
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/FloatConverter.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/FloatConverter.java
Mon Dec 18 23:46:00 2006
@@ -94,7 +94,7 @@
       FacesContext context,
       UIComponent component)
     {
-      StringBuffer outBuffer = new StringBuffer(250);
+      StringBuilder outBuffer = new StringBuilder(250);
 
       outBuffer.append("new TrFloatConverter(");
       outBuffer.append("'");

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/IntegerConverter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/IntegerConverter.java?view=diff&rev=488571&r1=488570&r2=488571
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/IntegerConverter.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/IntegerConverter.java
Mon Dec 18 23:46:00 2006
@@ -131,7 +131,7 @@
       String maxVal,
       String minVal)
     {
-      StringBuffer outBuffer = new StringBuffer(250);
+      StringBuilder outBuffer = new StringBuilder(250);
 
       outBuffer.append("new TrIntegerConverter(");
 

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/LongConverter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/LongConverter.java?view=diff&rev=488571&r1=488570&r2=488571
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/LongConverter.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/LongConverter.java
Mon Dec 18 23:46:00 2006
@@ -128,7 +128,7 @@
       String maxVal,
       String minVal)
     {
-      StringBuffer outBuffer = new StringBuffer(250);
+      StringBuilder outBuffer = new StringBuilder(250);
 
       outBuffer.append("new TrLongConverter(");
 

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ShortConverter.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ShortConverter.java?view=diff&rev=488571&r1=488570&r2=488571
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ShortConverter.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/ShortConverter.java
Mon Dec 18 23:46:00 2006
@@ -127,7 +127,7 @@
       String maxVal,
       String minVal)
     {
-      StringBuffer outBuffer = new StringBuffer(250);
+      StringBuilder outBuffer = new StringBuilder(250);
 
       outBuffer.append("new TrShortConverter(");
 

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/ByteLengthValidator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/ByteLengthValidator.java?view=diff&rev=488571&r1=488570&r2=488571
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/ByteLengthValidator.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/ByteLengthValidator.java
Mon Dec 18 23:46:00 2006
@@ -75,7 +75,7 @@
     int encodingType = _getType(getEncoding());
 
     //to create the constructor.
-    StringBuffer constr = new StringBuffer(150);
+    StringBuilder constr = new StringBuilder(150);
     switch(encodingType)
     {
       case _SINGLE_BYTE_TYPE :
@@ -136,7 +136,7 @@
     }
   }
   
-  private void _applyCustomMessage(FacesContext context, StringBuffer constr, String maxLength)
+  private void _applyCustomMessage(FacesContext context, StringBuilder constr, String maxLength)
   {
     String maxMsgDetail = getMessageDetailMaximum();
     if(maxMsgDetail != null)

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DateRestrictionValidator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DateRestrictionValidator.java?view=diff&rev=488571&r1=488570&r2=488571
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DateRestrictionValidator.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DateRestrictionValidator.java
Mon Dec 18 23:46:00 2006
@@ -116,7 +116,7 @@
       String weekdaysValues,
       String monthValues)
   {
-    StringBuffer outBuffer = new StringBuffer();
+    StringBuilder outBuffer = new StringBuilder(31 + weekdaysValues.length() + monthValues.length());
     outBuffer.append("new TrDateRestrictionValidator(");
     outBuffer.append(weekdaysValues);
     outBuffer.append(',');

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DateTimeRangeValidator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DateTimeRangeValidator.java?view=diff&rev=488571&r1=488570&r2=488571
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DateTimeRangeValidator.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DateTimeRangeValidator.java
Mon Dec 18 23:46:00 2006
@@ -93,7 +93,7 @@
       String max,
       String min)
   {
-    StringBuffer outBuffer = new StringBuffer();
+    StringBuilder outBuffer = new StringBuilder(31 + min.length() + max.length());
     outBuffer.append("new TrDateTimeRangeValidator(");
     outBuffer.append(max);
     outBuffer.append(',');

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DoubleRangeValidator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DoubleRangeValidator.java?view=diff&rev=488571&r1=488570&r2=488571
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DoubleRangeValidator.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/DoubleRangeValidator.java
Mon Dec 18 23:46:00 2006
@@ -74,7 +74,7 @@
       String max,
       String min)
   {
-    StringBuffer outBuffer = new StringBuffer();
+    StringBuilder outBuffer = new StringBuilder();
     outBuffer.append("new TrRangeValidator(");
     outBuffer.append(max);
     outBuffer.append(',');

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/LongRangeValidator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/LongRangeValidator.java?view=diff&rev=488571&r1=488570&r2=488571
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/LongRangeValidator.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/LongRangeValidator.java
Mon Dec 18 23:46:00 2006
@@ -74,7 +74,7 @@
       String max,
       String min)
   {
-    StringBuffer outBuffer = new StringBuffer();
+    StringBuilder outBuffer = new StringBuilder();
     outBuffer.append("new TrRangeValidator(");
     outBuffer.append(max);
     outBuffer.append(',');

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/RegExpValidator.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/RegExpValidator.java?view=diff&rev=488571&r1=488570&r2=488571
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/RegExpValidator.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/RegExpValidator.java
Mon Dec 18 23:46:00 2006
@@ -63,7 +63,7 @@
    
     String jsPattern = XhtmlUtils.escapeJS(getPattern());
     
-    StringBuffer outBuffer = new StringBuffer(22
+    StringBuilder outBuffer = new StringBuilder(22
                                               + jsPattern.length());
 
     outBuffer.append("new TrRegExpValidator('"); // 21
@@ -74,7 +74,7 @@
     return outBuffer.toString();
   }
   
-  private void _applyCustomMessage(FacesContext context, StringBuffer outBuffer)
+  private void _applyCustomMessage(FacesContext context, StringBuilder outBuffer)
   {
     String noMatchMsg = getMessageDetailNoMatch();
     if(noMatchMsg != null)
@@ -86,11 +86,7 @@
                                   noMatchMsg,
                                   params);
       String esNoMatchMsgPattern = XhtmlUtils.escapeJS(message.getDetail());
-      String esNoMatchMsgSummaryPattern = 
-                               XhtmlUtils.escapeJS(message.getSummary());
-      outBuffer.append("','");            //  7
-      outBuffer.append(esNoMatchMsgSummaryPattern);
-      outBuffer.append("','");            //  7
+      outBuffer.append("','");
       outBuffer.append(esNoMatchMsgPattern);
     }    
 



Mime
View raw message