Package net.sf.json

Examples of net.sf.json.JSONObject.containsKey()


    this.attDescription = attDescription;
  }

  public boolean isKeyAvailable(String key){
    JSONObject descriptionObj = getJson();
    return descriptionObj.containsKey(key);
  }
 
  public String getStringAttribute(String key) {
    String value = null;
View Full Code Here


 
  public String getStringAttribute(String key) {
    String value = null;

    JSONObject descriptionObj = getJson();
    if( descriptionObj.containsKey(key) ) {
      value = descriptionObj.getString(key);
    }
   
    return value;
  }
View Full Code Here

    attDescription.setSavingRequired(true);
  }
 
  public void removeAttribute(String key) {
    JSONObject descriptionObj = getJson();
    if( descriptionObj.containsKey(key) ) {
      descriptionObj.remove(key);
      attDescription.setSavingRequired(true);
    }
  }
 
View Full Code Here

 
  protected String getStringAttribute(String key) {
    String value = null;

    JSONObject json = getJson();
    if( json.containsKey(key) ) {
      value = json.getString(key);
    }
   
    return value;
  }
View Full Code Here

  protected boolean getBooleanAttribute(String key) {
    boolean value = false;

    JSONObject json = getJson();
    if( json.containsKey(key) ) {
      value = json.getBoolean(key);
    }
   
    return value;
  }
View Full Code Here

  protected long getLongAttribute(String key) {
    long value = -1;

    JSONObject json = getJson();
    if( json.containsKey(key) ) {
      value = json.getLong(key);
    }
   
    return value;
  }
View Full Code Here

  protected int getIntAttribute(String key) {
    int value = -1;

    JSONObject json = getJson();
    if( json.containsKey(key) ) {
      value = json.getInt(key);
    }
   
    return value;
  }
View Full Code Here

    if( null == doc ) return false;
   
    JSONObject _att = doc.optJSONObject("_attachments");
    if( null == _att ) return false;
   
    return _att.containsKey(name);
  }
 
  public void removeFile(String name){
    if( null == doc ) return;
   
View Full Code Here

    if( null == doc ) return;
   
    JSONObject _att = doc.optJSONObject("_attachments");
    if( null == _att ) return;
   
    if( _att.containsKey(name) ) {
      _att.remove(name);
    }
   
    setSavingRequired(true);
  }
View Full Code Here

      if( false == couchDb.documentExists("_design/"+designDocName) ) {
        creationRequired = true;
      } else {
        // Check if it is the right signature
        JSONObject currentDesignDoc = couchDb.getDocument("_design/"+designDocName);
        if( false == currentDesignDoc.containsKey(DESIGN_DOC_SIG_KEY) ) {
          updateNeeded = true;
        } else {
          String currentSignature = currentDesignDoc.getString(DESIGN_DOC_SIG_KEY);
          if( false == signature.equals(currentSignature) ) {
            updateNeeded = true;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.