BrightSide Workbench Full Report + Source Code
org.turro.jpa.search.DaoSearchKey Class Reference
Inheritance diagram for org.turro.jpa.search.DaoSearchKey:
Collaboration diagram for org.turro.jpa.search.DaoSearchKey:

Public Member Functions

 DaoSearchKey (String name, String type)
 
String getTag ()
 
String getType ()
 
String getName ()
 
String getValue ()
 
String getValue (String defaultValue)
 
void setValue (String value)
 
HashMap< String, String > getAttributes ()
 
ArrayList< String > getOptions ()
 
void readXML (Element item)
 
void readParam (IConstructor constructor)
 
boolean applyToQuery (WhereClause wc, List< String > fields, boolean withSynonyms)
 
boolean applyToQueryFull (WhereClause wc, String fields, boolean withSynonyms)
 

Detailed Description

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

Definition at line 36 of file DaoSearchKey.java.

Constructor & Destructor Documentation

◆ DaoSearchKey()

org.turro.jpa.search.DaoSearchKey.DaoSearchKey ( String  name,
String  type 
)

Definition at line 43 of file DaoSearchKey.java.

43  {
44  this.name = name;
45  this.type = type;
46  attributes = new HashMap<>();
47  options = new ArrayList<>();
48  }

Member Function Documentation

◆ applyToQuery()

boolean org.turro.jpa.search.DaoSearchKey.applyToQuery ( WhereClause  wc,
List< String >  fields,
boolean  withSynonyms 
)

Definition at line 102 of file DaoSearchKey.java.

102  {
103  if(!Strings.isBlank(getValue())) {
104  SQLUtil.applySearchToQuery(getValue(), wc, fields, withSynonyms);
105  return true;
106  }
107  return false;
108  }
Here is the call graph for this function:

◆ applyToQueryFull()

boolean org.turro.jpa.search.DaoSearchKey.applyToQueryFull ( WhereClause  wc,
String  fields,
boolean  withSynonyms 
)

Definition at line 110 of file DaoSearchKey.java.

110  {
111  if(!Strings.isBlank(getValue())) {
112  SQLUtil.applyFullsearchToQuery(getValue(), wc, fields, withSynonyms);
113  return true;
114  }
115  return false;
116  }
Here is the call graph for this function:

◆ getAttributes()

HashMap<String, String> org.turro.jpa.search.DaoSearchKey.getAttributes ( )

Definition at line 74 of file DaoSearchKey.java.

74  {
75  return attributes;
76  }

◆ getName()

String org.turro.jpa.search.DaoSearchKey.getName ( )

Definition at line 58 of file DaoSearchKey.java.

58  {
59  return name;
60  }

◆ getOptions()

ArrayList<String> org.turro.jpa.search.DaoSearchKey.getOptions ( )

Definition at line 78 of file DaoSearchKey.java.

78  {
79  return options;
80  }

◆ getTag()

String org.turro.jpa.search.DaoSearchKey.getTag ( )

Definition at line 50 of file DaoSearchKey.java.

50  {
51  return tag;
52  }

◆ getType()

String org.turro.jpa.search.DaoSearchKey.getType ( )

Definition at line 54 of file DaoSearchKey.java.

54  {
55  return type;
56  }

◆ getValue() [1/2]

String org.turro.jpa.search.DaoSearchKey.getValue ( )

Definition at line 62 of file DaoSearchKey.java.

62  {
63  return value == null ? "" : value;
64  }
Here is the caller graph for this function:

◆ getValue() [2/2]

String org.turro.jpa.search.DaoSearchKey.getValue ( String  defaultValue)

Definition at line 66 of file DaoSearchKey.java.

66  {
67  return value == null ? defaultValue : value;
68  }

◆ readParam()

void org.turro.jpa.search.DaoSearchKey.readParam ( IConstructor  constructor)

Definition at line 98 of file DaoSearchKey.java.

98  {
99  value = constructor.getParameter(name);
100  }
Here is the call graph for this function:

◆ readXML()

void org.turro.jpa.search.DaoSearchKey.readXML ( Element  item)

Definition at line 82 of file DaoSearchKey.java.

82  {
83  tag = item.getName();
84  for(Object attr : item.getAttributes()) {
85  if(attr instanceof Attribute) {
86  Attribute attribute = (Attribute) attr;
87  String name = attribute.getName();
88  if(!name.equals("name") && !name.equals("type")) {
89  attributes.put(name, attribute.getValue());
90  }
91  }
92  }
93  for(Element option : (List<Element>) item.getChildren()) {
94  options.add(option.getTextNormalize());
95  }
96  }

◆ setValue()

void org.turro.jpa.search.DaoSearchKey.setValue ( String  value)

Definition at line 70 of file DaoSearchKey.java.

70  {
71  this.value = value;
72  }
Here is the caller graph for this function:

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