Examples of ObjectFactory


Examples of org.apache.tuscany.spi.ObjectFactory

    protected <T> void initProperty(JavaMappedProperty<T> property,
                                    PersistenceContext annotation,
                                    CompositeComponent parent,
                                    DeploymentContext context) {
        EntityManagerFactory emf = parent.resolveSystemInstance(EntityManagerFactory.class);
        ObjectFactory factory = new EntityManagerObjectFactory(emf);
        property.setDefaultValueFactory(factory);
    }
View Full Code Here

Examples of org.apache.type_test.types3.ObjectFactory

        SgDerivedTypeB derivedB = new SgDerivedTypeB();
        derivedB.setVarInt(new BigInteger("32"));
        derivedB.setVarString("foo");

        ObjectFactory objectFactory = new ObjectFactory();

        StructWithSubstitutionGroup x = new StructWithSubstitutionGroup();
        JAXBElement<? extends SgBaseTypeA> elementA = objectFactory.createSg01BaseElementA(baseA);
        x.setSg01BaseElementA(elementA);
        StructWithSubstitutionGroup yOrig = new StructWithSubstitutionGroup();
        JAXBElement<? extends SgBaseTypeA> elementB = objectFactory.createSg01DerivedElementB(derivedB);
        yOrig.setSg01BaseElementA(elementB);

        Holder<StructWithSubstitutionGroup> y = new Holder<StructWithSubstitutionGroup>(yOrig);
        Holder<StructWithSubstitutionGroup> z = new Holder<StructWithSubstitutionGroup>();
        StructWithSubstitutionGroup ret;
View Full Code Here

Examples of org.apache.wink.common.internal.lifecycle.ObjectFactory

            // use ClassUtils.loadClass instead of Class.forName so we have
            // classloader visibility into the Web module in J2EE environments
            appClass = (Class<? extends Application>)ClassUtils.loadClass(initParameter);
           
            // let the lifecycle manager create the instance and process fields for injection
            ObjectFactory of = LifecycleManagerUtils.createSingletonObjectFactory(appClass);
           
            return (Application)of.getInstance(null);
        }
        String appLocationParameter = getInitParameter(APP_LOCATION_PARAM);
        if (appLocationParameter == null) {
            logger.warn(Messages.getMessage("propertyNotDefined", APP_LOCATION_PARAM)); //$NON-NLS-1$
        }
View Full Code Here

