Package org.apache.wink.common.internal.providers.jaxb.jaxb1

Examples of org.apache.wink.common.internal.providers.jaxb.jaxb1.ObjectFactory


       
        SgDerivedTypeC derivedC = new SgDerivedTypeC();
        derivedC.setVarInt(new BigInteger("1"));
        derivedC.setVarFloat(3.14f);
       
        ObjectFactory objectFactory = new ObjectFactory();
        JAXBElement<? extends SgBaseTypeA> x1 = objectFactory.createSg01DerivedElementB(derivedB);
        JAXBElement<? extends SgBaseTypeA> x2 = objectFactory.createSg02BaseElementA(baseA);
        JAXBElement<? extends SgBaseTypeA> y1 = objectFactory.createSg01DerivedElementB(derivedB);
        JAXBElement<? extends SgBaseTypeA> y2 = objectFactory.createSg02DerivedElementC(derivedC);
       
        StructWithMultipleSubstitutionGroups x = new StructWithMultipleSubstitutionGroups();
        x.setVarFloat(111.1f);
        x.setVarInt(new BigInteger("100"));
        x.setVarString("x-varString");
View Full Code Here


        SgDerivedTypeC derivedC = new SgDerivedTypeC();
        derivedC.setVarInt(new BigInteger("32"));
        derivedC.setVarFloat(3.14f);

        ObjectFactory objectFactory = new ObjectFactory();
        JAXBElement<? extends SgBaseTypeA> elementB = objectFactory.createSg03DerivedElementB(derivedB);
        JAXBElement<? extends SgBaseTypeA> elementC = objectFactory.createSg03DerivedElementC(derivedC);
       
        ChoiceWithSubstitutionGroupAbstract x = new ChoiceWithSubstitutionGroupAbstract();
        x.setSg03AbstractBaseElementA(elementC);
        ChoiceWithSubstitutionGroupAbstract yOrig = new ChoiceWithSubstitutionGroupAbstract();
        yOrig.setSg03AbstractBaseElementA(elementB);
View Full Code Here

    @Test
    public void testChoiceWithSubstitutionGroupNil() throws Exception {
        if (!shouldRunTest("ChoiceWithSubstitutionGroupNil")) {
            return;
        }
        ObjectFactory objectFactory = new ObjectFactory();
       
        ChoiceWithSubstitutionGroupNil x = new ChoiceWithSubstitutionGroupNil();
        JAXBElement<BigInteger> varInt =
            objectFactory.createChoiceWithSubstitutionGroupNilVarInt(null);
        x.setVarInt(varInt);
        ChoiceWithSubstitutionGroupNil yOrig = new ChoiceWithSubstitutionGroupNil();
        JAXBElement<? extends SgBaseTypeA> elementA =
            objectFactory.createSg04NillableBaseElementA(null);
        yOrig.setSg04NillableBaseElementA(elementA);

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

            return;
        }
        SgBaseTypeA baseA = new SgBaseTypeA();
        baseA.setVarInt(new BigInteger("1"));

        ObjectFactory objectFactory = new ObjectFactory();
        JAXBElement<? extends SgBaseTypeA> elementA = objectFactory.createSg01BaseElementA(baseA);

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

        JAXBElement<? extends SgBaseTypeA> elementB = objectFactory.createSg01DerivedElementB(derivedB);

        ChoiceWithSubstitutionGroup x = new ChoiceWithSubstitutionGroup();
        x.setSg01BaseElementA(elementA);
        ChoiceWithSubstitutionGroup yOrig = new ChoiceWithSubstitutionGroup();
        yOrig.setSg01BaseElementA(elementB);
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void testJAXBMarshalling() throws WebApplicationException, IOException {
        assertTrue(jaxbProviderWriter.isWriteable(AddNumbers.class, null, null, MediaType.TEXT_XML_TYPE));
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        jaxbProviderWriter.writeTo(new AddNumbers(), AddNumbers.class, null, null, MediaType.TEXT_XML_TYPE, null, baos);
        assertEquals(expectedXml, baos.toString());
    }
View Full Code Here

    @Test
    public void testJAXBMarshallingWithMap() throws WebApplicationException, IOException {
        assertTrue(jaxbProviderWriter.isWriteable(AddNumbers.class, null, null, MediaType.TEXT_XML_TYPE));
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        MultivaluedMap map = new CaseInsensitiveMultivaluedMap<Object>();
        jaxbProviderWriter.writeTo(new AddNumbers(), AddNumbers.class, null, null, MediaType.TEXT_XML_TYPE, map, baos);
        assertEquals(expectedXml, baos.toString());
    }
View Full Code Here

        }});
       
        // let's make sure our test string is unmarshallable, just for a good sanity check
        JAXBContext testcontext = JAXBContext.newInstance(AddNumbers.class);
        Unmarshaller testunmarshaller = testcontext.createUnmarshaller();
        AddNumbers testresponse =
            (AddNumbers)testunmarshaller.unmarshal(new ByteArrayInputStream(xml.getBytes()));
        assertEquals("we could not unmarshal the test xml", 1, testresponse.getArg0());
       
        assertTrue(jaxbProviderReader.isReadable(AddNumbers.class, null, null, MediaType.TEXT_XML_TYPE));
        ByteArrayInputStream bais = new ByteArrayInputStream(xml.getBytes());
        Object obj = jaxbProviderReader.readFrom(AddNumbers.class, null, null, MediaType.TEXT_XML_TYPE, null, bais);
        assertTrue(obj instanceof AddNumbers);
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void testJAXBMarshalling() throws WebApplicationException, IOException {
        assertTrue(jaxbProviderWriter.isWriteable(AddNumbers.class, null, null, MediaType.TEXT_XML_TYPE));
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        jaxbProviderWriter.writeTo(new AddNumbers(), AddNumbers.class, null, null, MediaType.TEXT_XML_TYPE, null, baos);
        assertEquals(expectedXml, baos.toString());
    }
View Full Code Here

    @Test
    public void testJAXBMarshallingWithMap() throws WebApplicationException, IOException {
        assertTrue(jaxbProviderWriter.isWriteable(AddNumbers.class, null, null, MediaType.TEXT_XML_TYPE));
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        MultivaluedMap map = new CaseInsensitiveMultivaluedMap<Object>();
        jaxbProviderWriter.writeTo(new AddNumbers(), AddNumbers.class, null, null, MediaType.TEXT_XML_TYPE, map, baos);
        assertEquals(expectedXml, baos.toString());
    }
View Full Code Here

        assertTrue("expected an XMLStreamException", ex.getCause() instanceof XMLStreamException);
       
        // let's make sure our test string is unmarshallable, just for a good sanity check
        JAXBContext testcontext = JAXBContext.newInstance(AddNumbers.class);
        Unmarshaller testunmarshaller = testcontext.createUnmarshaller();
        AddNumbers testresponse =
            (AddNumbers)testunmarshaller.unmarshal(new ByteArrayInputStream(xmlWithDTD.getBytes()));
        assertEquals("we could not unmarshal the test xml", 99999999, testresponse.getArg0());
    }
View Full Code Here

TOP

Related Classes of org.apache.wink.common.internal.providers.jaxb.jaxb1.ObjectFactory

Copyright © 2018 www.massapicom. 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.