Package sun.org.mozilla.javascript.internal

Examples of sun.org.mozilla.javascript.internal.NativeArray


  public static Object getJSONproperty(String jsonText,String property) throws Exception{
    return parseJSON(jsonText).get(property, null);
  }
  public static Object[] getJSONarray(String jsonText,String array) throws Exception{
   
    final NativeArray obj = (NativeArray)parseJSON(jsonText).get(array, null);
    //System.out.println(obj.get(1, null));
    final Object[]arr=new Object[(int)obj.getLength()];
    for(int i=0;i<arr.length;i++){
      arr[i]=obj.get(i, null);
    }
    return arr;
  }
View Full Code Here


   
    engine.eval(new InputStreamReader(resourceStream));
    Bindings bindings = engine.getBindings(ScriptContext.ENGINE_SCOPE);
   
    { // read tails config
      NativeArray jsTails = (NativeArray) bindings.get("tails");
     
      this.tails = new Tail[(int) jsTails.getLength()];
     
      Map<String, Object> argumentMap = new HashMap<String, Object>();
     
      for (int i=0; i<jsTails.getLength(); ++i) {
        NativeObject object = (NativeObject) jsTails.get(i, null);
       
     
        argumentMap.clear();
        for (Object id: object.getIds()) {
          argumentMap.put(id.toString(), object.get(id.toString(), null));
View Full Code Here

TOP

Related Classes of sun.org.mozilla.javascript.internal.NativeArray

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.