|
Project Wonder 2.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object er.extensions.ERXSimpleTemplateParser
Very simple template parser. For example if you have the delimiter:
Field Summary | |
static String |
DEFAULT_UNDEFINED_KEY_LABEL
The default label for keys not found while parsing |
protected boolean |
isLoggingDisabled
Flag to disable logging. |
static ERXLogger |
log
logging support |
Constructor Summary | |
ERXSimpleTemplateParser()
Returns a parser object with the default undefined label |
|
ERXSimpleTemplateParser(String undefinedKeyLabel)
Returns a parser object with the given string as the undefined key label |
Method Summary | |
NSArray |
keysInTemplate(String template,
String delimiter)
Calculates the set of keys used in a given template for a given delimiter. |
String |
parseTemplateWithObject(String template,
String delimiter,
Object object)
Cover method for calling the four argument method passing in null for the otherObject
parameter. |
String |
parseTemplateWithObject(String template,
String delimiter,
Object object,
Object otherObject)
This method replaces the keys enclosed between the delimeter with the values found in object and otherObject. |
static void |
setSharedInstance(ERXSimpleTemplateParser newSharedInstance)
Sets the shared instance of the template parser. |
static ERXSimpleTemplateParser |
sharedInstance()
Convience method to return the shared instance of the template parser. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String DEFAULT_UNDEFINED_KEY_LABEL
public static final ERXLogger log
protected boolean isLoggingDisabled
ERXPatternLayout
will set
this to true for its internal parser object in order to
prevent an infinite debug logging loop.
Constructor Detail |
public ERXSimpleTemplateParser()
DEFAULT_UNDEFINED_KEY_LABEL
public ERXSimpleTemplateParser(String undefinedKeyLabel)
undefinedKeyLabel
- string as the undefined key label,
for example, "?", "N/A"Method Detail |
public static ERXSimpleTemplateParser sharedInstance()
setSharedInstance(er.extensions.ERXSimpleTemplateParser)
public static void setSharedInstance(ERXSimpleTemplateParser newSharedInstance)
newSharedInstance
- the parser object that will be sharedsharedInstance()
public NSArray keysInTemplate(String template, String delimiter)
template
- to check for keysdelimiter
- for finding keys
public String parseTemplateWithObject(String template, String delimiter, Object object)
null
for the otherObject
parameter. See that method for documentation.
template
- to use to parsedelimiter
- to use to find keysobject
- to resolve keyspublic String parseTemplateWithObject(String template, String delimiter, Object object, Object otherObject)
When the value is not found in both object and otherObject,
it will replace the key with the undefined key label which
defaults to "?". You can set the label via the constructor
ERXSimpleTemplateParser(String)
.
template
- to use to parsedelimiter
- to use to check for keysobject
- to resolve keys off ofotherObject
- object used to resolve default keys
|
Last updated: Do, Dez 9, 2004 12:46 PM CET | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |