类 Utils
- java.lang.Object
-
- io.github.yedaxia.apidocs.Utils
-
public class Utils extends java.lang.Object
-
-
构造器概要
构造器 构造器 说明 Utils()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static java.lang.Stringcapitalize(java.lang.String name)make first word capitalizestatic java.lang.StringcleanCommentContent(java.lang.String content)remove some characters like [* \n]static voidcloseSilently(java.io.Closeable stream)close streamstatic java.lang.Stringdecapitalize(java.lang.String name)make first word lower casestatic java.lang.StringgetActionUrl(java.lang.String baseUrl, java.lang.String relativeUrl)get url with base urlstatic java.lang.StringgetClassName(java.lang.String packageClass)get simple class namestatic java.lang.StringgetJavaFileName(java.io.File javaFile)get file name without extensionstatic java.util.List<java.lang.String>getModuleNames(java.io.File projectDir)get project modules namestatic booleanhasDirInFile(java.io.File f, java.io.File stopPath, java.lang.String dirName)judge dir is in file's path or notstatic booleanisJFinalFramework(java.io.File javaSrcDir)the project is a jfinal framework or notstatic booleanisNotEmpty(java.lang.String str)judge input string is not emptystatic booleanisPlayFramework(java.io.File projectDir)the project is a play framework or notstatic booleanisSpringFramework(java.io.File javaSrcDir)the project is a spring mvc framework or notstatic booleanisValueType(java.lang.Object value)is value type or notstatic java.lang.StringjoinArrayString(java.lang.String[] array, java.lang.String separator)join string array , ( e.g.static <T> TjsonToObject(java.lang.String json, java.lang.Class<T> type)json string to objectstatic voidmkdirsForFile(java.io.File file)create dirs for filestatic java.lang.StringremoveQuotations(java.lang.String rawUrl)some parse url may has double quotation, remove themstatic java.lang.StringstreamToString(java.io.InputStream in)simple read stream to Stringstatic java.lang.StringtoJson(java.lang.Object map)object to simple jsonstatic java.lang.StringtoPrettyJson(java.lang.Object map)object to pretty jsonstatic voidwideSearchFile(java.io.File rootPath, java.io.FilenameFilter filter, java.util.List<java.io.File> result, boolean stopAtFirstResult)search files match filter, store in resultstatic voidwriteToDisk(java.io.File f, java.lang.String content)write content to file
-
-
-
方法详细资料
-
toPrettyJson
public static java.lang.String toPrettyJson(java.lang.Object map)
object to pretty json- 参数:
map-- 返回:
-
toJson
public static java.lang.String toJson(java.lang.Object map)
object to simple json- 参数:
map-- 返回:
-
jsonToObject
public static <T> T jsonToObject(java.lang.String json, java.lang.Class<T> type)json string to object- 类型参数:
T-- 参数:
json-type-- 返回:
-
writeToDisk
public static void writeToDisk(java.io.File f, java.lang.String content) throws java.io.IOExceptionwrite content to file- 参数:
f-content-- 抛出:
java.io.IOException
-
closeSilently
public static void closeSilently(java.io.Closeable stream)
close stream- 参数:
stream-
-
streamToString
public static java.lang.String streamToString(java.io.InputStream in) throws java.io.IOExceptionsimple read stream to String- 参数:
in-- 返回:
- 抛出:
java.io.IOException
-
isNotEmpty
public static boolean isNotEmpty(java.lang.String str)
judge input string is not empty- 参数:
str-- 返回:
-
removeQuotations
public static java.lang.String removeQuotations(java.lang.String rawUrl)
some parse url may has double quotation, remove them- 参数:
rawUrl-- 返回:
-
cleanCommentContent
public static java.lang.String cleanCommentContent(java.lang.String content)
remove some characters like [* \n]- 参数:
content-- 返回:
-
getActionUrl
public static java.lang.String getActionUrl(java.lang.String baseUrl, java.lang.String relativeUrl)get url with base url- 参数:
baseUrl-relativeUrl-- 返回:
-
decapitalize
public static java.lang.String decapitalize(java.lang.String name)
make first word lower case- 参数:
name-- 返回:
-
capitalize
public static java.lang.String capitalize(java.lang.String name)
make first word capitalize- 参数:
name-- 返回:
-
joinArrayString
public static java.lang.String joinArrayString(java.lang.String[] array, java.lang.String separator)join string array , ( e.g. ([a,a,a] , .) = a.a.a )- 参数:
array-separator-- 返回:
-
getJavaFileName
public static java.lang.String getJavaFileName(java.io.File javaFile)
get file name without extension- 参数:
javaFile-- 返回:
-
wideSearchFile
public static void wideSearchFile(java.io.File rootPath, java.io.FilenameFilter filter, java.util.List<java.io.File> result, boolean stopAtFirstResult)search files match filter, store in result- 参数:
rootPath-filter-result-stopAtFirstResult- stop when first file matches
-
hasDirInFile
public static boolean hasDirInFile(java.io.File f, java.io.File stopPath, java.lang.String dirName)judge dir is in file's path or not- 参数:
f-stopPath- stopPathdirName-- 返回:
-
isPlayFramework
public static boolean isPlayFramework(java.io.File projectDir)
the project is a play framework or not- 参数:
projectDir- 工程目录- 返回:
-
isSpringFramework
public static boolean isSpringFramework(java.io.File javaSrcDir)
the project is a spring mvc framework or not- 参数:
javaSrcDir-- 返回:
-
isJFinalFramework
public static boolean isJFinalFramework(java.io.File javaSrcDir)
the project is a jfinal framework or not- 参数:
javaSrcDir-- 返回:
-
isValueType
public static boolean isValueType(java.lang.Object value)
is value type or not- 参数:
value-- 返回:
-
getClassName
public static java.lang.String getClassName(java.lang.String packageClass)
get simple class name- 参数:
packageClass-- 返回:
-
getModuleNames
public static java.util.List<java.lang.String> getModuleNames(java.io.File projectDir)
get project modules name- 参数:
projectDir-- 返回:
-
mkdirsForFile
public static void mkdirsForFile(java.io.File file)
create dirs for file- 参数:
file-
-
-