Examples of DataObject


Examples of br.org.scadabr.dnp34j.master.common.DataObject

        if (!discard) {
          for (int i = 0; i < values.length; i++) {
            values[i] = Utils.byte2int(aFrame.readByte());

            int length = (dataLength + 7) / 8;
            dataObjects[i] = new DataObject(group, variation,
                aFrame.readBytes(length));
          }

          dataMap.set(group, variation, values, dataObjects,
              qualField);
        } else {
          dataLength *= -1;
          int numBytes = (dataLength / 8) * values.length
              + values.length;
          aFrame.readBytes(numBytes);
        }
      }

        break;

      case INDEXES_16: {
        int[] values = new int[(Utils.byte2int(aFrame.readByte()) + ((aFrame
            .readByte() << 8) & 0xFF00))];
        DataObject[] dataObjects = new DataObject[values.length];

        if (!discard) {
          for (int i = 0; i < values.length; i++) {
            values[i] = (Utils.byte2int(aFrame.readByte()) + ((aFrame
                .readByte() << 8) & 0xFF00));

            int length = (dataLength + 7) / 8;
            dataObjects[i] = new DataObject(group, variation,
                aFrame.readBytes(length));
          }

          dataMap.set(group, variation, values, dataObjects,
              qualField);
View Full Code Here

Examples of com.art.anette.datamodel.dataobjects.simple.DataObject

        }
    }

    private static Object clone(Object object) {
        if (object instanceof DataObject) {
            DataObject dataObject = (DataObject) object;
            return dataObject.clone();
        } else {
            return object;
        }
    }
View Full Code Here

Examples of com.crashnote.core.model.data.DataObject


    // INTERFACE ==================================================================================

    public DataObject collect() {
        final DataObject data = createDataObj();
        {
            data.putObj("app", getAppData());
            data.putObj("runtime", getRtData());
            data.putObj("system", getSysData());
            data.putObj("device", getDevData());
        }
        return data;
    }
View Full Code Here

Examples of com.projity.server.data.DataObject

    return super.canUndo();
  }
  public String getPresentationName() {
    String s="Schedule";
    if (schedule!=null&&schedule instanceof DataObject){
      DataObject data=(DataObject)schedule;
      String cn=schedule.getClass().getName();
      cn=cn.substring(cn.lastIndexOf('.')+1);
      s+=": "+cn+" "+data.getName()+"("+data.getUniqueId()+")";
    }
    return s;
  }
View Full Code Here

Examples of commonj.sdo.DataObject

         
          "DataObject customerType = scope.getDataFactory().create(\"commonj.sdo\", \"Type\");\n"+
          "customerType.set(\"uri\", \"http://example.com/customer\");\n"+
          "customerType.set(\"name\", \"Customer\");");
     
      DataObject customerType = scope.getDataFactory().create("commonj.sdo", "Type");
      customerType.set("uri", "http://example.com/customer");
      customerType.set("name", "Customer");
     
      commentary("Now we can create a model for the Properties for the Type\n"+
          "and set the name and Types of those Properties\n\n"+
          "DataObject custNumProperty = customerType.createDataObject(\"property\");\n"+
          "custNumProperty.set(\"name\", \"custNum\");\n"+
          "custNumProperty.set(\"type\", intType);"
      );
     
      DataObject custNumProperty = customerType.createDataObject("property");
      custNumProperty.set("name", "custNum");
      custNumProperty.set("type", intType);
     
      commentary("We continue in this manner until all the Types and their Properties are modelled");
      DataObject lastNameProperty = customerType.createDataObject("property");
      lastNameProperty.set("name", "lastName");
      lastNameProperty.set("type", stringType);
     
      DataObject firstNameProperty = customerType.createDataObject("property");
      firstNameProperty.set("name", "firstName");
      firstNameProperty.set("type", stringType);
     
      commentary("Now that our type is fully modelled we submit the model to the TypeHelper\n"+
          "The new Type instance is retuend to us,  but is also available for lookup within\n"+
          "the scope associated with the TypeHelper\n\n"+
          "Type t = typeHelper.define(customerType);");
      Type t = typeHelper.define(customerType);
     
      commentary("Here we see the newly created Type being accessed via the TypeHelper\n"+
          "along with a printout of the Type's Properties\n\n"+
          "Type testType = scope.getTypeHelper().getType(\"http://example.com/customer\", \"Customer\");");
     
      Type testType = scope.getTypeHelper().getType("http://example.com/customer", "Customer");
      List props = testType.getProperties();
      for (int i = 0; i < props.size(); i++) {
          System.out.println(props.get(i));
      }

      commentary("Now we can create an instance of the type using the DataFactory associated with the type scope\n\n"+
          "DataFactory factory = scope.getDataFactory();\n"+
          "DataObject customer1 = factory.create(\"http://example.com/customer\", \"Customer\");");

      DataFactory factory = scope.getDataFactory();
      DataObject customer1 = factory.create("http://example.com/customer", "Customer");
      customer1.setInt("custNum", 1);
      customer1.set("firstName", "John");
      customer1.set("lastName", "Adams");

      commentary("Here's an XML String representing a DataObject we have created with the new type");
      String xmlDocString = scope.getXMLHelper().save(customer1, CUSTOMER_NAMESPACE, "customer");
      System.out.println(xmlDocString);