Examples of org.apache.wink.common.model.app.ObjectFactory

                        Annotation[] annotations,
                        MediaType mediaType,
                        MultivaluedMap<String, Object> httpHeaders,
                        OutputStream entityStream) throws IOException, WebApplicationException {
        try {
            ObjectFactory objectFactory = new ObjectFactory();
            JAXBElement<AppCategories> feedElement = objectFactory.createCategories(t);
            Marshaller marshaller = AppCategories.getMarshaller();
            marshaller.setProperty(Marshaller.JAXB_ENCODING, ProviderUtils.getCharset(mediaType));
            AtomJAXBUtils.marshal(marshaller, feedElement, entityStream);
        } catch (PropertyException e) {
            throw new WebApplicationException(e);
View Full Code Here

Examples of org.apache.wink.common.model.atom.ObjectFactory

        @POST
        @Path("jaxbelement")
        public JAXBElement<AtomFeed> createWraped(JAXBElement<AtomFeed> feed) {
            AtomFeed atomFeed = new AtomFeed();
            atomFeed.setId(feed.getValue().getId());
            JAXBElement<AtomFeed> wrapedFeed = new ObjectFactory().createFeed(atomFeed);
            return wrapedFeed;
        }
View Full Code Here

Examples of org.apache.ws.jaxme.sqls.ObjectFactory

        super(pFactory);
    }

  public CombinedConstraint getStartWith() {
      if (startWith == null) {
          ObjectFactory f = getSQLFactory().getObjectFactory();
          startWith = f.newCombinedConstraint(this, CombinedConstraint.Type.AND);
      }
      return startWith;
  }
View Full Code Here

Examples of org.apache.ws.jaxme.test.bindings.vo.ObjectFactory

  /**
   * Tests, whether the binding has moved the schema to the proper
   * package and whether the string constants have been created.
   */
  public void testBindings() throws Exception {
    FooType foo = new ObjectFactory().createFoo();
    foo.setBar(YesNoTypeClass.YES);
    foo.setBool(Boolean.TRUE);
    ImpFooType impFoo = new org.apache.ws.jaxme.test.bindings.imported.vo.ObjectFactory().createImpFoo();
    impFoo.setXyz(org.apache.ws.jaxme.test.bindings.imported.vo.YesNoTypeClass.NO);
    impFoo.setRequiredLong(1L);
View Full Code Here

Examples of org.apache.ws.jaxme.test.misc.address.ObjectFactory

import org.apache.ws.jaxme.test.misc.address.AddressType.PhoneDetailsType.PhoneType;


public class AddressCreator {
  public static void writeAddress(Writer pWriter) throws JAXBException {
    ObjectFactory f = new ObjectFactory();
   
    // Create the element:
    Address addr = f.createAddress();
    addr.setName(f.createAddressTypeNameType());
    addr.getName().setFirst("Jane");
    addr.getName().setLast("Doe");
    addr.setPostal(f.createAddressTypePostalType());
    addr.getPostal().setStreet("34 Main Street");
    addr.getPostal().setCity("Boston");
    addr.getPostal().setState("MA");
    addr.getPostal().setZIP("02215");
    addr.setEmailDetails(f.createAddressTypeEmailDetailsType());
   
    EmailType email = f.createAddressTypeEmailDetailsTypeEmailType();
    email.setType("Private");
    email.setEmailAddress("jdoe@yourcompany.com");
    addr.getEmailDetails().getEmail().add(email);
    email = f.createAddressTypeEmailDetailsTypeEmailType();
    email.setType("Office");
    email.setEmailAddress("josephdoe@mycompany.com");
    addr.getEmailDetails().getEmail().add(email);
    email = f.createAddressTypeEmailDetailsTypeEmailType();
    email.setType("Office");
    email.setEmailAddress("joseph.doe@mycompany.com");
    addr.getEmailDetails().getEmail().add(email);
   
    addr.setPhoneDetails(f.createAddressTypePhoneDetailsType());
    PhoneType phone = f.createAddressTypePhoneDetailsTypePhoneType();
    phone.setType("Work");
    phone.setPhoneNumber("555.6789");
    addr.getPhoneDetails().getPhone().add(phone);
    phone = f.createAddressTypePhoneDetailsTypePhoneType();
    phone.setType("Fax");
    phone.setPhoneNumber("555.1212");
    addr.getPhoneDetails().getPhone().add(phone);
   
    // And save it into the file "Address.xml"
View Full Code Here

Examples of org.apache.ws.jaxme.test.misc.types.ObjectFactory

    marshaller.marshal(getAllTypesElement(), sw);
    assertEquals(input.toString(), sw.toString());
  }

  protected String getMarshalledAuthor() throws JAXBException {
      Author author = new ObjectFactory().createAuthor();
      author.setRating(2);
      author.setValue("This is a test.");
      StringWriter sw = new StringWriter();
      getFactory().createMarshaller().marshal(author, sw);
      return sw.toString();
View Full Code Here

Examples of org.apache.ws.jaxme.test.misc.wildcards.ObjectFactory

        marshaller.marshal(pElement, sw);
        return sw.toString();
    }

    protected String getMarshalledAnyAttribute() throws JAXBException {
        ObjectFactory objectFactory = new ObjectFactory();
        AnyAttribute anyAttribute = objectFactory.createAnyAttribute();
        anyAttribute.setAnyAttribute(new QName("foo", "bar"), "value 1");
        anyAttribute.setAnyAttribute(new QName("baz"), "value 2");
        return asString(anyAttribute);
    }
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.