|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.groupdocs.annotation.utils.Utils
public class Utils
Utils methods
| Constructor Summary | |
|---|---|
Utils()
|
|
| Method Summary | ||
|---|---|---|
static
|
assetEntity(T t)
Asset entity for null |
|
static
|
assetEntity(T t,
String errorMessage)
Asset entity for null |
|
static void |
closeStreams(Object... streams)
For each parameters if it extends @{InputStream} or @{OutputStream} will call .close() method |
|
static String |
decodeData(String data)
Decode base64 data |
|
static String |
dt2s(Date date)
Date to String format for database |
|
static String |
encodeData(String data)
Encode data to base64 |
|
static
|
fromJson(String jsonString,
Class<T> clazz)
Convert json to object |
|
static String |
getBody(javax.servlet.http.HttpServletRequest request)
Get body from HTTP servlet request |
|
static
|
getObjectData(String request,
Class<T> clazz)
Get object from request |
|
static String |
makeAppPath(javax.servlet.http.HttpServletRequest request)
Make base application path using parameters from request object |
|
static String |
processTemplate(String templateName,
Map<String,String> replaceValues)
Process template (replace all ${some_word|default_value} to value in params map) |
|
static Date |
s2dt(String strDate)
Parse String to Date format (default date format "yyyy-MM-dd HH:mm:ss" ) |
|
static Date |
s2dt(String strDate,
String dateFormat)
Parse String to Date format |
|
static String |
toJson(Object obj)
Convert object to json |
|
static long |
utcToLocal(long utcTime)
Convert UTC time to local time using TimeZone.getDefault() |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Utils()
| Method Detail |
|---|
public static String processTemplate(String templateName,
Map<String,String> replaceValues)
throws IOException
templateName - template namereplaceValues - map with params
IOException
public static <T> T getObjectData(String request,
Class<T> clazz)
throws IOException
T - object typerequest - requestclazz - class type
IOException
public static String getBody(javax.servlet.http.HttpServletRequest request)
throws IOException
request - HTTP servlet request
IOExceptionpublic static String toJson(Object obj)
obj - object to convert
public static <T> T fromJson(String jsonString,
Class<T> clazz)
T - object typejsonString - jsonclazz - object type class
public static <T extends com.groupdocs.annotation.db.tables.GroupDocsAnnotationTable> T assetEntity(T t)
throws NullPointerException
T - entity typet - entity
NullPointerException
public static <T extends com.groupdocs.annotation.db.tables.GroupDocsAnnotationTable> T assetEntity(T t,
String errorMessage)
throws NullPointerException
T - entity typet - entityerrorMessage - error message
NullPointerExceptionpublic static String dt2s(Date date)
date - input date
public static Date s2dt(String strDate)
strDate - date as String
public static Date s2dt(String strDate,
String dateFormat)
strDate - date as StringdateFormat - date format to parse (sample "yyyy-MM-dd HH:mm:ss" )
public static String decodeData(String data)
data - data to be decoded
public static String encodeData(String data)
data - data to be encoded
public static void closeStreams(Object... streams)
streams - streams to closepublic static long utcToLocal(long utcTime)
utcTime - UTC time
public static String makeAppPath(javax.servlet.http.HttpServletRequest request)
request - http servlet request
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||