| 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectNCLib.Template
public class Template
Implementation of a simple file templating mechanism
| Field Summary | |
|---|---|
private  java.lang.String | 
input
Contents of the input file  | 
private  java.util.HashMap<java.lang.String,java.lang.String> | 
map
Map of the replaceables  | 
| Constructor Summary | |
|---|---|
Template(java.lang.String fname)
Default constructor  | 
|
| Method Summary | |
|---|---|
 java.util.Set<java.lang.String> | 
fields()
Returns a set of all keywords found in the input file  | 
static void | 
main(java.lang.String[] args)
Test routine  | 
 boolean | 
set(java.lang.String key,
    java.lang.String value)
Set a string as replacement for a specific keyword  | 
 java.lang.String | 
toString()
Retrieve a string representation of this object  | 
 void | 
write(java.lang.String fname)
Write the resulting file  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
private java.lang.String input
private java.util.HashMap<java.lang.String,java.lang.String> map
| Constructor Detail | 
|---|
public Template(java.lang.String fname)
fname - Filename of the input file| Method Detail | 
|---|
public java.util.Set<java.lang.String> fields()
public boolean set(java.lang.String key,
                   java.lang.String value)
key - The keywordvalue - The replacement string (oh, the surprise!)
public java.lang.String toString()
toString in class java.lang.Objectpublic void write(java.lang.String fname)
fname - Filename of the destination filepublic static void main(java.lang.String[] args)
  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||