Package org.apache.commons.betwixt.expression

Examples of org.apache.commons.betwixt.expression.Expression.evaluate()


            }
        } else {
            // evaluate the body text
            Expression expression = elementDescriptor.getTextExpression();
            if ( expression != null ) {
                Object value = expression.evaluate( context );
                String text = convertToString( value, elementDescriptor, context );
                if ( text != null && text.length() > 0 ) {
                    bodyText( writeContext, text );
                }
            }
View Full Code Here


        }
       
        // an element is not empty if it has a non-empty body
        Expression expression = descriptor.getTextExpression();
        if ( expression != null ) {
            Object value = expression.evaluate( context );
            String text = convertToString( value, descriptor, context );
            if ( text != null && text.length() > 0 ) {
                log.trace( "Element has body text which isn't empty." );
                return false;
            }
View Full Code Here

                        Context context )
                            throws
                                IOException, SAXException {
        Expression expression = attributeDescriptor.getTextExpression();
        if ( expression != null ) {
            Object value = expression.evaluate( context );
            if ( value != null ) {
                String text = value.toString();
                if ( text != null && text.length() > 0 ) {
                    expressAttribute(
                                    attributeDescriptor.getURI(),
View Full Code Here

                    return idValue;
                   
                } else {
                    Expression expression = attributes[index].getTextExpression();
                    if ( expression != null ) {
                        Object value = expression.evaluate( context );
                        return convertToString( value, attributes[index], context );
                    }
                }
                return "";
            }
View Full Code Here

                    // 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();
                            String namespaceUri = childDescriptor.getURI();
                            String localName = childDescriptor.getLocalName();
                            // XXXX: should we handle nulls better
View Full Code Here

                } else {
                    // Mixed text content
                    // evaluate the body text
                    Expression expression = childDescriptors[i].getTextExpression();
                    if ( expression != null ) {
                        Object value = expression.evaluate( context );
                        String text = convertToString(
                                                        value,
                                                        childDescriptors[i],
                                                        context );
                        if ( text != null && text.length() > 0 ) {;
View Full Code Here

            }
        } else {
            // evaluate the body text
            Expression expression = elementDescriptor.getTextExpression();
            if ( expression != null ) {
                Object value = expression.evaluate( context );
                String text = convertToString( value, elementDescriptor, context );
                if ( text != null && text.length() > 0 ) {
                    bodyText( writeContext, text );
                }
            }
View Full Code Here

        }
       
        // an element is not empty if it has a non-empty body
        Expression expression = descriptor.getTextExpression();
        if ( expression != null ) {
            Object value = expression.evaluate( context );
            String text = convertToString( value, descriptor, context );
            if ( text != null && text.length() > 0 ) {
                log.trace( "Element has body text which isn't empty." );
                return false;
            }
View Full Code Here

                        Context context )
                            throws
                                IOException, SAXException {
        Expression expression = attributeDescriptor.getTextExpression();
        if ( expression != null ) {
            Object value = expression.evaluate( context );
            if ( value != null ) {
                String text = value.toString();
                if ( text != null && text.length() > 0 ) {
                    expressAttribute(
                                    attributeDescriptor.getURI(),
View Full Code Here

         */
        public String getValue( int index ) {
            if ( indexInRange( index )) {
                Expression expression = attributes[index].getTextExpression();
                if ( expression != null ) {
                    Object value = expression.evaluate( context );
                    return convertToString( value, attributes[index], context );
                }
               
                return "";
            }
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.