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.ole.gl.GeneralLedgerConstants.java

public static String getSpaceFinancialSystemOriginationCode() {
    if (SPACE_FINANCIAL_SYSTEM_ORIGINATION_CODE == null) {
        SPACE_FINANCIAL_SYSTEM_ORIGINATION_CODE = StringUtils
                .rightPad("",
                        SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(
                                OriginationCode.class, OLEPropertyConstants.FINANCIAL_SYSTEM_ORIGINATION_CODE),
                        ' ');
    }/*from  ww  w .j  ava2 s .  co  m*/
    return SPACE_FINANCIAL_SYSTEM_ORIGINATION_CODE;
}

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

public static String getSpaceDebitCreditCode() {
    if (SPACE_DEBIT_CREDIT_CODE == null) {
        SPACE_DEBIT_CREDIT_CODE = StringUtils
                .rightPad("",
                        SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(
                                OriginEntryFull.class, OLEPropertyConstants.TRANSACTION_DEBIT_CREDIT_CODE),
                        ' ');
    }/*from w  ww  .  j av  a2  s  . c  om*/
    return SPACE_DEBIT_CREDIT_CODE;
}

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

public static String getSpaceFinancialObjectCode() {
    if (SPACE_FINANCIAL_OBJECT_CODE == null) {
        SPACE_FINANCIAL_OBJECT_CODE = StringUtils.rightPad("",
                SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(ObjectCode.class,
                        OLEPropertyConstants.FINANCIAL_OBJECT_CODE),
                ' ');
    }/* ww  w  .ja  va 2 s .  co m*/
    return SPACE_FINANCIAL_OBJECT_CODE;
}

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

public static String getSpaceTransactionDate() {
    if (SPACE_TRANSACTION_DATE == null) {
        SPACE_TRANSACTION_DATE = StringUtils.rightPad("", SpringContext.getBean(DataDictionaryService.class)
                .getAttributeMaxLength(OriginEntryFull.class, OLEPropertyConstants.TRANSACTION_DATE), ' ');
    }//ww w  . j  a v a 2  s.co m
    return SPACE_TRANSACTION_DATE;
}

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

public static String getSpaceUniversityFiscalYear() {
    if (SPACE_UNIVERSITY_FISCAL_YEAR == null) {
        SPACE_UNIVERSITY_FISCAL_YEAR = StringUtils.rightPad("",
                SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(OriginEntryFull.class,
                        OLEPropertyConstants.UNIVERSITY_FISCAL_YEAR),
                ' ');
    }/*w w  w . ja v a 2  s. c  o  m*/
    return SPACE_UNIVERSITY_FISCAL_YEAR;
}

From source file:org.kuali.ole.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, OLEPropertyConstants.TRANSACTION_ENTRY_SEQUENCE_NUMBER),
                        ' ');
    }//from   ww  w. ja  v a  2  s  . co m
    return SPACE_TRANSACTION_ENTRY_SEQUENCE_NUMBER;
}

From source file:org.kuali.ole.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, OLEPropertyConstants.TRANSACTION_LEDGER_ENTRY_DESC),
                        ' ');
    }/* w ww.j  a  v a2 s .  co  m*/
    return SPACE_TRANSACTION_LEDGER_ENTRY_DESCRIPTION;
}

From source file:org.kuali.ole.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,
                        OLEPropertyConstants.SUB_ACCOUNT_TYPE_CODE),
                ' ');
    }/*from ww w . j a va  2  s. c  o  m*/
    return SPACE_SUB_ACCOUNT_TYPE_CODE;
}

From source file:org.kuali.ole.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 (!(OLEPropertyConstants.ENTRY_GROUP_ID.equals(attributeDefinition.getName())
                    || OLEPropertyConstants.ENTRY_ID.equals(attributeDefinition.getName()))) {
                totalLength += attributeDefinition.getMaxLength();
            }/*from   ww  w .ja v  a2 s.c  o m*/
        }

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

    return SPACE_ALL_ORIGIN_ENTRY_FIELDS;
}

From source file:org.kuali.ole.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 (!(OLEPropertyConstants.TRAILER_RECORD_FIRST_EMPTY_FIELD.equals(attributeDefinition.getName())
                    || OLEPropertyConstants.TOTAL_RECORDS.equals(attributeDefinition.getName())
                    || OLEPropertyConstants.TRAILER_RECORD_SECOND_EMPTY_FIELD
                            .equals(attributeDefinition.getName())
                    || OLEPropertyConstants.TOTAL_AMOUNT.equals(attributeDefinition.getName()))) {
                totalLength += attributeDefinition.getMaxLength();
            }// w w w  .  j av  a 2s .c  o  m
        }

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

    return SPACE_ALL_COLLECTOR_BATCH_HEADER_FIELDS;
}