View Full Code Here

Examples of commonj.sdo.DataObject

        commentary(
            "First we create the type system using an XML Schema file and then create\n"+
            "A DataObject using an XML document for convenience");
       
        loadTypesFromXMLSchemaFile(scope, SampleInfrastructure.PO_XSD_RESOURCE);
        DataObject purchaseOrder = getDataObjectFromFile(scope, SampleInfrastructure.PO_XML_RESOURCE);



        commentary(
            "Accessing data from the purchase order using the DataObjects XPath style methods\n");
       

        System.out.println("First we use the simplest kind of path\n" +
            "purchaseOrder.getString(\"billTo/name\")\n" +
            "The purchase is to be paid for by .... " +
            purchaseOrder.getString("billTo/name"));
       
       
        System.out.println("\nThen we use indexing by integer starting from 1\n" +
            "purchaseOrder.getString(\"items/item[1]/productName\"\n" +
            "The first item in the order is a ... " +
            purchaseOrder.getString("items/item[1]/productName"));
       
      
        System.out.println("\nThe alternative style of indexing uses a . notation and starts from 0\n"+
            "purchaseOrder.getFloat(\"items/item.0/price\")\n" +
            "The price of this item is ... " +
            purchaseOrder.getFloat("items/item.0/price"));
       

        System.out.println("\nDataObjects can be looked up by supplying the value of one of the contained simple valued Properties\n"+
            "DataObject babyMonitorItem = purchaseOrder.getDataObject(\"items/item[productName=\\\"Baby Monitor\\\"]");
               
        DataObject babyMonitorItem = purchaseOrder.getDataObject("items/item[productName=\"Baby Monitor\"]");
        System.out.println("The price of the Baby Monitor is .... " +
        babyMonitorItem.getFloat("price"));
       
       
        System.out.println("\nA parent DataObject can be accessed with the .. notation\n"+
            "List onlyIfBuyingGrassSeed = purchaseOrder.getList(\"items/item[productName=GrassSeed]/../item\");");
        List onlyIfBuyingGrassSeed = purchaseOrder.getList("items/item[productName=GrassSeed]/../item");
View Full Code Here

Examples of commonj.sdo.DataObject

            Command select = das.createCommand("SELECT firstName, lastName, loginID, password, id FROM customers where loginID = ?");

            select.setParameter(1, logonID);

            DataObject root = select.executeQuery();
            conn.close();

            Collection customers = root.getList("CustomerProfileData");
            CustomerProfileData customerProfileData = (CustomerProfileData) customers.iterator().next();

            return customerProfileData;
        } catch (Exception e) {
View Full Code Here

Examples of commonj.sdo.DataObject

        try {
            DAS das = DAS.FACTORY.createDAS(createConfigStream(), getConnection());
            Command read = das.getCommand("all customers");

            // select.setDataObjectModel();
            DataObject root = read.executeQuery();

            // Create a new stockPurchase
            DataObject customer = root.createDataObject("customerProfileData");

            // THIS SEEMS TO BE THE ONLY WAY TO DO THIS .. NO WAY TO JUST ADD AN EXISTING CUSTOMER.
            customer.set("firstName", customerProfile.getFirstName());
            customer.set("lastName", customerProfile.getLastName());
            customer.set("address", customerProfile.getAddress());
            customer.set("email", customerProfile.getEmail());
            customer.set("loginID", customerProfile.getLoginID());
            customer.set("password", customerProfile.getPassword());

            das.applyChanges(root);
            return getCustomerProfile(customerProfile.getLoginID());

        } catch (Exception e) {
View Full Code Here

Examples of commonj.sdo.DataObject

            DAS das = DAS.FACTORY.createDAS(mapping, conn);

            Command select = das.createCommand("SELECT accountNumber, accountType, balance FROM accounts where id = ?");
            select.setParameter(1, customerID);

            DataObject root = select.executeQuery();
            accountReport.getAccountSummaries().addAll(root.getList("AccountSummary"));

            // Get Stocks

            select = das.createCommand("SELECT Symbol, quantity, purchasePrice, purchaseDate, purchaseLotNumber  FROM stocks where id = ?");
            select.setParameter(1, customerID);

            // select.addConverter("STOCKS.PURCHASEDATE", DateConverter.class.getName());

            root = select.executeQuery();
            accountReport.getStockSummaries().addAll(root.getList("StockSummary"));

            conn.close();

            return accountReport;
        } catch (Exception e) {
View Full Code Here

Examples of commonj.sdo.DataObject

            DAS das = DAS.FACTORY.createDAS(createConfigStream(), conn);

            Command select = das.createCommand("SELECT accountNumber, balance FROM accounts where accountNumber = ?");
            select.setParameter(1, account);

            DataObject root = select.executeQuery();
            Collection accounts = root.getList("AccountSummary");
            AccountSummary accountData = (AccountSummary) accounts.iterator().next();
            float newbalance = accountData.getBalance() + ammount;
            accountData.setBalance(newbalance);
            // update department set companyid = ? where department.name = ?
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.