-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
248 additions
and
55 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.moxun.generator; | ||
|
||
/** | ||
* Created by moxun on 16/3/7. | ||
*/ | ||
public class ClassNameUtil { | ||
public static String getName(String name) { | ||
char[] chars = name.toCharArray(); | ||
for (int i = 0; i < chars.length; i++) { | ||
char c = chars[i]; | ||
if (!Character.isLetter(c)) { | ||
chars[i] = '_'; | ||
if (i + 1 < chars.length) { | ||
chars[i + 1] = Character.toUpperCase(chars[i + 1]); | ||
} | ||
} | ||
} | ||
|
||
return String.valueOf(chars).replaceAll("_",""); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.