Examples of JsonValue


Examples of org.eclipse.rap.json.JsonValue

    super.addPaintListener( listener );
    super.addPaintListener( paintListener );
  }

  private void processClientDrawings( GC gc ) {
    JsonValue drawings = readEventPropertyValue( WidgetUtil.getId( this ), DRAWING_EVENT, DRAWINGS_PROPERTY );
    if( drawings != null ) {
      cacheDrawings( drawings.asString() );
      cache.clearRemoved();
      fireDrawEvent();
    }
    dispatchDrawings( gc );
  }
View Full Code Here

Examples of org.exoplatform.ws.frameworks.json.value.JsonValue

   {
      Method[] methods = object.getClass().getMethods();

      List<String> transientFields = getTransientFields(object.getClass());

      JsonValue jsonRootValue = new ObjectValue();

      for (Method method : methods)
      {
         String methodName = method.getName();

         /*
          * Method must be as follow:
          * 1. Name starts from "get" plus at least one character or starts from
          * "is" plus at least one more character and return boolean type
          * 2. Must be without parameters
          * 3. Must not be in list of skipped methods
          */

         String key = null;
         if (!SKIP_METHODS.contains(methodName) && method.getParameterTypes().length == 0)
         {
            if (methodName.startsWith("get") && methodName.length() > 3)
            {
               key = methodName.substring(3);
            }
            else if (methodName.startsWith("is") && methodName.length() > 2
               && (method.getReturnType() == Boolean.class || method.getReturnType() == boolean.class))
            {
               key = methodName.substring(2);
            }
         }

         if (key != null)
         {
            // First letter of key to lower case.
            key = (key.length() > 1) ? Character.toLowerCase(key.charAt(0)) + key.substring(1) : key.toLowerCase();
            // Check is this field in list of transient field.
            if (!transientFields.contains(key))
            {
               try
               {
                  // Get result of invoke method get...
                  Object invokeResult = method.invoke(object, new Object[0]);

                  if (JsonUtils.getType(invokeResult) != null)
                  {
                     jsonRootValue.addElement(key, createJsonValue(invokeResult));
                  }
                  else
                  {
                     jsonRootValue.addElement(key, createJsonObject(invokeResult));
                  }

               }
               catch (InvocationTargetException e)
               {
View Full Code Here

Examples of org.openjena.atlas.json.JsonValue

            args = new String[] {"-"} ;

        try {
            for ( String fn : args )
            {
                JsonValue json = JSON.readAny(fn) ;
                JSON.write(IndentedWriter.stdout, json) ;
                IndentedWriter.stdout.ensureStartOfLine() ;
            }
        } finally { IndentedWriter.stdout.flush() ; }
    }
View Full Code Here

Examples of se.llbit.json.JsonValue

  public void saveCameraPreset(String name) {
    cameraPresets.add(name, camera.toJson());
  }

  public void loadCameraPreset(String name) {
    JsonValue value = cameraPresets.get(name);
    if (!value.isUnknown()) {
      camera.fromJson(value.object());
    }
  }
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.