BrightSide Workbench Full Report + Source Code
org.turro.fieldit.StringList Class Reference
Inheritance diagram for org.turro.fieldit.StringList:

Public Member Functions

String getValue ()
 
void setValue (String value)
 
FieldIt getField ()
 
void setField (FieldIt field)
 
Set< String > getPossibleValues ()
 
void setPossibleValues (Set< String > values)
 
File getValueFile ()
 

Static Public Member Functions

static File getValueFile (FieldIt field)
 

Detailed Description

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

Definition at line 41 of file StringList.java.

Member Function Documentation

◆ getField()

FieldIt org.turro.fieldit.StringList.getField ( )

Definition at line 56 of file StringList.java.

56  {
57  return field;
58  }

◆ getPossibleValues()

Set<String> org.turro.fieldit.StringList.getPossibleValues ( )

Definition at line 64 of file StringList.java.

64  {
65  Set<String> set = new HashSet<>();
66 
67  try (BufferedReader br = new BufferedReader(new FileReader(getValueFile(), Charset.forName(ElephantContext.getEncoding())))) {
68  set = br.lines().filter(line -> !Strings.isBlank(line)).collect(Collectors.toSet());
69  } catch (IOException ex) {
70  Logger.getLogger(StringList.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
71  }
72 
73  return set;
74  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getValue()

String org.turro.fieldit.StringList.getValue ( )

Definition at line 48 of file StringList.java.

48  {
49  return value;
50  }

◆ getValueFile() [1/2]

File org.turro.fieldit.StringList.getValueFile ( )

Definition at line 86 of file StringList.java.

86  {
87  return getValueFile(field);
88  }
Here is the caller graph for this function:

◆ getValueFile() [2/2]

static File org.turro.fieldit.StringList.getValueFile ( FieldIt  field)
static

Definition at line 90 of file StringList.java.

90  {
91  File root = new File(ElephantContext.getRealPath(FIELDS_ROOT));
92  if(!root.exists()) root.mkdir();
93  return new File(
94  ElephantContext.getRealPath(FIELDS_ROOT + "/" + Strings.toFile(field.getName())) +
95  "_" + field.getId());
96  }
Here is the call graph for this function:

◆ setField()

void org.turro.fieldit.StringList.setField ( FieldIt  field)

Definition at line 60 of file StringList.java.

60  {
61  this.field = field;
62  }
Here is the caller graph for this function:

◆ setPossibleValues()

void org.turro.fieldit.StringList.setPossibleValues ( Set< String >  values)

Definition at line 76 of file StringList.java.

76  {
77  try (PrintWriter pw = new PrintWriter(new FileWriter(getValueFile(), Charset.forName(ElephantContext.getEncoding())))) {
78  values.forEach((line) -> {
79  if(!Strings.isBlank(line)) pw.println(line);
80  });
81  } catch (IOException ex) {
82  Logger.getLogger(StringList.class.getName()).log(Level.SEVERE, null, ex);
83  }
84  }
Here is the caller graph for this function:

◆ setValue()

void org.turro.fieldit.StringList.setValue ( String  value)

Reimplemented in org.turro.fieldit.AutoFillList.

Definition at line 52 of file StringList.java.

52  {
53  this.value = value;
54  }

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