Examples of ObjectValue


Examples of org.camunda.bpm.engine.variable.value.ObjectValue

    when(mockVariable.getId()).thenReturn(id);
    when(mockVariable.getName()).thenReturn(name);
    when(mockVariable.getTypeName()).thenReturn(typedValue.getType().getName());

    if (ObjectValue.class.isAssignableFrom(typedValue.getClass())) {
      ObjectValue objectValue = (ObjectValue) typedValue;
      if (objectValue.isDeserialized()) {
        when(mockVariable.getValue()).thenReturn(typedValue.getValue());
      } else {
        when(mockVariable.getValue()).thenReturn(null);
      }
    } else {
View Full Code Here

Examples of org.camunda.bpm.engine.variable.value.ObjectValue

    verify(variableInstanceQueryMock, times(1)).disableBinaryFetching();
  }

  @Test
  public void testGetSingleVariableInstanceDeserialized() {
    ObjectValue serializedValue = MockObjectValue.fromObjectValue(
        Variables.objectValue("a value").serializationDataFormat("aDataFormat").create())
        .objectTypeName("aTypeName");

    MockVariableInstanceBuilder builder = MockProvider.mockVariableInstance().typedValue(serializedValue);
    VariableInstance variableInstanceMock = builder.build();
View Full Code Here

Examples of org.camunda.bpm.engine.variable.value.ObjectValue

    verify(variableInstanceQueryMock, never()).disableCustomObjectDeserialization();
  }

  @Test
  public void testGetSingleVariableInstanceSerialized() {
    ObjectValue serializedValue = Variables.serializedObjectValue("a serialized value")
        .serializationDataFormat("aDataFormat").objectTypeName("aTypeName").create();

    MockVariableInstanceBuilder builder = MockProvider.mockVariableInstance().typedValue(serializedValue);
    VariableInstance variableInstanceMock = builder.build();
View Full Code Here

Examples of org.camunda.bpm.engine.variable.value.ObjectValue

  }

  @Test
  public void testGetSingleVariableInstanceDeserialized() {
    ObjectValue serializedValue = MockObjectValue.fromObjectValue(
        Variables.objectValue("a value").serializationDataFormat("aDataFormat").create())
        .objectTypeName("aTypeName");

    MockHistoricVariableInstanceBuilder builder = MockProvider.mockHistoricVariableInstance().typedValue(serializedValue);
    HistoricVariableInstance variableInstanceMock = builder.build();
View Full Code Here

Examples of org.exoplatform.ws.frameworks.json.value.impl.ObjectValue

   {
      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.exoplatform.ws.frameworks.json.value.impl.ObjectValue

            }

            return jsonArray;
         }
         case MAP :
            JsonValue jsonObject = new ObjectValue();
            Map<String, Object> map = new HashMap<String, Object>((Map<String, Object>)object);
            Set<String> keys = map.keySet();
            for (String k : keys)
            {
               Object o = map.get(k);
               if (JsonUtils.getType(o) != null)
               {
                  jsonObject.addElement(k, createJsonValue(o));
               }
               else
               {
                  jsonObject.addElement(k, createJsonObject(o));
               }
            }

            return jsonObject;
         default :
View Full Code Here

Examples of org.exoplatform.ws.frameworks.json.value.impl.ObjectValue

    */
   public void startObject()
   {
      if (current == null)
      {
         current = new ObjectValue();
         values.push(current);
         return;
      }
      ObjectValue o = new ObjectValue();
      if (current.isObject())
         current.addElement(key, o);
      else if (current.isArray())
         current.addElement(o);
      values.push(current);
View Full Code Here

Examples of org.overturetool.vdmj.values.ObjectValue

  private static List<ValueInfo> getNamePairListFromResult(Value value)
  {
    if (value instanceof ObjectValue)
    {
      ObjectValue objVal = ((ObjectValue) value);
      List<ValueInfo> values = new Vector<ValueInfo>();
      Set<String> existingFields = new HashSet<String>();

      for (NameValuePair child : objVal.members.asList())
      {
        existingFields.add(child.name.name);
        values.add(createValue(child.name, objVal.type.classdef, child.value, objVal.getCPU()));
      }

      // FIXME: Fix for BUG: 54536, problematic static initialization with more then 30 files
      // https://chessforge.chess-it.com/gf/project/destecs/tracker/?action=TrackerItemEdit&tracker_item_id=54536&start=0
      try
      {
        for (Field fi : objVal.type.classdef.getClass().getDeclaredFields())
        {
          if (fi.getName().equals("privateStaticValues"))
          {
            fi.setAccessible(true);
            NameValuePairMap privateStaticValues = (NameValuePairMap) fi.get(objVal.type.classdef);

            for (NameValuePair child : privateStaticValues.asList())
            {
              if (!existingFields.contains(child.name.name))
              {
                values.add(createValue(child.name, objVal.type.classdef, child.value, objVal.getCPU()));
              }
            }
          }
          if (fi.getName().equals("publicStaticValues"))
          {
            fi.setAccessible(true);
            NameValuePairMap privateStaticValues = (NameValuePairMap) fi.get(objVal.type.classdef);

            for (NameValuePair child : privateStaticValues.asList())
            {
              if (!existingFields.contains(child.name.name))
              {
                values.add(createValue(child.name, objVal.type.classdef, child.value, objVal.getCPU()));
              }
            }
          }
        }
View Full Code Here

Examples of org.pdf4j.saxon.value.ObjectValue

                connection = DriverManager.getConnection(dbString, userString, pwdString);
            } catch (Exception ex) {
                dynamicError("JDBC Connection Failure: " + ex.getMessage(), SaxonErrorCode.SXSQ0003, context);
            }

            return new ObjectValue(connection);

        }
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.