Package org.apache.camel.dataformat.bindy.annotation

Examples of org.apache.camel.dataformat.bindy.annotation.FixedLengthRecord


    private void initFixedLengthRecordParameters() {

        for (Class<?> cl : models) {

            // Get annotation @FixedLengthRecord from the class
            FixedLengthRecord record = cl.getAnnotation(FixedLengthRecord.class);

            if (record != null) {
                LOG.debug("Fixed length record: {}", record);

                // Get carriage return parameter
                crlf = record.crlf();
                LOG.debug("Carriage return defined for the CSV: {}", crlf);

                // Get hasHeader parameter
                hasHeader = record.hasHeader();
                LOG.debug("Has Header: {}", hasHeader);

                // Get hasFooter parameter
                hasFooter = record.hasFooter();
                LOG.debug("Has Footer: {}", hasFooter);

                // Get padding character
                paddingChar = record.paddingChar();
                LOG.debug("Padding char: {}", paddingChar);

                // Get length of the record
                recordLength = record.length();
                LOG.debug("Length of the record: {}", recordLength);

                // Get length of the record
                recordLength = record.length();
                LOG.debug("Length of the record: {}", recordLength);
            }
        }
    }
View Full Code Here


    private void initFixedLengthRecordParameters() {

        for (Class<?> cl : models) {

            // Get annotation @FixedLengthRecord from the class
            FixedLengthRecord record = cl.getAnnotation(FixedLengthRecord.class);

            if (record != null) {
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Fixed length record : " + record.toString());
                }

                // Get carriage return parameter
                crlf = record.crlf();
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Carriage return defined for the CSV : " + crlf);
                }

                // Get hasHeader parameter
                hasHeader = record.hasHeader();
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Has Header :  " + hasHeader);
                }

                // Get hasFooter parameter
                hasFooter = record.hasFooter();
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Has Footer :  " + hasFooter);
                }

                // Get padding character
                paddingChar = record.paddingChar();
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Padding char :  " + paddingChar);
                }

                // Get length of the record
                recordLength = record.length();
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Length of the record :  " + recordLength);
                }

                // Get length of the record
                recordLength = record.length();
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Length of the record :  " + recordLength);
                }
            }
        }
View Full Code Here

    private void initFixedLengthRecordParameters() {

        for (Class<?> cl : models) {

            // Get annotation @FixedLengthRecord from the class
            FixedLengthRecord record = cl.getAnnotation(FixedLengthRecord.class);

            if (record != null) {
                LOG.debug("Fixed length record: {}", record);

                // Get carriage return parameter
                crlf = record.crlf();
                LOG.debug("Carriage return defined for the CSV: {}", crlf);

                // Get hasHeader parameter
                hasHeader = record.hasHeader();
                LOG.debug("Has Header: {}", hasHeader);

                // Get hasFooter parameter
                hasFooter = record.hasFooter();
                LOG.debug("Has Footer: {}", hasFooter);

                // Get padding character
                paddingChar = record.paddingChar();
                LOG.debug("Padding char: {}", paddingChar);

                // Get length of the record
                recordLength = record.length();
                LOG.debug("Length of the record: {}", recordLength);

                // Get length of the record
                recordLength = record.length();
                LOG.debug("Length of the record: {}", recordLength);
            }
        }
    }
View Full Code Here

    private void initFixedLengthRecordParameters() {

        for (Class<?> cl : models) {

            // Get annotation @FixedLengthRecord from the class
            FixedLengthRecord record = cl.getAnnotation(FixedLengthRecord.class);

            if (record != null) {
                LOG.debug("Fixed length record: {}", record);

                // Get carriage return parameter
                crlf = record.crlf();
                LOG.debug("Carriage return defined for the CSV: {}", crlf);

                // Get hasHeader parameter
                hasHeader = record.hasHeader();
                LOG.debug("Has Header: {}", hasHeader);

                // Get hasFooter parameter
                hasFooter = record.hasFooter();
                LOG.debug("Has Footer: {}", hasFooter);

                // Get padding character
                paddingChar = record.paddingChar();
                LOG.debug("Padding char: {}", paddingChar);

                // Get length of the record
                recordLength = record.length();
                LOG.debug("Length of the record: {}", recordLength);

                // Get length of the record
                recordLength = record.length();
                LOG.debug("Length of the record: {}", recordLength);
            }
        }
    }
