Package org.apache.commons.betwixt

Examples of org.apache.commons.betwixt.XMLIntrospector.register()


        "            </class>" +
        "     </betwixt-config>";

    public void testRegisterMultiMapping() throws Exception {
        XMLIntrospector xmlIntrospector = new XMLIntrospector();
        Class[] mapped = xmlIntrospector.register(new InputSource(new StringReader(MAPPING)));
       
        assertEquals("Mapped classes", 3, mapped.length);
       
        XMLBeanInfo beanInfo = xmlIntrospector.introspect(AddressBean.class);
        assertNotNull("Bean info mapping", beanInfo);
View Full Code Here


        "</betwixt-config>";
   
    public void testRegisterThenResolve() throws Exception
    {
        XMLIntrospector introspector = new XMLIntrospector();
        introspector.register(new InputSource(new StringReader(MAPPING)));
       
       
        ElementDescriptor descriptor = introspector.introspect(Element.class).getElementDescriptor();
        ElementMapping elementMapping = new ElementMapping();
        elementMapping.setAttributes(new AttributesImpl());
View Full Code Here

                "        <element name='wibble' property='alpha'/>" +
                "        <element name='wobble' property='beta'/>" +
                "    </element>" +
                "</info>");
        XMLIntrospector introspector = new XMLIntrospector();
        introspector.register(SimpleTestBean.class, new InputSource(reader));
        XMLBeanInfo xmlBeanInfo = introspector.introspect(SimpleTestBean.class);
       
        ElementDescriptor elementDescriptor = xmlBeanInfo.getElementDescriptor();
        assertEquals("Root is jelly", "jelly", elementDescriptor.getLocalName());
        ElementDescriptor[] childDescriptors = elementDescriptor.getElementDescriptors();
View Full Code Here

    public void testIntrospection() throws Exception {
        XMLIntrospector introspector = new XMLIntrospector();
       
        StringReader mapping = new StringReader(MAPPING);
        introspector.register(new InputSource(mapping));
      
        XMLBeanInfo beanInfo = introspector.introspect(AlphaListHolder.class);
        ElementDescriptor descriptor = beanInfo.getElementDescriptor();
        assertNotNull(descriptor);
        ElementDescriptor[] descriptors = descriptor.getElementDescriptors();
View Full Code Here

        "            </class>" +
        "     </betwixt-config>";

    public void testRegisterMultiMapping() throws Exception {
        XMLIntrospector xmlIntrospector = new XMLIntrospector();
        Class[] mapped = xmlIntrospector.register(new InputSource(new StringReader(MAPPING)));
       
        assertEquals("Mapped classes", 3, mapped.length);
       
        XMLBeanInfo beanInfo = xmlIntrospector.introspect(AddressBean.class);
        assertNotNull("Bean info mapping", beanInfo);
View Full Code Here

                "        <element name='wibble' property='alpha'/>" +
                "        <element name='wobble' property='beta'/>" +
                "    </element>" +
                "</info>");
        XMLIntrospector introspector = new XMLIntrospector();
        introspector.register(SimpleTestBean.class, new InputSource(reader));
        XMLBeanInfo xmlBeanInfo = introspector.introspect(SimpleTestBean.class);
       
        ElementDescriptor elementDescriptor = xmlBeanInfo.getElementDescriptor();
        assertEquals("Root is jelly", "jelly", elementDescriptor.getLocalName());
        ElementDescriptor[] childDescriptors = elementDescriptor.getElementDescriptors();
View Full Code Here

        "</betwixt-config>";
   
    public void testRegisterThenResolve() throws Exception
    {
        XMLIntrospector introspector = new XMLIntrospector();
        introspector.register(new InputSource(new StringReader(MAPPING)));
       
       
        ElementDescriptor descriptor = introspector.introspect(Element.class).getElementDescriptor();
        ElementMapping elementMapping = new ElementMapping();
        elementMapping.setAttributes(new AttributesImpl());
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.