BrightSide Workbench Full Report + Source Code
org.turro.action.UserSummaries Class Reference

Static Public Member Functions

static void initSummaries (IConstructor constructor)
 
static String parseSummaries (IConstructor constructor)
 
static boolean isNotZero (String attribute)
 
static boolean isTrue (String attribute)
 
static Object getAttribute (String attribute)
 
static Object getAttribute (String attribute, Object defaultValue)
 
static void setAttribute (String attribute, Object value)
 
static Map< String, Object > getAttributes ()
 
static void removeAttributes ()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 35 of file UserSummaries.java.

Member Function Documentation

◆ getAttribute() [1/2]

static Object org.turro.action.UserSummaries.getAttribute ( String  attribute)
static

Definition at line 78 of file UserSummaries.java.

78  {
79  return Application.getApplication().getConstructor().findAttribute("us_" + attribute);
80  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAttribute() [2/2]

static Object org.turro.action.UserSummaries.getAttribute ( String  attribute,
Object  defaultValue 
)
static

Definition at line 82 of file UserSummaries.java.

82  {
83  Object value = Application.getApplication().getConstructor().findAttribute("us_" + attribute);
84  return value == null ? defaultValue : value;
85  }
Here is the call graph for this function:

◆ getAttributes()

static Map<String, Object> org.turro.action.UserSummaries.getAttributes ( )
static

Definition at line 91 of file UserSummaries.java.

91  {
92  return Application.getApplication().getConstructor().getSessionAttributeMap("us_");
93  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initSummaries()

static void org.turro.action.UserSummaries.initSummaries ( IConstructor  constructor)
static

Definition at line 37 of file UserSummaries.java.

37  {
38  for(IUserSummary iSummary : getSortedSummaries()) {
39  iSummary.init(constructor);
40  }
41  }
Here is the caller graph for this function:

◆ isNotZero()

static boolean org.turro.action.UserSummaries.isNotZero ( String  attribute)
static

Definition at line 62 of file UserSummaries.java.

62  {
63  Object attr = Application.getApplication().getConstructor().findAttribute("us_" + attribute);
64  if(attr instanceof Number) {
65  return ((Number) attr).doubleValue() != 0.0;
66  }
67  return false;
68  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isTrue()

static boolean org.turro.action.UserSummaries.isTrue ( String  attribute)
static

Definition at line 70 of file UserSummaries.java.

70  {
71  Object attr = Application.getApplication().getConstructor().findAttribute("us_" + attribute);
72  if(attr instanceof Boolean) {
73  return ((Boolean) attr).booleanValue();
74  }
75  return false;
76  }
Here is the call graph for this function:

◆ parseSummaries()

static String org.turro.action.UserSummaries.parseSummaries ( IConstructor  constructor)
static

Definition at line 43 of file UserSummaries.java.

43  {
44  initSummaries(constructor);
45  String prevSummary = null, separator = renderSeparator(constructor);
46  StringBuilder sb = new StringBuilder();
47  for(IUserSummary iSummary : getSortedSummaries()) {
48  String summary = iSummary.render(constructor);
49  if(!Strings.isBlank(summary)) {
50  if(!Strings.isBlank(prevSummary)) {
51  sb.append(separator);
52  }
53  sb.append(summary);
54  prevSummary = summary;
55  }
56  }
57  return sb.toString();
58  }
static void initSummaries(IConstructor constructor)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeAttributes()

static void org.turro.action.UserSummaries.removeAttributes ( )
static

Definition at line 95 of file UserSummaries.java.

95  {
96  for(String key : getAttributes().keySet()) {
97  Application.getApplication().getConstructor().removeSessionAttribute("us_" + key);
98  }
99  }
static Map< String, Object > getAttributes()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAttribute()

static void org.turro.action.UserSummaries.setAttribute ( String  attribute,
Object  value 
)
static

Definition at line 87 of file UserSummaries.java.

87  {
88  Application.getApplication().getConstructor().setSessionAttribute("us_" + attribute, value);
89  }
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: