|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.day.cq.reporting.helpers.Util
public class Util
Class that provides some helper functionality.
| Method Summary | |
|---|---|
static boolean |
arrayContainsString(String[] array,
String str)
Determines if the specified String array contains the specified string. |
static void |
clearTime(Calendar calendar)
Clears the time information by setting it back to midnight. |
static long |
createTimeStamp(Calendar cal)
Creates a timestamp (format: yyyymmddhhmmss) from the specified Calendar, |
static boolean |
equalsNullAware(Object obj1,
Object obj2)
Compares two objects by their respective Object.equals(java.lang.Object) methods. |
static String |
getChartIdFromRequest(SlingHttpServletRequest req)
Gets a chart id for rendering from the specified request, if applicable. |
static String |
getChartLayoutFromRequest(SlingHttpServletRequest req)
Determines a provided chart layout from the specified request, if applicable. |
static Integer[] |
getRenderSizeFromRequest(SlingHttpServletRequest req)
Determines a predefines size from the specified request, if applicable. |
static String |
getRenderTypeFromRequest(SlingHttpServletRequest req)
Gets the render type from the reuest. |
static boolean |
isSingleViewRendering(SlingHttpServletRequest req)
Checks if the specified request triggers a single view rendering. |
static void |
writeToJSON(JSONWriter writer,
com.day.cq.reporting.impl.snapshots.AggregationInterval interval,
Calendar cal,
TimeZone timeZone,
Locale locale)
Writes the specified Calendar to the specified JSONWriter. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static long createTimeStamp(Calendar cal)
Calendar,
cal - The calendar
public static void writeToJSON(JSONWriter writer,
com.day.cq.reporting.impl.snapshots.AggregationInterval interval,
Calendar cal,
TimeZone timeZone,
Locale locale)
throws JSONException
Calendar to the specified JSONWriter.
writer - The writerinterval - The aggregation interval to create display values forcal - The calendartimeZone - The time zonelocale - The locale
JSONException - if writing data failedpublic static void clearTime(Calendar calendar)
calendar - The calendar to clear time information from
public static boolean arrayContainsString(String[] array,
String str)
String array contains the specified string.
array - The arraystr - The string
true if the array contains the given stringpublic static String getRenderTypeFromRequest(SlingHttpServletRequest req)
req - The request to determine the render type from
Const.RENDER_TYPE_TABULAR or
Const.RENDER_TYPE_CHART; null for rendering the
chart in default modepublic static String getChartIdFromRequest(SlingHttpServletRequest req)
req - The request
null if no chart id is available/requiredpublic static boolean isSingleViewRendering(SlingHttpServletRequest req)
req - The request to be analyzed
true if a single view rendering is triggered by the requestpublic static Integer[] getRenderSizeFromRequest(SlingHttpServletRequest req)
req - The request
null,
indicating that the respective dimension has to be autocalculatedpublic static String getChartLayoutFromRequest(SlingHttpServletRequest req)
req - The request
null (if no
chart layout was provided)
public static boolean equalsNullAware(Object obj1,
Object obj2)
Compares two objects by their respective Object.equals(java.lang.Object) methods. Both objects
may be null.
obj1 - The first objectobj2 - The second object
true if both objects are equal
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||