Package net.sf.json

Examples of net.sf.json.JSON


        // Disable type hints. When enable, a type attribute in the root
        // element will throw NPE.
        // http://sourceforge.net/mailarchive/message.php?msg_id=27646519
        xmlSerializer.setTypeHintsEnabled(false);
        xmlSerializer.setTypeHintsCompatibility(false);
        JSON json = xmlSerializer.read(xml);
        return json.toString(2);
    }
View Full Code Here


        JSONArray a = response.getJSONArray("response");
        if (a.iterator().hasNext()) {
          JSONObject j = (JSONObject) a.iterator().next();
          if (j.has("file") && j.has("xml")) {
            XMLSerializer xmls = new XMLSerializer();
            JSON info = xmls.read(j.getString("xml"));
            if (!info.isEmpty()) {
              if (info.isArray()) {
                json.put("response", info);
              }
              else {
                return (JSONObject)info;
              }
View Full Code Here

            trans.transform(source, result);
            String xmlString = sw.toString();

            //convert to json string
            XMLSerializer xmlSerializer = new XMLSerializer();
            JSON json = xmlSerializer.read(xmlString);
            String jsonString = json.toString(2);
            return jsonString;
        } catch (Exception e) {
            System.out.println(e);
        }
        return null;
View Full Code Here

   * @param exclude
   * @return
   */
  private static JSON baseJson(Object o, String[] excludeProperty,
      boolean exclude) {
    JSON json = JSONSerializer.toJSON(o,
        filterConfig(excludeProperty, exclude));
    return json;
  }
View Full Code Here

   * @param exclude
   * @return
   */
  private static JSON baseListJson(List list, String[] includePropertys,
      boolean exclude) {
    JSON json = JSONArray.fromObject(list,
        filterConfig(includePropertys, exclude));
    return json;
  }
View Full Code Here

     */
    public static Backlog get(RestClient restclient, RapidView rv)
        throws JiraException {

        final int rvId = rv.getId();
        JSON result = null;

        try {
            URI reporturi = restclient.buildURI(
                GreenHopperResource.RESOURCE_URI + "xboard/plan/backlog/data",
                new HashMap<String, String>() {{
View Full Code Here

     * @throws JiraException when the retrieval fails
     */
    public static User get(RestClient restclient, String username)
            throws JiraException {

        JSON result = null;

        Map<String, String> params = new HashMap<String, String>();
        params.put("username", username);

        try {
View Full Code Here

     * @throws JiraException when the retrieval fails
     */
    public static LinkType get(RestClient restclient, String id)
        throws JiraException {

        JSON result = null;

        try {
            result = restclient.get(getBaseUri() + "issueLinkType/" + id);
        } catch (Exception ex) {
            throw new JiraException("Failed to retrieve issue link type " + id, ex);
View Full Code Here

    public static JSONObject getCreateMetadata(
        RestClient restclient, String project, String issueType) throws JiraException {

        final String pval = project;
        final String itval = issueType;
        JSON result = null;

        try {
            URI createuri = restclient.buildURI(
                getBaseUri() + "issue/createmeta",
                new HashMap<String, String>() {{
View Full Code Here

        return projects.get(0).getIssueTypes().get(0).getFields();
    }

    private JSONObject getEditMetadata() throws JiraException {
        JSON result = null;

        try {
            result = restclient.get(getRestUri(key) + "/editmeta");
        } catch (Exception ex) {
            throw new JiraException("Failed to retrieve issue metadata", ex);
View Full Code Here

TOP

Related Classes of net.sf.json.JSON

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.