Examples of ObjectFactory


Examples of com.enernoc.open.oadr2.model.v20b.ei.ObjectFactory

  }
 
  @SuppressWarnings("unchecked")
    protected OadrSignedObject createEventPayload() {
    final XMLGregorianCalendar startDttm = xmlDataTypeFac.newXMLGregorianCalendar("2012-01-01T00:00:00Z");
    final ObjectFactory eiObjectFactory = new ObjectFactory();
   
    return new OadrSignedObject()
        .withOadrDistributeEvent( new OadrDistributeEvent()
            .withRequestID( "test 1234" )
            .withVtnID( "hi" )
          .withOadrEvents( new OadrEvent()
            .withEiEvent(
              new EiEvent()
                .withEiTarget( new EiTarget()
                    .withVenIDs("ven-1234") )
                .withEventDescriptor(new EventDescriptor()
                    .withEventID("event-1234")
                    .withModificationNumber(0)
                    .withEventStatus(EventStatusEnumeratedType.FAR)
                    .withPriority(1L)
                    .withEiMarketContext(new EiMarketContext(
                        new MarketContext("http://enernoc.com")))
                    .withCreatedDateTime(new DateTime(startDttm)))
                .withEiActivePeriod(new EiActivePeriod()
                    .withProperties(new Properties()
                        .withDtstart(new Dtstart(new DateTime(startDttm)))
                        .withDuration(new DurationPropType(new DurationValue("PT1M")))
                        .withTolerance( new Tolerance(new Tolerate(new DurationValue("PT5S"))))
                        .withXEiNotification(new DurationPropType(new DurationValue("PT5S")))
                    ))
                .withEiEventSignals( new EiEventSignals()
                    .withEiEventSignals( new EiEventSignal()
                        .withSignalID("hi there")
                        .withCurrentValue(new CurrentValue(new PayloadFloatType(1.0f)))
                        .withSignalName("simple")
                        .withSignalType(SignalTypeEnumeratedType.LEVEL)
                        .withIntervals( new Intervals()
                            .withIntervals( new Interval()
                              .withStreamPayloadBases( eiObjectFactory.createSignalPayload(
                                      new SignalPayload( eiObjectFactory.createPayloadFloat(
                                              new PayloadFloatType( 1.0f) ) ) ) )
                              .withDuration( new DurationPropType( new DurationValue( "PT1M" )) )
                              .withDtstart( new Dtstart(new DateTime( startDttm )) )
                            )
                        )
View Full Code Here

Examples of com.example.ipo.jaxb.ObjectFactory

        expect(tContext1.getSourceDataType()).andReturn(sourceDataType).anyTimes();
        expect(tContext1.getTargetDataType()).andReturn(null).anyTimes();
        replay(tContext1);

        JAXB2Node t1 = new JAXB2Node();
        PurchaseOrderType po = new ObjectFactory().createPurchaseOrderType();
        Node node = t1.transform(po, tContext1);

        Assert.assertNotNull(node);

    }
View Full Code Here

Examples of com.example.test.jaxb.client.ObjectFactory

        }

    }

    private CreditCardDetailsType createCreditCard(String creditCardNumber, String holder) {
        ObjectFactory factory = new ObjectFactory();
        CreditCardDetailsType creditCard = factory.createCreditCardDetailsType();
        creditCard.setCreditCardNumber(creditCardNumber);
        PayerType payer = factory.createPayerType();
        payer.setName(holder);
        creditCard.setCardOwner(payer);
        return creditCard;
    }
View Full Code Here

Examples of com.github.jmkgreen.morphia.ObjectFactory

        } else
            return vals;
    }

    private Collection<?> createNewCollection(final MappedField mf) {
        ObjectFactory of = mapr.getOptions().objectFactory;
        return mf.isSet() ? of.createSet(mf) : of.createList(mf);
    }
View Full Code Here

Examples of com.github.sardine.model.ObjectFactory

    @Override
    public List<DavResource> list(String url, int depth, java.util.Set<QName> props) throws IOException
    {
        Propfind body = new Propfind();
        Prop prop = new Prop();
        ObjectFactory objectFactory = new ObjectFactory();
        prop.setGetcontentlength(objectFactory.createGetcontentlength());
        prop.setGetlastmodified(objectFactory.createGetlastmodified());
        prop.setCreationdate(objectFactory.createCreationdate());
        prop.setDisplayname(objectFactory.createDisplayname());
        prop.setGetcontenttype(objectFactory.createGetcontenttype());
        prop.setResourcetype(objectFactory.createResourcetype());
        prop.setGetetag(objectFactory.createGetetag());
        List<Element> any = prop.getAny();
        for (QName entry : props) {
            Element element = SardineUtil.createElement(entry);
            any.add(element);
        }
View Full Code Here

Examples of com.globant.google.mendoza.malbec.schema._2.ObjectFactory

   * @param cart The cart as generated by jaxb. It cannot be null.
   *
   * @return Returns a xml string.
   */
  public static String toXml(final CheckoutShoppingCart cart) {
    ObjectFactory factory = new ObjectFactory();
    return marshal(factory.createCheckoutShoppingCart(cart));
  }
View Full Code Here

Examples of com.google.checkout.schema._2.ObjectFactory

   */
  private static Logger _logger
    = Logger.getLogger(AbstractProtocolBuilder.class.getName());
 
  protected AbstractProtocolBuilder() throws JAXBException, ProtocolException {
    _objectFact = new ObjectFactory();
    _xmlMarshaller = createXmlMarshaller();
    _xmlUnMarshaller = createXmlUnMashaller();
    _domBuilder = createDomBuilder();
  }
View Full Code Here

Examples of com.google.checkout.sdk.domain.ObjectFactory

      throw new RuntimeException(e);
    }
  }

  public static ObjectFactory objectFactory() {
    return new ObjectFactory();
  }
