Examples of ObjectFactory


Examples of org.dom4j.test.primer.ObjectFactory

        }
    }

    public void demoWrite() {
        try {
            ObjectFactory factory = new ObjectFactory();

            PurchaseOrders orders = factory.createPurchaseOrders();

            // Order 1
            PurchaseOrder order = factory.createPurchaseOrder();

            USAddress billTo = factory.createUSAddress();
            billTo.setCity("Cambridge");
            billTo.setCountry("US");
            billTo.setName("Robert Smith");
            billTo.setState("MA");
            billTo.setStreet("8 Oak Avenue");
            billTo.setZip(new BigDecimal(12345));
            order.setBillTo(billTo);

            USAddress shipTo = factory.createUSAddress();
            shipTo.setCity("Cambridge");
            shipTo.setCountry("US");
            shipTo.setName("Alice Smith");
            shipTo.setState("MA");
            shipTo.setStreet("123 Maple Street");
            shipTo.setZip(new BigDecimal(12345));
            order.setShipTo(shipTo);

            Calendar orderDate = Calendar.getInstance();
            orderDate.set(2004, 06, 30);
            order.setOrderDate(orderDate);

            Items items = factory.createItems();
            order.setItems(items);

            orders.getPurchaseOrder().add(order);

            // Order 2
            PurchaseOrder order2 = factory.createPurchaseOrder();

            USAddress billTo2 = factory.createUSAddress();
            billTo2.setCity("Cambridge");
            billTo2.setCountry("US");
            billTo2.setName("Robert Smith");
            billTo2.setState("MA");
            billTo2.setStreet("8 Oak Avenue");
            billTo2.setZip(new BigDecimal(12345));
            order2.setBillTo(billTo2);

            USAddress shipTo2 = factory.createUSAddress();
            shipTo2.setCity("Cambridge");
            shipTo2.setCountry("US");
            shipTo2.setName("Alice Smith");
            shipTo2.setState("MA");
            shipTo2.setStreet("123 Maple Street");
            shipTo2.setZip(new BigDecimal(12345));
            order2.setShipTo(shipTo2);

            Calendar orderDate2 = Calendar.getInstance();
            orderDate2.set(2004, 06, 30);
            order2.setOrderDate(orderDate2);

            Items items2 = factory.createItems();
            order2.setItems(items2);

            orders.getPurchaseOrder().add(order2);

            File outputFile = new File(outputDir, "jaxbWrite.xml");
View Full Code Here

Examples of org.eclipse.persistence.jaxb.xmlmodel.ObjectFactory

    private static final String LINK_PREFIX = "atom";
   
    private XmlBindings xmlBindings;

    public DynamicXMLMetadataSource(DatabaseSession session, String packageName) {
        ObjectFactory objectFactory = new ObjectFactory();
        xmlBindings = new XmlBindings();
        xmlBindings.setPackageName(packageName);

        JavaTypes javaTypes = new JavaTypes();
        xmlBindings.setJavaTypes(javaTypes);
View Full Code Here

Examples of org.example.identity.ObjectFactory

     * namespace URI and local name of the element without expansion.
     */
    @Test
    public void testGetNameFromJAXBElement() throws Exception {
        OMFactory omFactory = OMAbstractFactory.getOMFactory();
        ObjectFactory objectFactory = new ObjectFactory();
        JAXBContext context = JAXBContext.newInstance(ObjectFactory.class);
        JAXBElement<LinkIdentitiesType> jaxbElement = objectFactory.createLinkIdentities(new LinkIdentitiesType());
        OMSourcedElement element = omFactory.createOMElement(new JAXBOMDataSource(context, jaxbElement));
        assertEquals("http://www.example.org/identity", element.getNamespaceURI());
        assertEquals("LinkIdentities", element.getLocalName());
        assertFalse(element.isExpanded());
        // Force expansion so that OMSourcedElement compares the namespace URI and local name
View Full Code Here

Examples of org.exoplatform.services.rest.ObjectFactory

    * {@inheritDoc}
    */
   @SuppressWarnings("unchecked")
   public <T extends Throwable> ExceptionMapper<T> getExceptionMapper(Class<T> type)
   {
      ObjectFactory pf = exceptionMappers.get(type);
      if (pf != null)
      {
         return (ExceptionMapper<T>)pf.getInstance(ApplicationContextImpl.getCurrent());
      }
      return null;
   }
View Full Code Here

Examples of org.fcrepo.server.types.gen.ObjectFactory

            conditions[0].setOperator(ComparisonOperator.fromValue("eq"));
            conditions[0].setValue("D");
            FieldSearchQuery.Conditions conds =
                    new FieldSearchQuery.Conditions();
            conds.getCondition().addAll(Arrays.asList(conditions));
            ObjectFactory factory = new ObjectFactory();
            query.setConditions(factory.createFieldSearchQueryConditions(conds));
            String[] fields = new String[] {"pid", "label"};
            if (true) {
                /* FIXME: find some other way to do this */
                throw new UnsupportedOperationException("This operation uses obsolete field search semantics");
            }
View Full Code Here

Examples of org.hoteia.qalingo.binding.common.store.ObjectFactory

  protected ByteArrayOutputStream buildAsByteArrayOutputStream(Store store) throws JAXBException {

    // StoreValidationEventHandler storeValidationEventHandler = new StoreValidationEventHandler();
    ByteArrayOutputStream xmlOutput = new ByteArrayOutputStream();

    ObjectFactory objFactory = new ObjectFactory();
    XmlStore xmlStore = objFactory.createXmlStore();

    buildStore(store, xmlStore);

    JAXBElement<XmlStore> storeElement = objFactory.createStoreElement(xmlStore);
    marshaller.marshal(storeElement, xmlOutput);

    return xmlOutput;
  }
View Full Code Here

Examples of org.java.plugin.ObjectFactory

        // We do not want info messages from JPF.
        Logger.getLogger("org.java.plugin").setLevel(Level.WARNING);

        Logger log = Logger.getLogger(PluginCore.class.getName());

        ObjectFactory objectFactory = ObjectFactory.newInstance();

        PluginManager result = objectFactory.createManager();

       
        /*
         * Now find plug-ins! Check directories and jar.
         */
 
View Full Code Here

Examples of org.jboss.identity.federation.saml.v2.assertion.ObjectFactory

   public static Element toElement(AssertionType assertion) throws Exception
   {
      Document document = DocumentUtil.createDocument();
      DOMResult result = new DOMResult(document);
      Marshaller marshaller = JAXBUtil.getMarshaller("org.jboss.identity.federation.saml.v2.assertion");
      marshaller.marshal(new ObjectFactory().createAssertion(assertion), result);

      // normalize the document to remove unused namespaces.
      DOMConfiguration docConfig = document.getDomConfig();
      docConfig.setParameter("namespaces", Boolean.TRUE);
      docConfig.setParameter("namespace-declarations", Boolean.FALSE);
View Full Code Here

Examples of org.jboss.identity.federation.saml.v2.metadata.ObjectFactory

    */
   public void persist(EntityDescriptorType entity, String id) throws IOException
   {
      File persistedFile = validateIdAndReturnMDFile(id);
     
      ObjectFactory of = new ObjectFactory();
     
      JAXBElement<?> jentity = of.createEntityDescriptor(entity);
     
      Marshaller m;
      try
      {
         m = JAXBUtil.getMarshaller(pkgName);
View Full Code Here

Examples of org.jboss.identity.federation.saml.v2.profiles.xacml.assertion.ObjectFactory

      return un;
   }
  
   public static XACMLAuthzDecisionStatementType createXACMLAuthzDecisionStatementType()
   {
      ObjectFactory of = new ObjectFactory();
      return of.createXACMLAuthzDecisionStatementType();
   }
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.