Examples of XMLBeanInfo


Examples of org.apache.commons.betwixt.XMLBeanInfo

    protected void addDescriptor( Descriptor nodeDescriptor ) throws SAXException {
        Object top = digester.peek();
        if ( top instanceof XMLBeanInfo ) {
            log.warn( "It is advisable to put an <addDefaults/> element inside an <element> tag" );
           
            XMLBeanInfo beanInfo = (XMLBeanInfo) top;
            // if there is already a root element descriptor then use it
            // otherwise use this descriptor
            if ( nodeDescriptor instanceof ElementDescriptor ) {
                ElementDescriptor elementDescriptor = (ElementDescriptor) nodeDescriptor;
                ElementDescriptor root = beanInfo.getElementDescriptor() ;
                if ( root == null ) {
                    beanInfo.setElementDescriptor( elementDescriptor );
                } else {
                    root.addElementDescriptor( elementDescriptor );
                }
            } else {
                throw new SAXException(
View Full Code Here

Examples of org.apache.commons.betwixt.XMLBeanInfo

     * Otherwise null.
     */
    protected ElementDescriptor getRootElementDescriptor() {
        Object top = digester.peek();
        if ( top instanceof XMLBeanInfo ) {
            XMLBeanInfo beanInfo = (XMLBeanInfo) top;
            return beanInfo.getElementDescriptor();
           
        } else if ( top instanceof ElementDescriptor ) {
            ElementDescriptor parent = (ElementDescriptor) top;
            // XXX: could maybe walk up the parent hierarchy?
            return parent;
View Full Code Here

Examples of org.apache.commons.betwixt.XMLBeanInfo

        }
       
        try {
           
            Class beanClass = Class.forName(className);
            XMLBeanInfo xmlBeanInfo = new XMLBeanInfo(beanClass);
            XMLBeanInfoDigester xmlBeanInfoDigester = (XMLBeanInfoDigester) getDigester();
            xmlBeanInfoDigester.setBeanClass(beanClass);
            xmlBeanInfoDigester.push(xmlBeanInfo);
           
        } catch (ClassNotFoundException e) {
View Full Code Here

Examples of org.apache.commons.betwixt.XMLBeanInfo

   
    /**
     * Process the end of this element.
     */
    public void end() {
        XMLBeanInfo xmlBeanInfo = (XMLBeanInfo) getDigester().pop();
        MultiMappingBeanInfoDigester digester = (MultiMappingBeanInfoDigester) getDigester();
        Map xmlBeanInfoMapping = digester.getBeanInfoMap();
        xmlBeanInfoMapping.put(xmlBeanInfo.getBeanClass(), xmlBeanInfo);
        digester.setBeanClass(null);
    }
View Full Code Here

Examples of org.apache.commons.betwixt.XMLBeanInfo

        if ( log.isTraceEnabled() ) {
            log.trace( "Writing bean graph (qualified name '" + qualifiedName + "'" );
        }
       
        // introspect to obtain bean info
        XMLBeanInfo beanInfo = introspector.introspect( bean );
        writeBean(namespaceUri, localName, qualifiedName, bean, context, beanInfo);
       
        log.trace( "Finished writing bean graph." );
    }
View Full Code Here

Examples of org.apache.commons.betwixt.XMLBeanInfo

    if ( log.isTraceEnabled() ) {
        log.trace( "Writing bean graph (qualified name '" + qualifiedName + "'" );
    }
   
    // introspect to obtain bean info
    XMLBeanInfo beanInfo = findXMLBeanInfo(bean, parentDescriptor);
    writeBean(namespaceUri, localName, qualifiedName, bean, context, beanInfo);
   
    log.trace( "Finished writing bean graph." );
}
View Full Code Here

Examples of org.apache.commons.betwixt.XMLBeanInfo

     * @param parentDescriptor <code>ElementDescriptor</code>, not null
     * @return <code>XMLBeanInfo</code>, not null
     * @throws IntrospectionException
     */
    private XMLBeanInfo findXMLBeanInfo(Object bean, ElementDescriptor parentDescriptor) throws IntrospectionException {
        XMLBeanInfo beanInfo = null;
        Class introspectedBindType = parentDescriptor.getSingularPropertyType();
        if ( introspectedBindType == null ) {
            introspectedBindType = parentDescriptor.getPropertyType();
        }
        if ( parentDescriptor.isUseBindTimeTypeForMapping() || introspectedBindType == null ) {
View Full Code Here

Examples of org.apache.commons.betwixt.XMLBeanInfo

            Expression contentExpression = descriptor.getContextExpression();
            if (contentExpression != null) {
                Object childBean = contentExpression.evaluate(context);
                if (childBean != null)
                {
                    XMLBeanInfo xmlBeanInfo = findXMLBeanInfo(childBean, descriptor);
                    Object currentBean = context.getBean();
                    context.setBean(childBean);
                    boolean result = isEmptyElement(xmlBeanInfo.getElementDescriptor(), context);
                    context.setBean(currentBean);
                    return result;
                }
            }
        }
View Full Code Here

Examples of org.apache.commons.betwixt.XMLBeanInfo

    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.XMLBeanInfo

           
            if (log.isTraceEnabled()) {
                log.trace("Filling descriptor for: " + beanClass);
            }
            try {
                XMLBeanInfo xmlInfo =
                    context.getXMLIntrospector().introspect(beanClass);
                return xmlInfo.getElementDescriptor();

            } catch (Exception e) {
                log.warn("Could not introspect class: " + beanClass, e);
            }
        }
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.