Examples of introspect()


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

        // test introspection after flushing cache
//        introspector.setCachingEnabled(true);
        introspector.setRegistry(new DefaultXMLBeanInfoRegistry());
        //introspector.flushCache();
        info = introspector.introspect( bean );
       
        assertTrue( "Found XMLBeanInfo", info != null );
       
        descriptor = info.getElementDescriptor();
       
View Full Code Here

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

        XMLIntrospector introspector = new XMLIntrospector();
        introspector.setAttributesForPrimitives(false);
//        introspector.setLog(log);
       
        XMLBeanInfo xmlBeanInfo = introspector.introspect(BeanWithBeanInfoBean.class);
       
        ElementDescriptor[] elementDescriptors = xmlBeanInfo.getElementDescriptor().getElementDescriptors();
       
//        log = new SimpleLog("[testBeanWithBeanInfo]");
//        log.setLevel(SimpleLog.LOG_LEVEL_DEBUG);
View Full Code Here

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

   
    public void testDefaultClassNormalizer() throws Exception {
        XMLIntrospector introspector = new XMLIntrospector();
       
        FaceImpl face = new FaceImpl();
        XMLBeanInfo info = introspector.introspect( face );
        ElementDescriptor elementDescriptor = info.getElementDescriptor();
   
        AttributeDescriptor[] attributeDescriptor = elementDescriptor.getAttributeDescriptors();     
        ElementDescriptor[] children = elementDescriptor.getElementDescriptors();
       
View Full Code Here

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

                    return super.normalize( clazz );
               
            });
       
        FaceImpl face = new FaceImpl();
        XMLBeanInfo info = introspector.introspect( face );
        ElementDescriptor elementDescriptor = info.getElementDescriptor();
        assertEquals("Expected only itself", 1, elementDescriptor.getElementDescriptors().length);
   
        AttributeDescriptor[] attributeDescriptor = elementDescriptor.getAttributeDescriptors();     
        ElementDescriptor[] children = elementDescriptor.getElementDescriptors();
View Full Code Here

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

        XMLIntrospector introspector = new XMLIntrospector();
        introspector.setClassNormalizer(classNormalizer);
       
        FaceImpl face = new FaceImpl();
       
        XMLBeanInfo info = introspector.introspect( face );
        ElementDescriptor elementDescriptor = info.getElementDescriptor();
        AttributeDescriptor[] attributeDescriptor = elementDescriptor.getAttributeDescriptors();     
        ElementDescriptor[] children = elementDescriptor.getElementDescriptors();
       
        assertEquals("Expected no attributes", 0, attributeDescriptor.length);
View Full Code Here

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

        //SimpleLog log = new SimpleLog("[testClassAttribute:ElementRule]");
        //log.setLevel(SimpleLog.LOG_LEVEL_TRACE);
        //ElementRule.setLog(log);
       
        XMLIntrospector introspector = new XMLIntrospector();
        XMLBeanInfo beanInfo = introspector.introspect(ExampleBean.class);
        ElementDescriptor[] elementDescriptors = beanInfo.getElementDescriptor().getElementDescriptors();
        ElementDescriptor elementsElementDescriptor = null;
        for ( int i=0, size = elementDescriptors.length; i<size ; i++ ) {
            if ( "examples".equals( elementDescriptors[i].getLocalName() ) ) {
                elementsElementDescriptor = elementDescriptors[i];
View Full Code Here

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

        // when using the HyphenatedNameMapper
        // basically, the test is that no exception is thrown
        //
        XMLIntrospector introspector = new XMLIntrospector();
        introspector.setElementNameMapper(new HyphenatedNameMapper());
        introspector.introspect(new ArrayList());
    }
}
View Full Code Here

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

    protected ElementDescriptor getElementDescriptor( ElementDescriptor propertyDescriptor ) {
        Class beanClass = propertyDescriptor.getSingularPropertyType();
        if ( beanClass != null ) {
            XMLIntrospector introspector = getBeanReader().getXMLIntrospector();
            try {
                XMLBeanInfo xmlInfo = introspector.introspect( beanClass );
                return xmlInfo.getElementDescriptor();
               
            } catch (Exception e) {
                log.warn( "Could not introspect class: " + beanClass, e );
            }
View Full Code Here

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

                new DynaProperty("two", String.class)};
        BasicDynaClass dynaClass = new BasicDynaClass("WibbleDynaBean", BasicDynaBean.class,
                dynaProperties);
        DynaBean dynaBean = dynaClass.newInstance();
        XMLIntrospector xmlIntrospector = new XMLIntrospector();
        XMLBeanInfo xmlBeanInfo = xmlIntrospector.introspect(dynaBean);
       
        ElementDescriptor dynaBeanDescriptor = xmlBeanInfo.getElementDescriptor();
        ElementDescriptor[] dynaPropertyDescriptors = dynaBeanDescriptor.getElementDescriptors();
        assertEquals("Two dyna properties expected", 2, dynaPropertyDescriptors.length);
       
View Full Code Here

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

    //todo: note to self need to consider how the design of the introspection will work when you have strategy which takes
    // singular property which is not know until after the digestion
   
    public void testDefaultMappingDerivationStrategy() throws Exception {
        XMLIntrospector xmlIntrospector = new XMLIntrospector();
        XMLBeanInfo xmlBeanInfo = xmlIntrospector.introspect(Animals.class);
        ElementDescriptor animalsDescriptor = xmlBeanInfo.getElementDescriptor();
        assertEquals("Use bind time type", true, animalsDescriptor.isUseBindTimeTypeForMapping());
        ElementDescriptor animalDescriptor = animalsDescriptor.getElementDescriptors()[0];
        assertEquals("Use bind time type", true, animalDescriptor.isUseBindTimeTypeForMapping());
    }
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.