View Full Code Here

    private void initFixedLengthRecordParameters() {

        for (Class<?> cl : models) {

            // Get annotation @FixedLengthRecord from the class
            FixedLengthRecord record = cl.getAnnotation(FixedLengthRecord.class);

            if (record != null) {
                LOG.debug("Fixed length record : {}", record);

                // Get carriage return parameter
                crlf = record.crlf();
                LOG.debug("Carriage return defined for the CSV : {}", crlf);

                // Get hasHeader parameter
                hasHeader = record.hasHeader();
                LOG.debug("Has Header :  {}", hasHeader);

                // Get hasFooter parameter
                hasFooter = record.hasFooter();
                LOG.debug("Has Footer :  {}", hasFooter);

                // Get padding character
                paddingChar = record.paddingChar();
                LOG.debug("Padding char :  {}", paddingChar);

                // Get length of the record
                recordLength = record.length();
                LOG.debug("Length of the record : {}", recordLength);

                // Get length of the record
                recordLength = record.length();
                LOG.debug("Length of the record : {}", recordLength);
            }
        }
    }
View Full Code Here

    private void initFixedLengthRecordParameters() {

        for (Class<?> cl : models) {

            // Get annotation @FixedLengthRecord from the class
            FixedLengthRecord record = cl.getAnnotation(FixedLengthRecord.class);

            if (record != null) {
                LOG.debug("Fixed length record: {}", record);

                // Get carriage return parameter
                crlf = record.crlf();
                LOG.debug("Carriage return defined for the CSV: {}", crlf);

                // Get hasHeader parameter
                hasHeader = record.hasHeader();
                LOG.debug("Has Header: {}", hasHeader);

                // Get hasFooter parameter
                hasFooter = record.hasFooter();
                LOG.debug("Has Footer: {}", hasFooter);

                // Get padding character
                paddingChar = record.paddingChar();
                LOG.debug("Padding char: {}", paddingChar);

                // Get length of the record
                recordLength = record.length();
                LOG.debug("Length of the record: {}", recordLength);

                // Get length of the record
                recordLength = record.length();
                LOG.debug("Length of the record: {}", recordLength);
            }
        }
    }
View Full Code Here

    private void initFixedLengthRecordParameters() {

        for (Class<?> cl : models) {

            // Get annotation @FixedLengthRecord from the class
            FixedLengthRecord record = cl.getAnnotation(FixedLengthRecord.class);

            if (record != null) {
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Fixed length record : " + record.toString());
                }

                // Get carriage return parameter
                crlf = record.crlf();
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Carriage return defined for the CSV : " + crlf);
                }

                // Get hasHeader parameter
                hasHeader = record.hasHeader();
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Has Header :  " + hasHeader);
                }

                // Get hasFooter parameter
                hasFooter = record.hasFooter();
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Has Footer :  " + hasFooter);
                }

                // Get padding character
                paddingChar = record.paddingChar();
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Padding char :  " + paddingChar);
                }

                // Get length of the record
                recordLength = record.length();
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Length of the record :  " + recordLength);
                }

                // Get length of the record
                recordLength = record.length();
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Length of the record :  " + recordLength);
                }
            }
        }
