Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsJava via Epsilon Tools
https://www.eclipse.org/forums/index.php/mv/msg/153082/482096/#msg_482096
Originally posted by: d.clowes.lboro.ac.uk
Hi All,
I'm trying to execute some regular expression searches in a
transformation. The Java I need to execute uses the
Java.utils.regex.Pattern and Java.utils.regex.Matcher. Dimtitris kindly
pointed me to the Epsilon Tools documentation and I can follow the JFrame
example. However from what I can tell there is no default constructor for
Pattern, which is what I believe to be causing me the problems.
Pattern is typically called in Java by:
Pattern p = Pattern.compile('regex Srring');
I have tried:
# var pattern : new Native('java.util.regex.Pattern') :=
pattern.compile('Section ((\\d)[(\\.\\d)]*)');
# var pattern : new Native('java.util.regex.Pattern') :=
Pattern.compile('Section ((\\d)[(\\.\\d)]*)');
# var pattern : new Native('java.util.regex.Pattern') :=
java.util.regex.Pattern.compile('Section ((\\d)[(\\.\\d)]*)');
# var pattern : new Native('java.util.regex.Pattern');
All of which result in an EXCEPTION: Internal error:
java.lang.InstantiationException: java.util.regex.Pattern
Has anyone any suggestions to try.
Many thanks,
Darren]]>2009-08-25T11:23:30-00:00Re: Java via Epsilon Tools
https://www.eclipse.org/forums/index.php/mv/msg/153082/482108/#msg_482108
Since Pattern doesn't provide an accessible constructor - only the
static "compile" method, you should create your own tool that wraps
Pattern (using Java) and then call it from Epsilon.
Having said this, calling static methods seems like a useful feature
that should be supported natively by Epsilon. Would you mind opening an
enhancement request in the bugzilla for this?
Cheers,
Dimitris
Darren Clowes wrote:
> Hi All,
>
> I'm trying to execute some regular expression searches in a
> transformation. The Java I need to execute uses the
> Java.utils.regex.Pattern and Java.utils.regex.Matcher. Dimtitris kindly
> pointed me to the Epsilon Tools documentation and I can follow the
> JFrame example. However from what I can tell there is no default
> constructor for Pattern, which is what I believe to be causing me the
> problems.
>
> Pattern is typically called in Java by:
> Pattern p = Pattern.compile('regex Srring');
>
> I have tried:
> # var pattern : new Native('java.util.regex.Pattern') :=
> pattern.compile('Section ((\\d)[(\\.\\d)]*)');
> # var pattern : new Native('java.util.regex.Pattern') :=
> Pattern.compile('Section ((\\d)[(\\.\\d)]*)');
> # var pattern : new Native('java.util.regex.Pattern') :=
> java.util.regex.Pattern.compile('Section ((\\d)[(\\.\\d)]*)');
> # var pattern : new Native('java.util.regex.Pattern');
>
> All of which result in an EXCEPTION: Internal error:
> java.lang.InstantiationException: java.util.regex.Pattern
>
> Has anyone any suggestions to try.
>
> Many thanks,
>
> Darren
>]]>Dimitrios Kolovos2009-08-25T11:53:10-00:00Re: Java via Epsilon Tools
https://www.eclipse.org/forums/index.php/mv/msg/153082/579507/#msg_579507
Since Pattern doesn't provide an accessible constructor - only the
static "compile" method, you should create your own tool that wraps
Pattern (using Java) and then call it from Epsilon.
Having said this, calling static methods seems like a useful feature
that should be supported natively by Epsilon. Would you mind opening an
enhancement request in the bugzilla for this?
Cheers,
Dimitris
Darren Clowes wrote:
> Hi All,
>
> I'm trying to execute some regular expression searches in a
> transformation. The Java I need to execute uses the
> Java.utils.regex.Pattern and Java.utils.regex.Matcher. Dimtitris kindly
> pointed me to the Epsilon Tools documentation and I can follow the
> JFrame example. However from what I can tell there is no default
> constructor for Pattern, which is what I believe to be causing me the
> problems.
>
> Pattern is typically called in Java by:
> Pattern p = Pattern.compile('regex Srring');
>
> I have tried:
> # var pattern : new Native('java.util.regex.Pattern') :=
> pattern.compile('Section ((\\d)[(\\.\\d)]*)');
> # var pattern : new Native('java.util.regex.Pattern') :=
> Pattern.compile('Section ((\\d)[(\\.\\d)]*)');
> # var pattern : new Native('java.util.regex.Pattern') :=
> java.util.regex.Pattern.compile('Section ((\\d)[(\\.\\d)]*)');
> # var pattern : new Native('java.util.regex.Pattern');
>
> All of which result in an EXCEPTION: Internal error:
> java.lang.InstantiationException: java.util.regex.Pattern
>
> Has anyone any suggestions to try.
>
> Many thanks,
>
> Darren
>]]>Dimitrios Kolovos2009-08-25T11:53:10-00:00Re: Java via Epsilon Tools
https://www.eclipse.org/forums/index.php/mv/msg/153082/482114/#msg_482114
If you are using Epsilon from source, please update and then you can
simply write the following:
var pattern = Native('java.util.regex.Pattern').compile('\\d');
var matcher = pattern.matcher('Some text and 1 digit');
while (matcher.find()) {
matcher.start().println();
matcher.group().println();
matcher.end().println();
}
The change will appear in 0.8.7 - which should be released within the
next couple of days. I'll also update the EGL/Tomcat integration shortly.
Cheers,
Dimitris
Dimitris Kolovos wrote:
> Hi Darren,
>
> Since Pattern doesn't provide an accessible constructor - only the
> static "compile" method, you should create your own tool that wraps
> Pattern (using Java) and then call it from Epsilon.
>
> Having said this, calling static methods seems like a useful feature
> that should be supported natively by Epsilon. Would you mind opening an
> enhancement request in the bugzilla for this?
>
> Cheers,
> Dimitris
>
> Darren Clowes wrote:
>> Hi All,
>>
>> I'm trying to execute some regular expression searches in a
>> transformation. The Java I need to execute uses the
>> Java.utils.regex.Pattern and Java.utils.regex.Matcher. Dimtitris
>> kindly pointed me to the Epsilon Tools documentation and I can follow
>> the JFrame example. However from what I can tell there is no default
>> constructor for Pattern, which is what I believe to be causing me the
>> problems.
>>
>> Pattern is typically called in Java by:
>> Pattern p = Pattern.compile('regex Srring');
>>
>> I have tried:
>> # var pattern : new Native('java.util.regex.Pattern') :=
>> pattern.compile('Section ((\\d)[(\\.\\d)]*)');
>> # var pattern : new Native('java.util.regex.Pattern') :=
>> Pattern.compile('Section ((\\d)[(\\.\\d)]*)');
>> # var pattern : new Native('java.util.regex.Pattern') :=
>> java.util.regex.Pattern.compile('Section ((\\d)[(\\.\\d)]*)');
>> # var pattern : new Native('java.util.regex.Pattern');
>>
>> All of which result in an EXCEPTION: Internal error:
>> java.lang.InstantiationException: java.util.regex.Pattern
>>
>> Has anyone any suggestions to try.
>>
>> Many thanks,
>>
>> Darren
>>]]>Dimitrios Kolovos2009-08-25T12:22:47-00:00Re: Java via Epsilon Tools
https://www.eclipse.org/forums/index.php/mv/msg/153082/579520/#msg_579520
If you are using Epsilon from source, please update and then you can
simply write the following:
var pattern = Native('java.util.regex.Pattern').compile('\\d');
var matcher = pattern.matcher('Some text and 1 digit');
while (matcher.find()) {
matcher.start().println();
matcher.group().println();
matcher.end().println();
}
The change will appear in 0.8.7 - which should be released within the
next couple of days. I'll also update the EGL/Tomcat integration shortly.
Cheers,
Dimitris
Dimitris Kolovos wrote:
> Hi Darren,
>
> Since Pattern doesn't provide an accessible constructor - only the
> static "compile" method, you should create your own tool that wraps
> Pattern (using Java) and then call it from Epsilon.
>
> Having said this, calling static methods seems like a useful feature
> that should be supported natively by Epsilon. Would you mind opening an
> enhancement request in the bugzilla for this?
>
> Cheers,
> Dimitris
>
> Darren Clowes wrote:
>> Hi All,
>>
>> I'm trying to execute some regular expression searches in a
>> transformation. The Java I need to execute uses the
>> Java.utils.regex.Pattern and Java.utils.regex.Matcher. Dimtitris
>> kindly pointed me to the Epsilon Tools documentation and I can follow
>> the JFrame example. However from what I can tell there is no default
>> constructor for Pattern, which is what I believe to be causing me the
>> problems.
>>
>> Pattern is typically called in Java by:
>> Pattern p = Pattern.compile('regex Srring');
>>
>> I have tried:
>> # var pattern : new Native('java.util.regex.Pattern') :=
>> pattern.compile('Section ((\\d)[(\\.\\d)]*)');
>> # var pattern : new Native('java.util.regex.Pattern') :=
>> Pattern.compile('Section ((\\d)[(\\.\\d)]*)');
>> # var pattern : new Native('java.util.regex.Pattern') :=
>> java.util.regex.Pattern.compile('Section ((\\d)[(\\.\\d)]*)');
>> # var pattern : new Native('java.util.regex.Pattern');
>>
>> All of which result in an EXCEPTION: Internal error:
>> java.lang.InstantiationException: java.util.regex.Pattern
>>
>> Has anyone any suggestions to try.
>>
>> Many thanks,
>>
>> Darren
>>]]>Dimitrios Kolovos2009-08-25T12:22:47-00:00Re: Java via Epsilon Tools
https://www.eclipse.org/forums/index.php/mv/msg/153082/482121/#msg_482121
Originally posted by: d.clowes.lboro.ac.uk
Darren.]]>Darren 2009-08-25T12:47:35-00:00Re: Java via Epsilon Tools
https://www.eclipse.org/forums/index.php/mv/msg/153082/482131/#msg_482131
bugzilla and opened this
I've marked the one as a duplicate of the other so that's fine now.
Cheers,
Dimitris
Darren Clowes wrote:
> I think I created that correctly you should find the request available at:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=287549
>
> Darren.
>]]>Dimitrios Kolovos2009-08-25T13:12:27-00:00Re: Java via Epsilon Tools
https://www.eclipse.org/forums/index.php/mv/msg/153082/579554/#msg_579554
bugzilla and opened this
I've marked the one as a duplicate of the other so that's fine now.
Cheers,
Dimitris
Darren Clowes wrote:
> I think I created that correctly you should find the request available at:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=287549
>
> Darren.
>]]>Dimitrios Kolovos2009-08-25T13:12:27-00:00