Example usage for javax.json JsonException printStackTrace

List of usage examples for javax.json JsonException printStackTrace

Introduction

In this page you can find the example usage for javax.json JsonException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:com.mac.holdempoker.socket.MessageDecoder.java

/**
 * Checks whether the input can be turned into a valid Message object
 * in this case, if we can read it as a Json object, we can.
 * @param string//from w  ww. j  a v  a  2 s  . c o m
 * @return 
 */
@Override
public boolean willDecode(String string) {
    try {
        Json.createReader(new StringReader(string)).read();
        return true;
    } catch (JsonException ex) {
        ex.printStackTrace();
        return false;
    }
}

From source file:org.sample.whiteboard.FigureDecoder.java

@Override
public boolean willDecode(String string) {
    try {//w w w  .j  av  a  2 s .c om
        Json.createReader(new StringReader(string)).readObject();
        return true;
    } catch (JsonException ex) {
        ex.printStackTrace();
        return false;
    }
}