<commit_before>RFC 0079: Preferences API
========================================================================
$Id$

@authors: friebe
@created: Thu Oct 12 11:44:36 CEST 2006
@status: draft
@category: util

Scope of Change
---------------
Type-safe preferences with exchangeable backing storages will be added
as a new API.


Rationale
---------
- util.Properties is not type-safe and not checked. Mistakes can easily 
  go unnoticed.
- Because util.Properties does not provide information about the values
  we cannot easily create a generic property editor (without having to
  have properties defining the layout of each and every property file).


Functionality
-------------

File format
~~~~~~~~~~~
The file format is basically modeled after .ini files:
<pre>
  ; Comment
  [section]
  string1="value"
  string2='value'
  int=1
  double=0.5
  bool1=true   ; Comment
  bool2=false
  class=lang.types.String::class

  [lists]
  list[]="string"
  list[]="string"
  list[]="string"
  
  [maps]
  map[color]="green"
  map[price]=12.99
  
  [object]
  category=util.log.LogCategory("default")
</pre>

Inheritance
~~~~~~~~~~~
Sections may inherit other sections:
<pre>
  [web]
  route[/]=com.example.scriptlet.DefaultRoute::class
  route[/rss]=com.example.scriptlet.RssRoute::class
  
  [myweb : web]
  route[/pdf]=com.example.my.scriptlet.PdfRoute::class
</pre>

Variables
~~~~~~~~~
Variables start with a dollar sign and are surrounded by curly braces:
<pre>
  [default]
  path="${DOCUMENT_ROOT}/../lib"      ; Environment variable
  coin=${com.example.Coin::$penny}    ; Static class member
  level=${util.log.LogLevel::INFO}    ; Class constant
  
  [v1]
  path="${default:path}/v1"           ; Reference to other section
  
  [v2 : default]
  path="${parent:path}/v2"            ; Reference to parent section
</pre><commit_msg>- Add section on fileencoding<commit_after>RFC 0079: Preferences API
========================================================================
$Id$

@authors: friebe
@created: Thu Oct 12 11:44:36 CEST 2006
@status: draft
@category: util

Scope of Change
---------------
Type-safe preferences with exchangeable backing storages will be added
as a new API.


Rationale
---------
- util.Properties is not type-safe and not checked. Mistakes can easily 
  go unnoticed.
- Because util.Properties does not provide information about the values
  we cannot easily create a generic property editor (without having to
  have properties defining the layout of each and every property file).


Functionality
-------------

File format
~~~~~~~~~~~
The file format is basically modeled after .ini files:
<pre>
  ; Comment
  [section]
  string1="value"
  string2='value'
  int=1
  double=0.5
  bool1=true   ; Comment
  bool2=false
  class=lang.types.String::class

  [lists]
  list[]="string"
  list[]="string"
  list[]="string"
  
  [maps]
  map[color]="green"
  map[price]=12.99
  
  [object]
  category=util.log.LogCategory("default")
</pre>

Encoding
~~~~~~~~
File encoding is defined to be <tt>iso-8859-1</tt>. Unicode encodings may
be indicated by placing a Unicode BOM at the beginning of the file.

See also:
* http://de.wikipedia.org/wiki/Byte_Order_Mark
* http://unicode.org/faq/utf_bom.html

Inheritance
~~~~~~~~~~~
Sections may inherit other sections:
<pre>
  [web]
  route[/]=com.example.scriptlet.DefaultRoute::class
  route[/rss]=com.example.scriptlet.RssRoute::class
  
  [myweb : web]
  route[/pdf]=com.example.my.scriptlet.PdfRoute::class
</pre>

Variables
~~~~~~~~~
Variables start with a dollar sign and are surrounded by curly braces:
<pre>
  [default]
  path="${DOCUMENT_ROOT}/../lib"      ; Environment variable
  coin=${com.example.Coin::$penny}    ; Static class member
  level=${util.log.LogLevel::INFO}    ; Class constant
  
  [v1]
  path="${default:path}/v1"           ; Reference to other section
  
  [v2 : default]
  path="${parent:path}/v2"            ; Reference to parent section
</pre>
{'fraction_non_alphanumeric': 0.17745620715917745, 'fraction_numerical': 0.01700939324701701, 'mean_word_length': 3.724220623501199, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4392719', 'n_tokens_mistral': 1264, 'n_tokens_neox': 1192, 'n_words': 361}