Example usage for org.apache.commons.lang StringUtils rightPad

List of usage examples for org.apache.commons.lang StringUtils rightPad

Introduction

In this page you can find the example usage for org.apache.commons.lang StringUtils rightPad.

Prototype

public static String rightPad(String str, int size, String padStr) 

Source Link

Document

Right pad a String with a specified String.

Usage

From source file:org.kuali.kfs.gl.GeneralLedgerConstants.java

public static String getSpaceTransactionEntrySequenceNumber() {
    if (SPACE_TRANSACTION_ENTRY_SEQUENCE_NUMBER == null) {
        SPACE_TRANSACTION_ENTRY_SEQUENCE_NUMBER = StringUtils
                .rightPad("",
                        SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(
                                OriginEntryFull.class, KFSPropertyConstants.TRANSACTION_ENTRY_SEQUENCE_NUMBER),
                        ' ');
    }/*from ww  w.ja v a 2s  .c  o  m*/
    return SPACE_TRANSACTION_ENTRY_SEQUENCE_NUMBER;
}

From source file:org.kuali.kfs.gl.GeneralLedgerConstants.java

public static String getSpaceTransactionLedgetEntryDescription() {
    if (SPACE_TRANSACTION_LEDGER_ENTRY_DESCRIPTION == null) {
        SPACE_TRANSACTION_LEDGER_ENTRY_DESCRIPTION = StringUtils
                .rightPad("",
                        SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(
                                OriginEntryFull.class, KFSPropertyConstants.TRANSACTION_LEDGER_ENTRY_DESC),
                        ' ');
    }/*from  w w w  . java 2 s  . co  m*/
    return SPACE_TRANSACTION_LEDGER_ENTRY_DESCRIPTION;
}

From source file:org.kuali.kfs.gl.GeneralLedgerConstants.java

public static String getSpaceSubAccountTypeCode() {
    if (SPACE_SUB_ACCOUNT_TYPE_CODE == null) {
        SPACE_SUB_ACCOUNT_TYPE_CODE = StringUtils.rightPad("",
                SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(A21SubAccount.class,
                        KFSPropertyConstants.SUB_ACCOUNT_TYPE_CODE),
                ' ');
    }//from www .java2 s.  c o  m
    return SPACE_SUB_ACCOUNT_TYPE_CODE;
}

From source file:org.kuali.kfs.gl.GeneralLedgerConstants.java

public static String getSpaceAllOriginEntryFields() {
    if (SPACE_ALL_ORIGIN_ENTRY_FIELDS == null) {
        List<AttributeDefinition> attributes = SpringContext.getBean(DataDictionaryService.class)
                .getDataDictionary().getBusinessObjectEntry(OriginEntryFull.class.getName()).getAttributes();

        int totalLength = 0;

        for (AttributeDefinition attributeDefinition : attributes) {

            if (!(KFSPropertyConstants.ENTRY_GROUP_ID.equals(attributeDefinition.getName())
                    || KFSPropertyConstants.ENTRY_ID.equals(attributeDefinition.getName()))) {
                totalLength += attributeDefinition.getMaxLength();
            }//from   w w w.  j a  va2 s  .  com
        }

        SPACE_ALL_ORIGIN_ENTRY_FIELDS = StringUtils.rightPad("", totalLength, ' ');
    }

    return SPACE_ALL_ORIGIN_ENTRY_FIELDS;
}

From source file:org.kuali.kfs.gl.GeneralLedgerConstants.java

public static String getSpaceAllCollectorBatchHeaderFields() {
    if (SPACE_ALL_COLLECTOR_BATCH_HEADER_FIELDS == null) {
        List<AttributeDefinition> attributes = SpringContext.getBean(DataDictionaryService.class)
                .getDataDictionary().getBusinessObjectEntry(CollectorBatch.class.getName()).getAttributes();

        int totalLength = 0;

        for (AttributeDefinition attributeDefinition : attributes) {
            if (!(KFSPropertyConstants.TRAILER_RECORD_FIRST_EMPTY_FIELD.equals(attributeDefinition.getName())
                    || KFSPropertyConstants.TOTAL_RECORDS.equals(attributeDefinition.getName())
                    || KFSPropertyConstants.TRAILER_RECORD_SECOND_EMPTY_FIELD
                            .equals(attributeDefinition.getName())
                    || KFSPropertyConstants.TOTAL_AMOUNT.equals(attributeDefinition.getName()))) {
                totalLength += attributeDefinition.getMaxLength();
            }// w  ww .j  a va  2 s . com
        }

        SPACE_ALL_COLLECTOR_BATCH_HEADER_FIELDS = StringUtils.rightPad("", totalLength, ' ');
    }

    return SPACE_ALL_COLLECTOR_BATCH_HEADER_FIELDS;
}

