[groovy-user] [ANN]VTD-XML 2.10
When I execute the following code from the Groovy Console, the whole
console exits! How do I modify the program so my program exits but
Groovy console does not so I can run the same program again?
Thanks,
siegfried
import javax.swing.JFrame;
import javax.swing.JLabel;
public class HelloWorldSwing {
public static void main(String[] args) {
JFrame frame = new JFrame("HelloWorldSwing");
final JLabel label = new JLabel("Hello World");
frame.getContentPane().add(label);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
}
}
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
On Feb 28, 2011, at 6:29 PM, <siegfried@...> <siegfried@...> wrote: > When I execute the following code from the Groovy Console, the whole > console exits! How do I modify the program so my program exits but > Groovy console does not so I can run the same program again? > > Thanks, > siegfried > > > > import javax.swing.JFrame; > import javax.swing.JLabel; > > public class HelloWorldSwing { > public static void main(String[] args) { > JFrame frame = new JFrame("HelloWorldSwing"); > final JLabel label = new JLabel("Hello World"); > frame.getContentPane().add(label); > > frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); use DISPOSE_ON_CLOSE instead. ^^^ will invoke System.exit(); --jason > frame.pack(); > frame.setVisible(true); > } > } > > > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Hi all,
I was trying to run a simple groovy script using shell.evaluate() method
========== java code ========================
binding.setProperty("out", outPw);
String scriptContent = "t1.TestB tb = new t1.TestB()\n tb.printVals()\n";
shell.evaluate(scriptContent);
========== java code ========================
TestB is another groovy script with definiton as
=================== TestB.groovy ==============================
package t1;
class TestB
{
public printVals()
{
println "Hello"
}
}
=================================================
When I execute the java code, it does not redirect the println output to the stream I set in binding. But any println I add in the script I use in shell.evalue() is properly redirected to my output stream. Can anybody help me ?
Thanks
dmantamp
okay, i see. i found the corresponding code in AsmClassGenerator.visitAnnotationAttributes where
class ClosureWriter is used to generate the closure class for closure attributes.
it seems closure class generation in 1.7.8 is completely handled in
AsmClassGenerator.createClosureClass. i guess i have to copy large parts of
ClosureWriter.createClosureClass to introduce a custom closurewriter, to be compatible with closure
generation in 1.8.
Am 28.02.2011 um 22:58 schrieb Peter Niederwieser:
> I'd probably try one of the following:
>
> 1. Rewrite the condition when the interface gets compiled (if necessary),
> compile it to a closure class (automatically done for you in Groovy 1.8),
> weave a call to the closure into implementing classes.
>
> 2. Save the condition as a string, and recompile it to get back the AST when
> rewriting implementors. This is similar to what Spock does with failed
> assertions.
>
> Cheers,
> Peter
>
>
> Andre Steingress wrote:
>>
>> hi all,
>>
>> i am currently working on interface contracts in gcontracts, that is,
>> allowing users to add <at> Requires and <at> Ensures to interface/abstract
>> methods.
>>
>> in the end i am struggling with one central problem. i've done a few
>> attempts but none of them seemed to solve the following problem without
>> causing major (programmer) pain ;)
>>
>> let's assume we've got interface Stackable:
>>
>> // ...
>> interface Stackable {
>>
>> <at> Requires({ !isEmpty() })
>> def pop()
>>
>> boolean isEmpty()
>> }
>>
>> during compilation of Stackable the closure expression is usually replaced
>> with some JVM compliant argument - Object.class, some String, etc. now
>> let's say we have a Stackable implementation class
>>
>> // assume Stackable.class is already on the classpath
>> class ArrayStack implements Stackable {
>> // ...
>> }
>>
>> when compiling ArrayStack.groovy and Stackable.class is already on the
>> classpath, information about the interface's closure expression would
>> already be lost. some approaches that came to my mind in order to regain
>> access to closure expressions: regenerating the AST for all affected
>> interfaces, introducing a stub class implementing the interface and
>> partially reusing its byte-code (but that would force me to do some magic
>> with ASM), temporarily store the assertion's byte code as annotation
>> argument (it starts to hurt), ...
>>
>> introducing an intermediate meta-data contract file would be an option,
>> but i want to get around doing this as long as possible.
>>
>> before i start to fiddle around with ASM byte code generation et al, i
>> wanted to know if you see a very obvious solution i've overlooked so far.
>> what would be the cleanest approach in terms of compliance to similar
>> parts in groovy?
>>
>> thx in advance!
>>
>> cheers, andre
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>> http://xircles.codehaus.org/manage_email
>>
>>
>>
>>
>
> --
> View this message in context: http://groovy.329449.n5.nabble.com/further-processing-of-closure-annotations-tp3404052p3404074.html
> Sent from the groovy - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
TestB is a class, it's not a script.
Hi all,
I was trying to run a simple groovy script using shell.evaluate() method
========== java code ========================
binding.setProperty("out", outPw);
String scriptContent = "t1.TestB tb = new t1.TestB()\n tb.printVals()\n";
shell.evaluate(scriptContent);
========== java code ========================
TestB is another groovy script with definiton as
=================== TestB.groovy ==============================
package t1;
class TestB
{
public printVals()
{
println "Hello"
}
}
=================================================
When I execute the java code, it does not redirect the println output to the stream I set in binding. But any println I add in the script I use in shell.evalue() is properly redirected to my output stream. Can anybody help me ?
Thanks
dmantamp
What's the relationship with Groovy?
VTD-XML 2.10 is now released under Java, C#, C and C++. It can be downloaded athttps://sourceforge.net/projects/vtd-xml/files/vtd-xml/ximpleware_2.10/. This release includes a number of new features and enhancement.* The core API of VTD-XML has been expanded. Users can now performcut/paste/insert on an empty element.* This release also adds the support of deeper location cache support for parsing and indexing. This feature is useful for application performance tuning for processing various XML documents.* The java version also added support for processing zip and gzip files. Direct processing of httpURL based XML is enhanced.* Extended Java version now support Iso-8859-10~16 encoding.* A full featured C++ port is released.* C version of VTD-XML now make use of thread local storage to achievethread safety for multi-threaded application.* There are also a number of bugs fixed. Special thanks to Jozef Aerts, John Sillers, Chris Tornau and a number of other users for input and suggestions
VTD-XML 2.10 is now released under Java, C#, C and C++. It can be downloaded athttps://sourceforge.net/projects/vtd-xml/files/vtd-xml/ximpleware_2.10/. This release includes a number of new features and enhancement.* The core API of VTD-XML has been expanded. Users can now performcut/paste/insert on an empty element.* This release also adds the support of deeper location cache support for parsing and indexing. This feature is useful for application performance tuning for processing various XML documents.* The java version also added support for processing zip and gzip files. Direct processing of httpURL based XML is enhanced.* Extended Java version now support Iso-8859-10~16 encoding.* A full featured C++ port is released.* C version of VTD-XML now make use of thread local storage to achievethread safety for multi-threaded application.* There are also a number of bugs fixed. Special thanks to Jozef Aerts, John Sillers, Chris Tornau and a number of other users for input and suggestions
Does it offer some special integration with or for Groovy?
A powerful, open source xml lib for java and groovyFrom: Guillaume LaforgeSent: Tuesday, March 01, 2011 1:01 AMSubject: Re: [groovy-user] [ANN]VTD-XML 2.10What's the relationship with Groovy?On Tue, Mar 1, 2011 at 02:33, jimmy Zhang <jzhang-cItsOz/cNAlZroRs9YW3xA@public.gmane.org> wrote:VTD-XML 2.10 is now released under Java, C#, C and C++. It can be downloaded athttps://sourceforge.net/projects/vtd-xml/files/vtd-xml/ximpleware_2.10/. This release includes a number of new features and enhancement.* The core API of VTD-XML has been expanded. Users can now performcut/paste/insert on an empty element.* This release also adds the support of deeper location cache support for parsing and indexing. This feature is useful for application performance tuning for processing various XML documents.* The java version also added support for processing zip and gzip files. Direct processing of httpURL based XML is enhanced.* Extended Java version now support Iso-8859-10~16 encoding.* A full featured C++ port is released.* C version of VTD-XML now make use of thread local storage to achievethread safety for multi-threaded application.* There are also a number of bugs fixed. Special thanks to Jozef Aerts, John Sillers, Chris Tornau and a number of other users for input and suggestions
--
Guillaume Laforge
Groovy Project Manager
Head of Groovy Development at SpringSource
http://www.springsource.com/g2one
Andre Steingress wrote: > > i guess i have to copy large parts of ClosureWriter.createClosureClass to > introduce a custom closurewriter, to be compatible with closure generation > in 1.8. > Alternatively, you could only support interface contracts for Groovy 1.8 and higher. Cheers, Peter -- -- View this message in context: http://groovy.329449.n5.nabble.com/further-processing-of-closure-annotations-tp3404052p3404719.html Sent from the groovy - user mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
RSS Feed251 | |
|---|---|
260 | |
475 | |
521 | |
277 | |
208 | |
206 | |
255 | |
280 | |
151 | |
278 | |
314 | |
220 | |
159 | |
389 | |
309 | |
238 | |
246 | |
258 | |
349 | |
558 | |
277 | |
336 | |
444 | |
554 | |
578 | |
560 | |
559 | |
473 | |
354 | |
342 | |
487 | |
386 | |
264 | |
405 | |
510 | |
529 | |
526 | |
608 | |
400 | |
764 | |
636 | |
573 | |
606 | |
577 | |
805 | |
666 | |
573 | |
646 | |
761 | |
948 | |
679 | |
866 | |
549 | |
602 | |
617 | |
765 | |
684 | |
693 | |
791 | |
1018 | |
1093 | |
818 | |
987 | |
1039 | |
1171 | |
1072 | |
946 | |
1078 | |
1152 | |
1101 | |
1138 | |
1503 | |
1579 | |
1578 | |
1233 | |
1522 | |
824 | |
650 | |
243 | |
1 | |
42 | |
251 | |
576 | |
656 | |
278 | |
291 | |
454 | |
498 | |
315 | |
339 | |
289 | |
487 | |
281 | |
201 | |
192 | |
286 | |
128 | |
333 | |
315 | |
204 | |
174 | |
186 | |
134 | |
241 | |
249 | |
213 | |
501 | |
495 | |
221 | |
46 |