Package org.jboss.portal.common.util

Examples of org.jboss.portal.common.util.FormatConversionException


         }
         return Integer.parseInt(value);
      }
      catch (NumberFormatException e)
      {
         throw new FormatConversionException();
      }
   }
View Full Code Here


      {
         throw new NullConversionException();
      }
      else
      {
         throw new FormatConversionException();
      }
   }
View Full Code Here

      if (matcher.matches())
      {
         String language = matcher.group(1);
         if (Arrays.binarySearch(SORTED_ISO_LANGUAGES, language) < 0)
         {
            throw new FormatConversionException("Invalid ISO language code: " + language);
         }
         String country = matcher.group(3);
         if (country == null)
         {
            return new Locale(language);
         }
         else if (Arrays.binarySearch(SORTED_ISO_COUNTRIES, country) < 0)
         {
            throw new FormatConversionException("Invalid ISO country code: " + country);
         }
         return new Locale(language, country);
      }
      throw new FormatConversionException(value + " is not a valid compound language : accepted " +
         "format is xx-YY where xx is a valid ISO language code and YY is a valid country code. See " +
         "java.util.Locale javadoc for more info.");
   }
View Full Code Here

      int p2 = value.lastIndexOf('_', p1 - 1);
      if (p2 < 0)
      {
         if (a.length() == 0)
         {
            throw new FormatConversionException();
         }
         else
         {
            return factory.createLocale(value.substring(0, p1), a);
         }
      }

      //
      boolean emptyLanguage = p2 == p1 - 1;
      if (p2 == 0 && emptyLanguage)
      {
         throw new FormatConversionException();
      }

      //
      String b = emptyLanguage ? "" : value.substring(p2 + 1, p1);
View Full Code Here

      int p2 = value.lastIndexOf('_', p1 - 1);
      if (p2 < 0)
      {
         if (a.length() == 0)
         {
            throw new FormatConversionException();
         }
         else
         {
            return factory.createLocale(value.substring(0, p1), a);
         }
      }

      //
      boolean emptyLanguage = p2 == p1 - 1;
      if (p2 == 0 && emptyLanguage)
      {
         throw new FormatConversionException();
      }

      //
      String b = emptyLanguage ? "" : value.substring(p2 + 1, p1);
View Full Code Here

      if (matcher.matches())
      {
         String language = matcher.group(1);
         if (Arrays.binarySearch(SORTED_ISO_LANGUAGES, language) < 0)
         {
            throw new FormatConversionException("Invalid ISO language code: " + language);
         }
         String country = matcher.group(3);
         if (country == null)
         {
            return new Locale(language);
         }
         else if (Arrays.binarySearch(SORTED_ISO_COUNTRIES, country) < 0)
         {
            throw new FormatConversionException("Invalid ISO country code: " + country);
         }
         return new Locale(language, country);
      }
      throw new FormatConversionException(value + " is not a valid compound language : accepted " +
         "format is xx-YY where xx is a valid ISO language code and YY is a valid country code. See " +
         "java.util.Locale javadoc for more info.");
   }
View Full Code Here

         }
         return Integer.parseInt(value);
      }
      catch (NumberFormatException e)
      {
         throw new FormatConversionException();
      }
   }
View Full Code Here

      {
         throw new NullConversionException();
      }
      else
      {
         throw new FormatConversionException();
      }
   }
View Full Code Here

TOP

Related Classes of org.jboss.portal.common.util.FormatConversionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.