Examples of XLSReadStatus


Examples of net.sf.jxls.reader.XLSReadStatus

            ExpressionCompiler compiler = new ExpressionCompiler( this.text );
            this.expr = compiler.compile( parserContext );
        }

        XLSReadStatus readStatus = null;
        Map<String, Object> beans = null;
        try {
            beans = (Map<String, Object>) MVEL.executeExpression( this.expr,
                                                                  object );
           
            // error check beans
            if ( beans == null || !(beans instanceof Map) ) {
                throw new RuntimeException( "Bean map expression must evaluate to a populated Map interface" );
            }
           
            if ( object instanceof InputStream ) {
                readStatus = xlsReader.read( (InputStream) object,
                                             beans );
            } else if ( object instanceof Resource ) {
                readStatus = xlsReader.read( ((Resource) object).getInputStream(),
                                             beans );
            } else {
                throw new IllegalArgumentException( "signal object must be instance of InputStream or Resource" );
            }

            // error check xls reader
            if ( readStatus == null || !readStatus.isStatusOK() ) {
                StringBuilder builder = new StringBuilder();
                builder.append( "Unable to parse resource with XLS:\n" );
                for ( XLSReadMessage message : ((List<XLSReadMessage>) readStatus.getReadMessages()) ) {
                    builder.append( message.getMessage() + "\n" );
                }
                throw new RuntimeException( "Unable to parse resource with XLS:\n" + builder.toString() );
            }
           
View Full Code Here

Examples of net.sf.jxls.reader.XLSReadStatus

            ExpressionCompiler compiler = new ExpressionCompiler( this.text );
            this.expr = compiler.compile( parserContext );
        }

        XLSReadStatus readStatus = null;
        Map<String, Object> beans = null;
        try {
            beans = (Map<String, Object>) MVEL.executeExpression( this.expr,
                                                                  object );
           
            // error check beans
            if ( beans == null || !(beans instanceof Map) ) {
                throw new RuntimeException( "Bean map expression must evaluate to a populated Map interface" );
            }
           
            if ( object instanceof InputStream ) {
                readStatus = xlsReader.read( (InputStream) object,
                                             beans );
            } else if ( object instanceof Resource ) {
                readStatus = xlsReader.read( ((Resource) object).getInputStream(),
                                             beans );               
            } else {
                throw new IllegalArgumentException( "signal object must be instance of InputStream or Resource" );
            }

            // error check xls reader
            if ( readStatus == null || !readStatus.isStatusOK() ) {
                StringBuilder builder = new StringBuilder();
                builder.append( "Unable to parse resource with XLS:\n" );
                for ( XLSReadMessage message : ((List<XLSReadMessage>) readStatus.getReadMessages()) ) {
                    builder.append( message.getMessage() + "\n" );
                }
                throw new RuntimeException( "Unable to parse resource with XLS:\n" + builder.toString() );
            }
           
View Full Code Here

Examples of net.sf.jxls.reader.XLSReadStatus

            ExpressionCompiler compiler = new ExpressionCompiler( this.text );
            this.expr = compiler.compile( parserContext );
        }

        XLSReadStatus readStatus = null;
        Map<String, Object> beans = null;
        try {
            beans = (Map<String, Object>) MVEL.executeExpression( this.expr,
                                                                  object );
           
            // error check beans
            if ( beans == null || !(beans instanceof Map) ) {
                throw new RuntimeException( "Bean map expression must evaluate to a populated Map interface" );
            }
           
            if ( object instanceof InputStream ) {
                readStatus = xlsReader.read( (InputStream) object,
                                             beans );
            } else if ( object instanceof Resource ) {
                readStatus = xlsReader.read( ((Resource) object).getInputStream(),
                                             beans );               
            } else {
                throw new IllegalArgumentException( "signal object must be instance of InputStream or Resource" );
            }

            // error check xls reader
            if ( readStatus == null || !readStatus.isStatusOK() ) {
                StringBuilder builder = new StringBuilder();
                builder.append( "Unable to parse resource with XLS:\n" );
                for ( XLSReadMessage message : ((List<XLSReadMessage>) readStatus.getReadMessages()) ) {
                    builder.append( message.getMessage() + "\n" );
                }
                throw new RuntimeException( "Unable to parse resource with XLS:\n" + builder.toString() );
            }
           
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.