org.apache.felix.dm.runtime
Class JSONMetaData

java.lang.Object
  extended by org.apache.felix.dm.runtime.JSONMetaData
All Implemented Interfaces:
Cloneable, MetaData

public class JSONMetaData
extends Object
implements MetaData, Cloneable

A JSON MetaData.


Constructor Summary
JSONMetaData(org.json.JSONObject jso)
          Decodes a JSON metadata for either a Service or a Dependency descriptor entry.
 
Method Summary
 Object clone()
          Close this class instance to another one.
  getDictionary(Params key,  def)
          Returns a descriptor entry value which is a complex value.
 int getInt(Params key)
          Returns a String descriptor entry parameter value.
 int getInt(Params key, int def)
          Returns a String descriptor entry parameter value.
 long getLong(Params key)
          Returns a String descriptor entry parameter value.
 long getLong(Params key, long def)
          Returns a String descriptor entry parameter value.
 String getString(Params key)
          Returns a String descriptor entry parameter value.
 String getString(Params key, String def)
          Returns a String descriptor entry parameter value.
 String[] getStrings(Params key)
          Returns a String array descriptor entry parameter value.
 String[] getStrings(Params key, String[] def)
          Returns a String array descriptor entry parameter value.
 void setDictionary(Params key,  dictionary)
          Modifies a String[] value.
 void setString(Params key, String value)
          Modifies a key Sring value
 void setStrings(Params key, String[] values)
          Modifies a String[] value.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JSONMetaData

public JSONMetaData(org.json.JSONObject jso)
             throws org.json.JSONException
Decodes a JSON metadata for either a Service or a Dependency descriptor entry. The JSON object values contains either some of the following types: a String, a String[], or a Dictionary of String/String[].

Parameters:
jso - the JSON object that corresponds to a dependency manager descriptor entry line.
Throws:
org.json.JSONException
Method Detail

clone

public Object clone()
             throws CloneNotSupportedException
Close this class instance to another one.

Specified by:
clone in interface MetaData
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

getString

public String getString(Params key)
Description copied from interface: MetaData
Returns a String descriptor entry parameter value.

Specified by:
getString in interface MetaData

getString

public String getString(Params key,
                        String def)
Description copied from interface: MetaData
Returns a String descriptor entry parameter value.

Specified by:
getString in interface MetaData

getInt

public int getInt(Params key)
Description copied from interface: MetaData
Returns a String descriptor entry parameter value.

Specified by:
getInt in interface MetaData

getInt

public int getInt(Params key,
                  int def)
Description copied from interface: MetaData
Returns a String descriptor entry parameter value.

Specified by:
getInt in interface MetaData

getLong

public long getLong(Params key)
Description copied from interface: MetaData
Returns a String descriptor entry parameter value.

Specified by:
getLong in interface MetaData

getLong

public long getLong(Params key,
                    long def)
Description copied from interface: MetaData
Returns a String descriptor entry parameter value.

Specified by:
getLong in interface MetaData

getStrings

public String[] getStrings(Params key)
Description copied from interface: MetaData
Returns a String array descriptor entry parameter value.

Specified by:
getStrings in interface MetaData

getStrings

public String[] getStrings(Params key,
                           String[] def)
Description copied from interface: MetaData
Returns a String array descriptor entry parameter value.

Specified by:
getStrings in interface MetaData

getDictionary

public  getDictionary(Params key,
                            def)
Description copied from interface: MetaData
Returns a descriptor entry value which is a complex value.

Specified by:
getDictionary in interface MetaData

toString

public String toString()
Overrides:
toString in class Object

setDictionary

public void setDictionary(Params key,
                           dictionary)
Description copied from interface: MetaData
Modifies a String[] value.

Specified by:
setDictionary in interface MetaData

setString

public void setString(Params key,
                      String value)
Description copied from interface: MetaData
Modifies a key Sring value

Specified by:
setString in interface MetaData

setStrings

public void setStrings(Params key,
                       String[] values)
Description copied from interface: MetaData
Modifies a String[] value.

Specified by:
setStrings in interface MetaData


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.