1 15 package org.apache.tapestry.script; 16 17 import java.util.Map ; 18 19 import org.apache.hivemind.Location; 20 21 32 33 class LetToken extends AbstractToken 34 { 35 private String _key; 36 private boolean _unique; 37 private int _bufferLengthHighwater = 20; 38 39 public LetToken(String key, boolean unique, Location location) 40 { 41 super(location); 42 43 _key = key; 44 _unique = unique; 45 } 46 47 public void write(StringBuffer buffer, ScriptSession session) 48 { 49 if (buffer != null) 50 throw new IllegalArgumentException (); 51 52 buffer = new StringBuffer (_bufferLengthHighwater); 53 54 writeChildren(buffer, session); 55 56 58 Map symbols = session.getSymbols(); 59 60 String value = buffer.toString().trim(); 61 62 if (_unique) 63 value = session.getUniqueString(value); 64 65 symbols.put(_key, value); 66 67 70 _bufferLengthHighwater = Math.max(_bufferLengthHighwater, buffer.length()); 71 } 72 } | Popular Tags |