View Full Code Here

    private void initFixedLengthRecordParameters() {

        for (Class<?> cl : models) {

            // Get annotation @FixedLengthRecord from the class
            FixedLengthRecord record = cl.getAnnotation(FixedLengthRecord.class);

            if (record != null) {
                LOG.debug("Fixed length record: {}", record);

                // Get carriage return parameter
                crlf = record.crlf();
                LOG.debug("Carriage return defined for the CSV: {}", crlf);

                // Get hasHeader parameter
                hasHeader = record.hasHeader();
                LOG.debug("Has Header: {}", hasHeader);
               
                // Get skipHeader parameter
                skipHeader = record.skipHeader();
                LOG.debug("Skip Header: {}", skipHeader);

                // Get hasFooter parameter
                hasFooter = record.hasFooter();
                LOG.debug("Has Footer: {}", hasFooter);
               
                // Get skipFooter parameter
                skipFooter = record.skipFooter();
                LOG.debug("Skip Footer: {}", skipFooter);
               
                // Get isHeader parameter
                isHeader = record.isHeader();
                LOG.debug("Is Header: {}", isHeader);
               
                // Get isFooter parameter
                isFooter = record.isFooter();
                LOG.debug("Is Footer: {}", isFooter);

                // Get padding character
                paddingChar = record.paddingChar();
                LOG.debug("Padding char: {}", paddingChar);

                // Get length of the record
                recordLength = record.length();
                LOG.debug("Length of the record: {}", recordLength);

                // Get flag for ignore trailing characters
                ignoreTrailingChars = record.ignoreTrailingChars();
                LOG.debug("Ignore trailing chars: {}", ignoreTrailingChars);
            }
        }
       
        if (hasHeader && isHeader) {
View Full Code Here

       
        // Initialize the primary (body) model factory ignoring header and footer model classes
        PackageScanFilter defaultRecordScanFilter = new PackageScanFilter() {
            @Override
            public boolean matches(Class<?> type) {
                FixedLengthRecord record = type.getAnnotation(FixedLengthRecord.class);
                return record != null && !record.isFooter() && !record.isHeader();
            }
        };

        BindyFixedLengthFactory factory;
        if (getClassType() != null) {
            factory = new BindyFixedLengthFactory(resolver, defaultRecordScanFilter, getClassType());
        } else {
            factory = new BindyFixedLengthFactory(resolver, defaultRecordScanFilter, getPackages());
        }
       
        // Optionally initialize the header factory... using header model classes
        if (factory.hasHeader()) {
            PackageScanFilter headerScanFilter = new PackageScanFilter() {
                @Override
                public boolean matches(Class<?> type) {
                    FixedLengthRecord record = type.getAnnotation(FixedLengthRecord.class);
                    return record != null && record.isHeader();
                }
            };
           
            if (getClassType() != null) {
                this.headerFactory = new BindyFixedLengthFactory(resolver, headerScanFilter, getClassType());
            } else {
                this.headerFactory = new BindyFixedLengthFactory(resolver, headerScanFilter, getPackages());
            }
        }
       
        // Optionally initialize the footer factory... using footer model classes
        if (factory.hasFooter()) {
           
            PackageScanFilter footerScanFilter = new PackageScanFilter() {
                @Override
                public boolean matches(Class<?> type) {
                    FixedLengthRecord record = type.getAnnotation(FixedLengthRecord.class);
                    return record != null && record.isFooter();
                }
            };
           
            if (getClassType() != null) {
                this.footerFactory = new BindyFixedLengthFactory(resolver, footerScanFilter, getClassType());
View Full Code Here

       
        // Initialize the primary (body) model factory ignoring header and footer model classes
        PackageScanFilter defaultRecordScanFilter = new PackageScanFilter() {
            @Override
            public boolean matches(Class<?> type) {
                FixedLengthRecord record = type.getAnnotation(FixedLengthRecord.class);
                return record != null && !record.isFooter() && !record.isHeader();
            }
        };

        BindyFixedLengthFactory factory;
        if (getClassType() != null) {
            factory = new BindyFixedLengthFactory(resolver, defaultRecordScanFilter, getClassType());
        } else {
            factory = new BindyFixedLengthFactory(resolver, defaultRecordScanFilter, getPackages());
        }
       
        // Optionally initialize the header factory... using header model classes
        if (factory.hasHeader()) {
            PackageScanFilter headerScanFilter = new PackageScanFilter() {
                @Override
                public boolean matches(Class<?> type) {
                    FixedLengthRecord record = type.getAnnotation(FixedLengthRecord.class);
                    return record != null && record.isHeader();
                }
            };
           
            if (getClassType() != null) {
                this.headerFactory = new BindyFixedLengthFactory(resolver, headerScanFilter, getClassType());
            } else {
                this.headerFactory = new BindyFixedLengthFactory(resolver, headerScanFilter, getPackages());
            }
        }
       
        // Optionally initialize the footer factory... using footer model classes
        if (factory.hasFooter()) {
           
            PackageScanFilter footerScanFilter = new PackageScanFilter() {
                @Override
                public boolean matches(Class<?> type) {
                    FixedLengthRecord record = type.getAnnotation(FixedLengthRecord.class);
                    return record != null && record.isFooter();
                }
            };
           
            if (getClassType() != null) {
                this.footerFactory = new BindyFixedLengthFactory(resolver, footerScanFilter, getClassType());
View Full Code Here

TOP

Related Classes of org.apache.camel.dataformat.bindy.annotation.FixedLengthRecord

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.