|
Algernon Software | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.algernon.app.j2p.Advice
Advice reads and writes advice files, as well as transforming slot and class names upon request. Lines that begin with a '#' are ignored. Example entries:
PREFIX SLOT ALL ... SUFFIX SLOT ALL ... PREFIX SLOT name ... SUFFIX SLOT name ... CAPITALIZE SLOT ALL UPPERCASE SLOT ALL LOWERCASE SLOT ALL CAPITALIZE SLOT name UPPERCASE SLOT name LOWERCASE SLOT name REPLACE SLOT name newname IGNORE SLOT name PREFIX CLASS ALL ... SUFFIX CLASS ALL ... PREFIX CLASS name ... SUFFIX CLASS name ... CLASS CAPITALIZE ALL UPPERCASE CLASS ALL LOWERCASE CLASS ALL CAPITALIZE CLASS name UPPERCASE CLASS name LOWERCASE CLASS name REPLACE CLASS name newname IGNORE CLASS name
Constructor Summary | |
Advice()
Creates a new advice with default values. |
|
Advice(String adviceFile)
Creates a new set of advice from the given file. |
Method Summary | |
void |
deleteEntry(String command,
String type,
String frameName,
String replacement)
Deletes an entry from the advice list. |
String |
getAdviceString()
Dumps all the advice into a string. |
private String |
getClassPrefix(String className)
|
private String |
getClassReplacement(String className)
|
private String |
getClassSuffix(String className)
|
private String |
getSlotPrefix(String slotName)
|
private String |
getSlotReplacement(String slotName)
|
private String |
getSlotSuffix(String slotName)
|
void |
processAdviceCommand(String command,
String type,
String frameName,
String replacement)
Processes and stores the advice. |
void |
readAdviceFile(String adviceFileName)
Reads advice from a file. |
void |
save(String filename)
Saves the advice to a file. |
boolean |
shouldIgnoreClass(String className)
Returns true if the advice file said that this class should be ignored. |
boolean |
shouldIgnoreSlot(String className)
Returns true if the advice file said that this slot should be ignored. |
Vector |
toVectors()
Returns a vector of vectors containing the advice information |
String |
transformClassName(String className)
Transforms a class name into the canonical form, given advice. |
String |
transformSlotName(String slotName)
Transforms a slot name into the canonical form, given advice. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
String f_globalClassPrefix
String f_globalClassSuffix
String f_globalSlotPrefix
String f_globalSlotSuffix
boolean f_globalClassCapitalize
boolean f_globalSlotCapitalize
boolean f_globalClassLowercase
boolean f_globalSlotLowercase
boolean f_globalClassUppercase
boolean f_globalSlotUppercase
HashMap f_ClassReplacements
HashMap f_ClassPrefixes
HashMap f_ClassSuffixes
HashMap f_ClassCapitalize
HashMap f_ClassLowercase
HashMap f_ClassUppercase
HashMap f_SlotReplacements
HashMap f_SlotPrefixes
HashMap f_SlotSuffixes
HashMap f_SlotCapitalize
HashMap f_SlotLowercase
HashMap f_SlotUppercase
HashMap f_ClassIgnore
HashMap f_SlotIgnore
String f_adviceFile
Constructor Detail |
public Advice()
public Advice(String adviceFile)
adviceFile
- Method Detail |
public void readAdviceFile(String adviceFileName)
public void processAdviceCommand(String command, String type, String frameName, String replacement)
type
- Must be SLOT or CLASS, but is not case-sensitive.frameName
- Either ALL (uppercase) or the name of a frame (case-sensitive).command
- Not case-sensitive. Must be PREFIX, SUFFIX, CAPITALIZE, LOWERCASE, UPPERCASE or REPLACEreplacement
- Case-sensitive. The new name for the slot or class, in a REPLACE command.public String getAdviceString()
public String transformClassName(String className)
public String transformSlotName(String slotName)
private String getClassReplacement(String className)
private String getClassPrefix(String className)
private String getClassSuffix(String className)
private String getSlotReplacement(String slotName)
private String getSlotPrefix(String slotName)
private String getSlotSuffix(String slotName)
public boolean shouldIgnoreClass(String className)
className
- public boolean shouldIgnoreSlot(String className)
className
- public Vector toVectors()
public void save(String filename) throws IOException
filename
-
IOException
public void deleteEntry(String command, String type, String frameName, String replacement)
command
- A string giving the command: IGNORE, CAPITALIZE, etc.type
- A string containing CLASS or SLOT.frameName
- The name of a class.replacement
- Replacement name, when the command is REPLACE. Send in null otherwise.
|
Algernon Software | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |