Package org.apache.commons.betwixt.io.read

Examples of org.apache.commons.betwixt.io.read.ReadContext


        this(
            introspector,
            basePath,
            baseElementDescriptor,
            baseBeanClass,
            new ReadContext( context, new ReadConfiguration() ));
    }
View Full Code Here


      * Factory method for new contexts.
      * Ensure that they are correctly configured.
      * @return the ReadContext created, not null
      */
    private ReadContext makeContext() {
        return new ReadContext( log, bindingConfiguration, readConfiguration );
    }
View Full Code Here

        this.basePath = basePath;
        this.baseElementDescriptor = baseElementDescriptor;
        this.baseBeanClass = baseBeanClass;
        BindingConfiguration bindingConfiguration = new BindingConfiguration();
        bindingConfiguration.setMapIDs( matchIDs );
        baseContext = new ReadContext( log , bindingConfiguration, new ReadConfiguration() );
    }
View Full Code Here

                        Context context) {
        this.introspector = introspector;
        this.basePath = basePath;
        this.baseElementDescriptor = baseElementDescriptor;
        this.baseBeanClass = baseBeanClass;
        this.baseContext = new ReadContext( context, new ReadConfiguration() );
    }
View Full Code Here

         * Creates rules for bean and adds them to digester
         * @param digester the <code>Digester</code>
         * to which the bean mapping rules will be added
         */
        ReadingContext(Digester digester) {
            ReadContext context = new ReadContext( baseContext );
            // if the classloader is not set, set to the digester classloader
            if ( context.getClassLoader() == null ) {
                context.setClassLoader( digester.getClassLoader()  );
            }
            BeanRule rule
                = new BeanRule( basePath + "/" , baseElementDescriptor, baseBeanClass, context );
            addRule( basePath, rule , baseElementDescriptor, context );
           
View Full Code Here

      * Factory method for new contexts.
      * Ensure that they are correctly configured.
      * @return the ReadContext created, not null
      */
    private ReadContext makeContext() {
        return new ReadContext( log, bindingConfiguration, readConfiguration );
    }
View Full Code Here

    public TestBaseMappingStrategy(String testName) {
        super(testName);
    }

    public void testArrayMapping() throws Exception {
        ReadContext context = new ReadContext(
                    new BindingConfiguration(),
                    new ReadConfiguration());
       
        context.pushElement("LibraryBeanWithArraySetter");  
        context.markClassMap(LibraryBeanWithArraySetter.class);
        context.pushElement("books");
       
        ActionMappingStrategy strategy = ActionMappingStrategy.DEFAULT;
        MappingAction action = strategy.getMappingAction("", "books", new AttributesImpl(), context);
        assertTrue("Should be mapped to an array bind action", action instanceof ArrayBindAction);
    }
View Full Code Here

        ElementMapping elementMapping = new ElementMapping();
        elementMapping.setAttributes(new AttributesImpl());
        elementMapping.setName("Bogus");
        elementMapping.setDescriptor(descriptor);
        elementMapping.setType(Iterator.class);
        ReadContext readContext = new ReadContext(new BindingConfiguration(), new ReadConfiguration());
       
        assertNull(introspector.getPolymorphicReferenceResolver().resolveType(elementMapping, readContext));
       
        elementMapping.setName("elementA");
        Class resolution = introspector.getPolymorphicReferenceResolver().resolveType(elementMapping, readContext);
View Full Code Here

    public TestBaseMappingStrategy(String testName) {
        super(testName);
    }

    public void testArrayMapping() throws Exception {
        ReadContext context = new ReadContext(
                    new BindingConfiguration(),
                    new ReadConfiguration());
       
        context.pushElement("LibraryBeanWithArraySetter");  
        context.markClassMap(LibraryBeanWithArraySetter.class);
        context.pushElement("books");
       
        ActionMappingStrategy strategy = ActionMappingStrategy.DEFAULT;
        MappingAction action = strategy.getMappingAction("", "books", new AttributesImpl(), context);
        assertTrue("Should be mapped to an array bind action", action instanceof ArrayBindAction);
    }
View Full Code Here

        this(
            introspector,
            basePath,
            baseElementDescriptor,
            baseBeanClass,
            new ReadContext( context, new ReadConfiguration() ));
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.betwixt.io.read.ReadContext

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.