Evaluating many expressions at once in Intellij Idea

后端 未结 4 1193
囚心锁ツ
囚心锁ツ 2021-01-13 04:12

In Intellij Idea, I\'m looking for a way to evaluate many expressions in debug mode with one command.

Normally I can evaluate single command with Right Click →

4条回答
  •  醉话见心
    2021-01-13 04:34

    well i was also struggling a lot with this, until i figured out that in the code it needs fully qualified paths for classes (for classes outside of java.*)

    for example in this code below , i needed to find out , xml string representation from the document object (doc is my document object)

    so i had to put this code into evaluate tab , which you can open from run window -after putting in below expression and clicking on evaluate - my xml string was printed in console

        javax.xml.transform.TransformerFactory tf = javax.xml.transform.TransformerFactory.newInstance();
        javax.xml.transform.Transformer transformer = tf.newTransformer();
        java.io.StringWriter writer = new java.io.StringWriter();
        transformer.transform(new javax.xml.transform.dom.DOMSource(doc), new javax.xml.transform.stream.StreamResult(writer));
        System.out.println(writer.getBuffer().toString());
    

提交回复
热议问题