View Full Code Here

Examples of com.neptuny.xgrapher.gen.model.ObjectFactory

      JAXBContext jaxbContext=JAXBContext.newInstance("net.battlehorse.XGrapher.gen.model");
    } catch (JAXBException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    ObjectFactory factory=new ObjectFactory();
    Graph gra=factory.createGraph();
    List nodi=gra.getNode();
    List archi=gra.getEdge();
   
    //creo 1� nodo
    Node nodo1=factory.createNode();
    nodo1.setId("31457");
    nodo1.setName("CPU_UTIL");
    nodo1.setDeepness(0);
    //creo la lista di metricattribute
    List metrat=nodo1.getMetricAttribute();
    MetricAttribute metr=factory.createMetricAttribute();
    metr.setName("N");
    metr.setValue(0.6);
    metrat.add(metr);
    //aggiungo il nodo alla lista di nodi del grafo
    nodi.add(nodo1);
    //creo secondo nodo
    Node nodo2=factory.createNode();
    nodo2.setId("31616");
    nodo2.setName("CPU_UTIL");
    nodo2.setDeepness(0);
    //creo la lista di metricattribute del 2� nodo
    metrat=nodo2.getMetricAttribute();
    metr=factory.createMetricAttribute();
    metr.setName("N");
    metr.setValue(0.3);
    metrat=nodo2.getMetricAttribute();
    metrat.add(metr);
    //aggiungo il 2� nodo
    nodi.add(nodo2);
    //creo l'arco
    Edge edg1=factory.createEdge();
    edg1.setId("31457-31616");
    edg1.setName("CPU_UTIL-CPU_UTIL");
    edg1.setDeepness(0);
    edg1.setNodeFromId("31457");
    edg1.setNodeToId("31616");
    //creo lista metricattribute per arco
    metrat=edg1.getMetricAttribute();
    metr=factory.createMetricAttribute();
    metr.setName("COR");
    metr.setValue(0.8);
    metrat.add(metr);
    //aggiungo arco
    archi.add(edg1);
View Full Code Here

Examples of com.oltpbenchmark.api.dialects.ObjectFactory

            public int compare(Procedure o1, Procedure o2) {
                return (o1.getProcedureName().compareTo(o2.getProcedureName()));
            }
        });
       
        ObjectFactory factory = new ObjectFactory();
        DialectType dType = factory.createDialectType();
        dType.setType(dbType.name());
        for (Procedure proc : sorted) {
            if (proc.getStatments().isEmpty()) continue;
           
            ProcedureType pType = factory.createProcedureType();
            pType.setName(proc.getProcedureName());
            for (Entry<String, SQLStmt> e : proc.getStatments().entrySet()) {
                StatementType sType = factory.createStatementType();
                sType.setName(e.getKey());
                sType.setValue(e.getValue().getOriginalSQL());
                pType.getStatement().add(sType);
            } // FOR (stmt)
            dType.getProcedure().add(pType);
        } // FOR
        DialectsType dialects = factory.createDialectsType();
        dialects.getDialect().add(dType);
       
        StringWriter st = new StringWriter();
        try {
            marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
            marshaller.marshal(factory.createDialects(dialects), st);
        } catch (JAXBException ex) {
            throw new RuntimeException("Failed to generate XML", ex);
        }
       
        return (st.toString());
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.