Package org.apache.commons.betwixt.expression

Examples of org.apache.commons.betwixt.expression.Context


            // process child elements
            for ( int i = 0, size = childDescriptors.length; i < size; i++ ) {
                if (childDescriptors[i] instanceof ElementDescriptor) {
                    // Element content
                    ElementDescriptor childDescriptor = (ElementDescriptor) childDescriptors[i];
                    Context childContext = context;
                    Expression childExpression = childDescriptor.getContextExpression();
                    if ( childExpression != null ) {
                        Object childBean = childExpression.evaluate( context );
                        if ( childBean != null ) {
                            String qualifiedName = childDescriptor.getQualifiedName();
View Full Code Here


      * Ensure that they are correctly configured.
      * @param bean make a new Context for this bean
      * @return not null
      */
    private Context makeContext(Object bean) {
        return new Context( bean, log, bindingConfiguration );
    }
View Full Code Here

                            String pathPrefix,
                            boolean matchIDs ) {
        this(
                descriptor,
                beanClass,
                new Context(),
                pathPrefix,
                matchIDs);
    }
View Full Code Here

        // introspect to obtain bean info
        XMLBeanInfo beanInfo = introspector.introspect( bean );
        if ( beanInfo != null ) {
            ElementDescriptor elementDescriptor = beanInfo.getElementDescriptor();
            if ( elementDescriptor != null ) {
                Context context = new Context( bean, log );
                if ( qualifiedName == null ) {
                    qualifiedName = elementDescriptor.getQualifiedName();
                }
               
                String ref = null;
                String id = null;
               
                // only give id's to non-primatives
                if ( elementDescriptor.isPrimitiveType() ) {
                    // write without an id
                    write(
                        qualifiedName,
                        elementDescriptor,
                        context );
                } else {
                    pushBean ( context.getBean() );
                    if ( writeIDs ) {
                        ref = (String) idMap.get( context.getBean() );
                    }
                    if ( ref == null ) {
                        // this is the first time that this bean has be written
                        AttributeDescriptor idAttribute = beanInfo.getIDAttribute();
                        if (idAttribute == null) {
View Full Code Here

        boolean writtenContent = false;
        if ( childDescriptors != null && childDescriptors.length > 0 ) {
            // process child elements
            for ( int i = 0, size = childDescriptors.length; i < size; i++ ) {
                ElementDescriptor childDescriptor = childDescriptors[i];
                Context childContext = context;
                Expression childExpression = childDescriptor.getContextExpression();
                if ( childExpression != null ) {
                    Object childBean = childExpression.evaluate( context );
                    if ( childBean != null ) {
                        String qualifiedName = childDescriptor.getQualifiedName();
View Full Code Here

                            String pathPrefix,
                            boolean matchIDs ) {
        this(
                descriptor,
                beanClass,
                new Context(),
                pathPrefix,
                matchIDs);
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.betwixt.expression.Context

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.