public Append ( String str ) : void | ||
str | String |
/// the |
return | void |
/// <summary> /// This method is used to append the provided text and then it /// converts the buffered text to return the corrosponding text. /// The contents of the buffer remain unchanged after the value /// is buffered. It must be cleared if used as replacement only. /// </summary> /// <param name="value"> /// this is the value to append to the buffer /// </param> /// <returns> /// returns the value of the buffer after the append /// </returns> public String Process(String value) { if (value.indexOf('$') < 0) { return(value); } try { source.Append(value); Parse(); return(text.ToString()); }finally { Clear(); } }
/// <summary> /// This method is used to extract text from the property value /// that matches the pattern "${ *TEXT }". Such patterns within /// the properties file are considered to be system /// variables, this will replace instances of the text pattern /// with the matching system variable, if a matching /// variable does not exist the value remains unmodified. /// </summary> public void Name() { while (off < source.count) { char next = source.buf[off++]; if (next == '}') { Replace(); break; } else { name.Append(next); } } if (name.Length() > 0) { text.Append("${"); text.Append(name); } }
/// <summary> /// This extracts the value from the Java properties text. This /// will basically ready any text up to the first occurance of /// an equal of a terminal. If a terminal character is read /// this returns without adding the terminal to the value. /// </summary> public void Parse() { while (off < source.count) { char next = source.buf[off++]; if (next == '$') { if (off < source.count) { if (source.buf[off++] == '{') { Name(); continue; } else { off--; } } } text.Append(next); } }