Hi,

GWT does not emule the java.util.regex class

You should see
http://code.google.com/intl/fr/webtoolkit/doc/1.6/RefJreEmulation.html#Package_java_util
for more informations.

Mathieu Boniface

2009/5/18 poonam <poonam...@gmail.com>

>
> Hello,
>    I have developed an Validation application.And in that having
> different classes for Numeric Field, Alphabetic Field, Pattern
> Matching, etc.
> But when I import -
>  import java.util.regex.Matcher;
>  import java.util.regex.Pattern;
> I get errors as -
> The import java.util.regex cannot be resolved
> but,Pattern Matching is the requirement of the classes,
> I have send the class and detailed error message below.Please help or
> suggest what can I do?
> -----class -----
> public class NumericField implements Validation {
> public boolean validate() {
>
>    if(widgetToValidate.getText()!= "[0-9]") {
>        GWT.log("in validate() of RequiredField  ",null);
>
>         String regex = "[0-9]";
>         Pattern p = Pattern.compile(regex,Pattern.CASE_INSENSITIVE);
>         Matcher matcher = p.matcher(regex);
>         //boolean b = m.matches();
>
>                 if(matcher.find())
>        {
>                Window.alert("correct format");
>        }
>        return false;
>        }
>        return true;
>
>        }
>        }
>
> When I compile this program I get the errors below :
>
> D:\Validation>StudentInfo-compile
> Analyzing source in module 'com.company.StudentInfo'
>   [ERROR] Errors in 'D:\Validation\src\com\company\client
> \Alpahabetic.java'
>      [ERROR] Line 8:  The import java.util.regex cannot be resolved
>      [ERROR] Line 131:  PatternSyntaxException cannot be resolved to
> a type
>      [ERROR] Line 132:  ex cannot be resolved
>   [ERROR] Errors in 'D:\Validation\src\com\company\client
> \NumericField.java'
>      [ERROR] Line 5:  The import java.util.regex cannot be resolved
>      [ERROR] Line 6:  The import java.util.regex cannot be resolved
>      [ERROR] Line 73:  Pattern.CASE_INSENSITIVE cannot be resolved
>      [ERROR] Line 74:  Matcher cannot be resolved to a type
>      [ERROR] Line 74:  The method matcher(String) is undefined for
> the type Pattern
> Finding entry point classes
>   [ERROR] Unable to find type 'com.company.client.StudentInfo'
>      [ERROR] Hint: Previous compiler errors may have made this type
> unavailable
>      [ERROR] Hint: Check the inheritance chain from your module; it
> may not be inheriting a required module or a module
>  may not be adding its source path entries properly
> [ERROR] Build failed
>
> Thus, I am not able to solve the error : The import java.util.regex
> cannot be resolved
>
> How to solve it?
> Thanks.
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to