Java String Suffix suffixClassName(String tableName)

Here you can find the source of suffixClassName(String tableName)

Description

suffix Class Name

License

Open Source License

Declaration

public static String suffixClassName(String tableName) 

Method Source Code

//package com.java2s;
/*// w w w  .j  a  v  a 2s.  co m
 * @(#)FileUtils.java        1.0 2013-03-26
 *
 * Copyright (c) 2007-2013 Shanghai BSOFT IT, Co., Ltd.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of 
 * Shanghai BSFOT IT Co., Ltd. ("Confidential Information").  
 * You shall not disclose such Confidential Information and shall use 
 * it only in accordance with the terms of the license agreement you 
 * entered into with BSOFT.
 */

public class Main {

    public static String suffixClassName(String tableName) {
        String suffixClassName = getClassName(tableName);
        return suffixClassName + ".java";
    }

    public static String getClassName(String tn) {
        int index = tn.indexOf("_");
        String temp = "";
        if (index < 0) {
            return tn.substring(0, 1).toUpperCase() + tn.substring(1);
        } else {
            temp = tn.substring(0, index) + tn.substring(index + 1, index + 2).toUpperCase()
                    + tn.substring(index + 2);
            return getClassName(temp);
        }
    }
}

Related

  1. suffix(String str, int width, String with)
  2. suffix(String str, String suf)
  3. suffix(String string, final String suffix)
  4. suffix(String value, String prefix)
  5. suffix(String[] columns, String suffix)
  6. suffixes(char[] x, int[] suff)
  7. suffixLabel(String label, String tagSuffix)
  8. suffixName(String name)
  9. suffixNotNullStringOrDefault(String str, String defaultStr, String suffix)