Sha256: 9aa65d22fc8a8f42da7dd045deb869aca4f5cbcc41f6d41b63c0db1796a7d2e0

Contents?: true

Size: 1.23 KB

Versions: 11

Compression:

Stored size: 1.23 KB

Contents

package com.rho.sync;
import org.json.me.JSONException;
import org.json.me.JSONObject;

class JSONEntry
{
    JSONObject m_object;
	
	JSONEntry(JSONObject obj)
	{
	    m_object = obj;
	}

	JSONEntry(String szData)throws JSONException
	{
	    m_object = new JSONObject(szData);
	}

	boolean isEmpty()
	{
	    return m_object == null;
	}

	boolean hasName(String name)
	{
		return m_object.has(name);
	}
	
	static String quoteValue(String str)
	{
		return JSONObject.quote(str);
	}
	
	String getString(String name)throws JSONException
	{
	    String szRes = null;
	    if ( m_object.has(name))
	    	szRes = m_object.getString(name);	    	
	
	    return szRes;
	}

	String getString()
	{
		return m_object.toString();
	}
	
	int getInt(String name)throws JSONException
	{
	    int nRes = 0;
	    if ( m_object.has(name))
	    	nRes = m_object.getInt(name);	    	
	
	    return nRes;
	}

	long getLong(String name)throws JSONException
	{
	    long nRes = 0;
	    if ( m_object.has(name))
	    	nRes = m_object.getLong(name);	    	
	
	    return nRes;
	}
	
	long getUInt64(String name)throws JSONException
	{
	    return getLong(name);
	}

	JSONEntry getEntry(String name)throws JSONException
	{
	    return new JSONEntry((JSONObject) m_object.get(name));
	}
}

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rhodes-2.0.3 platform/shared/rubyJVM/src/com/rho/sync/JSONEntry.java
rhodes-2.0.2 platform/shared/rubyJVM/src/com/rho/sync/JSONEntry.java
rhodes-2.0.0 platform/shared/rubyJVM/src/com/rho/sync/JSONEntry.java
rhodes-2.0.0.rc2 platform/shared/rubyJVM/src/com/rho/sync/JSONEntry.java
rhodes-2.0.0.rc1 platform/shared/rubyJVM/src/com/rho/sync/JSONEntry.java
rhodes-2.0.0.beta11 platform/shared/rubyJVM/src/com/rho/sync/JSONEntry.java
rhodes-2.0.0.beta10 platform/shared/rubyJVM/src/com/rho/sync/JSONEntry.java
rhodes-2.0.0.beta9 platform/shared/rubyJVM/src/com/rho/sync/JSONEntry.java
rhodes-2.0.0.beta8 platform/shared/rubyJVM/src/com/rho/sync/JSONEntry.java
rhodes-2.0.0.beta7 platform/shared/rubyJVM/src/com/rho/sync/JSONEntry.java
rhodes-2.0.0.beta6 platform/shared/rubyJVM/src/com/rho/sync/JSONEntry.java