Skip to content
This repository was archived by the owner on Apr 1, 2019. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/main/java/us/monoid/web/JSONResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ public JSONArray array() throws IOException, JSONException {
return (JSONArray)json;
}

/**
/* Parse and return a boolean value
/*
public boolean bool() throws IOException, JSONException {
return (boolean)unmarshal();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think unmarshal() should only be called if it hasn't been unmarshalled already, and the value cached in json be cast and returned

if (json == null) unmarshal();
return (boolean)json;

}

/**
* Parse and return JSON object. Parsing is done only once after which the inputStrem is at EOF.
* @return the JSON object
Expand Down