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 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 ((OLEPropertyConstants.UNIVERSITY_FISCAL_YEAR.equals(attributeDefinition.getName())
                    || OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE.equals(attributeDefinition.getName())
                    || OLEPropertyConstants.ORGANIZATION_CODE.equals(attributeDefinition.getName())
                    || OLEPropertyConstants.TRANSMISSION_DATE.equals(attributeDefinition.getName())
                    || OLEPropertyConstants.COLLECTOR_BATCH_RECORD_TYPE.equals(attributeDefinition.getName())
                    || 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();
            }//from   w w w.j ava  2s.  c  o m
        }

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

    return SPACE_ALL_COLLECTOR_BATCH_TRAILER_FIELDS;
}

From source file:org.kuali.ole.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, OLEPropertyConstants.TRANSACTION_ENTRY_SEQUENCE_NUMBER),
                        '0');
    }/*from   w ww.jav  a2  s  . c om*/
    return ZERO_TRANSACTION_ENTRY_SEQUENCE_NUMBER;
}

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

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

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

    return amount;
}

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

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

public static String getSpaceChartOfAccountsCode() {
    if (SPACE_CHART_OF_ACCOUNTS_CODE == null) {
        SPACE_CHART_OF_ACCOUNTS_CODE = StringUtils.rightPad("",
                SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(OriginEntryFull.class,
                        OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE),
                ' ');
    }// w ww .ja va2 s  .c  o  m
    return SPACE_CHART_OF_ACCOUNTS_CODE;
}

From source file:org.kuali.ole.sys.OLEConstants.java

public static String getDashFinancialObjectCode() {
    if (DASH_FINANCIAL_OBJECT_CODE == null) {
        DASH_FINANCIAL_OBJECT_CODE = StringUtils.rightPad("", SpringContext.getBean(DataDictionaryService.class)
                .getAttributeMaxLength(OriginEntryFull.class, OLEPropertyConstants.FINANCIAL_OBJECT_CODE), '-');
    }/*ww w. j  a va2 s  .c o  m*/
    return DASH_FINANCIAL_OBJECT_CODE;
}

From source file:org.kuali.ole.sys.OLEConstants.java

public static String getDashFinancialSubObjectCode() {
    if (DASH_FINANCIAL_SUB_OBJECT_CODE == null) {
        DASH_FINANCIAL_SUB_OBJECT_CODE = StringUtils.rightPad("",
                SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(OriginEntryFull.class,
                        OLEPropertyConstants.FINANCIAL_SUB_OBJECT_CODE),
                '-');
    }/*from   w ww.  j a  va2  s .co m*/
    return DASH_FINANCIAL_SUB_OBJECT_CODE;
}

From source file:org.kuali.ole.sys.OLEConstants.java

public static String getDashSubAccountNumber() {
    if (DASH_SUB_ACCOUNT_NUMBER == null) {
        DASH_SUB_ACCOUNT_NUMBER = StringUtils.rightPad("", SpringContext.getBean(DataDictionaryService.class)
                .getAttributeMaxLength(OriginEntryFull.class, OLEPropertyConstants.SUB_ACCOUNT_NUMBER), '-');
    }//w  w w .jav  a 2  s  .  c o m
    return DASH_SUB_ACCOUNT_NUMBER;
}

From source file:org.kuali.ole.sys.OLEConstants.java

public static String getSpaceSubAccountNumber() {
    if (SPACE_SUB_ACCOUNT_NUMBER == null) {
        SPACE_SUB_ACCOUNT_NUMBER = StringUtils.rightPad("", SpringContext.getBean(DataDictionaryService.class)
                .getAttributeMaxLength(OriginEntryFull.class, OLEPropertyConstants.SUB_ACCOUNT_NUMBER), ' ');
    }/*from   w  w w .  ja va2s.c  om*/
    return SPACE_SUB_ACCOUNT_NUMBER;
}

From source file:org.kuali.ole.sys.OLEConstants.java

public static String getDashProjectCode() {
    if (DASH_PROJECT_CODE == null) {
        DASH_PROJECT_CODE = StringUtils.rightPad("", SpringContext.getBean(DataDictionaryService.class)
                .getAttributeMaxLength(OriginEntryFull.class, OLEPropertyConstants.PROJECT_CODE), '-');
    }/*from www  .  j  a  v a 2  s  . co m*/
    return DASH_PROJECT_CODE;
}