From source file:org.kuali.kfs.gl.GeneralLedgerConstants.java

public static String getSpaceAllCollectorBatchTrailerFields() {
    if (SPACE_ALL_COLLECTOR_BATCH_TRAILER_FIELDS == null) {
        List<AttributeDefinition> attributes = SpringContext.getBean(DataDictionaryService.class)
                .getDataDictionary().getBusinessObjectEntry(CollectorBatch.class.getName()).getAttributes();

        int totalLength = 0;

        for (AttributeDefinition attributeDefinition : attributes) {
            if ((KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR.equals(attributeDefinition.getName())
                    || KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE.equals(attributeDefinition.getName())
                    || KFSPropertyConstants.ORGANIZATION_CODE.equals(attributeDefinition.getName())
                    || KFSPropertyConstants.TRANSMISSION_DATE.equals(attributeDefinition.getName())
                    || KFSPropertyConstants.COLLECTOR_BATCH_RECORD_TYPE.equals(attributeDefinition.getName())
                    || KFSPropertyConstants.TRAILER_RECORD_FIRST_EMPTY_FIELD
                            .equals(attributeDefinition.getName())
                    || KFSPropertyConstants.TOTAL_RECORDS.equals(attributeDefinition.getName())
                    || KFSPropertyConstants.TRAILER_RECORD_SECOND_EMPTY_FIELD
                            .equals(attributeDefinition.getName())
                    || KFSPropertyConstants.TOTAL_AMOUNT.equals(attributeDefinition.getName()))) {
                totalLength += attributeDefinition.getMaxLength();
            }//from www.j a  va 2s .  co  m
        }

        SPACE_ALL_COLLECTOR_BATCH_TRAILER_FIELDS = StringUtils.rightPad("", totalLength, ' ');
    }

    return SPACE_ALL_COLLECTOR_BATCH_TRAILER_FIELDS;
}

From source file:org.kuali.kfs.gl.GeneralLedgerConstants.java

public static String getSpaceAllCollectorDetailFields() {
    if (SPACE_ALL_COLLECTOR_DETAIL_FIELDS == null) {
        CollectorDetailFieldUtil collectorDetailFieldUtil = new CollectorDetailFieldUtil();
        int totalLength = collectorDetailFieldUtil.getDetailLineTotalLength();

        SPACE_ALL_COLLECTOR_DETAIL_FIELDS = StringUtils.rightPad("", totalLength, ' ');
    }/*w w  w .j  av a 2  s .c  o  m*/

    return SPACE_ALL_COLLECTOR_DETAIL_FIELDS;
}

From source file:org.kuali.kfs.gl.GeneralLedgerConstants.java

public static String getZeroTransactionEntrySequenceNumber() {
    if (ZERO_TRANSACTION_ENTRY_SEQUENCE_NUMBER == null) {
        ZERO_TRANSACTION_ENTRY_SEQUENCE_NUMBER = StringUtils
                .rightPad("",
                        SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(
                                OriginEntryFull.class, KFSPropertyConstants.TRANSACTION_ENTRY_SEQUENCE_NUMBER),
                        '0');
    }/*from w  w w .j  a  v  a  2  s  . c om*/
    return ZERO_TRANSACTION_ENTRY_SEQUENCE_NUMBER;
}

From source file:org.kuali.kfs.gl.GeneralLedgerConstants.java

public static String getZeroTransactionLedgerEntryAmount() {
    OriginEntryFieldUtil oefu = new OriginEntryFieldUtil();
    int length = oefu.getFieldLengthMap().get(KFSPropertyConstants.TRANSACTION_LEDGER_ENTRY_AMOUNT);

    String amount = "";
    amount = StringUtils.rightPad("+", length - 3, "0") + ".00";

    return amount;
}

From source file:org.kuali.kfs.gl.GeneralLedgerConstants.java

public static String getDashOrganizationReferenceId() {
    if (DASH_ORGANIZATION_REFERENCE_ID == null) {
        DASH_ORGANIZATION_REFERENCE_ID = StringUtils.rightPad("",
                SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(OriginEntryFull.class,
                        KFSPropertyConstants.ORGANIZATION_REFERENCE_ID),
                '-');
    }/*from  w ww.  j av a 2s  . co  m*/
    return DASH_ORGANIZATION_REFERENCE_ID;
}