Purple Code

com.purpletech.util
Class Scanner

java.lang.Object
  |
  +--com.purpletech.util.Scanner

public class Scanner
extends java.lang.Object

Version:
$Id: Scanner.java,v 1.2 2001/10/30 12:20:53 alex Exp $

Constructor Summary
Scanner()
           
 
Method Summary
static void insertVars(java.io.PrintWriter out, java.lang.String prefix, java.lang.String suffix, java.lang.String text, java.util.Dictionary vars)
          scan an input html string.
static java.lang.String insertVars(java.lang.String prefix, java.lang.String suffix, java.lang.String text, java.util.Dictionary vars)
          Scan an input html string, returning a String.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scanner

public Scanner()
Method Detail

insertVars

public static java.lang.String insertVars(java.lang.String prefix,
                                          java.lang.String suffix,
                                          java.lang.String text,
                                          java.util.Dictionary vars)
Scan an input html string, returning a String. Wrapper for insertVars(PrintWriter, ...).

Parameters:
text - the text to scan
vars - the mapping from name to value

insertVars

public static void insertVars(java.io.PrintWriter out,
                              java.lang.String prefix,
                              java.lang.String suffix,
                              java.lang.String text,
                              java.util.Dictionary vars)
scan an input html string. Every time you encounter a string of the form name, replace it with the value off the entry name in the dictionary vars.

standard prefix==[ suffix=]

the variable print() prints all variable values (for debugging)

variables of the form foo:bar assume that foo's value is an HTML tag, and add bar to the inside of the end of the tag. For example, if foo="<IMG SRC=face.gif>", prefix="<%=" and suffix=">", then the string "<%=foo:height=100 width=100>" will be replaced with "<IMG SRC=face.gif height=100 width=100>"

If the vars variable is of type Properties, then we use the getProperty() method, not the get() method, in order to access the default values.

Parameters:
text - the text to scan
vars - the mapping from name to value

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
java.io.IOException

Documentation generated March 5 2003