Package org.milyn.javabean.dynamic.serialize

Examples of org.milyn.javabean.dynamic.serialize.BeanWriter


        if(beanMetadata == null) {
            BeanRegistrationException.throwUnregisteredBeanInstanceException(bean);
        }

        BeanWriter beanWriter = beanMetadata.getWriter();

        if(beanMetadata.getPreText() != null) {
            environment.getOut().write(beanMetadata.getPreText());
        }

        if(indent > 0) {
            StringWriter beanWriteBuffer = new StringWriter();

            beanWriteBuffer.write('\n');
            beanWriter.write(bean, beanWriteBuffer, model);

            environment.getOut().write(XmlUtil.indent(beanWriteBuffer.toString(), indent));
        } else {
            beanWriter.write(bean, environment.getOut(), model);
        }
    }
View Full Code Here


                    } else {
                        // SAX pretext is gathered by an instance of the UnknownElementDataReaper
                    }

                    if(beanWriters != null) {
                        BeanWriter beanWriter = beanWriters.get(namespaceURI);

                        if(beanWriter != null) {
                            beanMetadata.setWriter(beanWriter);
                        } else if(logger.isDebugEnabled()) {
                            logger.debug("BeanWriters are configured for Object type '" + bean.getClass() + "', but not for namespace '" + namespaceURI + "'.");
View Full Code Here

        }

        resolveModelNamespaces();
        resolveUnmappedBeanWriters();

        BeanWriter beanWriter = getBeanWriter(rootBean);
        beanWriter.write(rootBean, writer, this);
    }
View Full Code Here

            if(metaData.getWriter() == null) {
                // Install the writer for the configured namespace...
                Map<String, BeanWriter> classBeanWriters = beanWriters.get(metaData.getBean().getClass());

                if(classBeanWriters != null) {
                    BeanWriter beanWriter = classBeanWriters.get(metaData.getNamespace());

                    if(beanWriter == null) {
                        throw new IOException("BeanWriters are configured for Object type '" + metaData.getBean().getClass() + "', but not for namespace '" + metaData.getNamespace() + "'.");
                    }
View Full Code Here

    private ApplicationContext appContext;

    @Initialize
    public void createBeanWriter() {
        try {
            BeanWriter beanWriter = beanWriterClass.newInstance();

            Configurator.configure(beanWriter, config, appContext);
            getBeanWriters(beanClass, appContext).put(config.getSelectorNamespaceURI(), beanWriter);           
        } catch (InstantiationException e) {
            throw new SmooksConfigurationException("Unable to create BeanWriter instance.", e);
View Full Code Here

TOP

Related Classes of org.milyn.javabean.dynamic.serialize.BeanWriter

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.