1 11 package org.eclipse.jdt.internal.ui.text.comment; 12 13 import java.io.Reader ; 14 import java.util.HashMap ; 15 import java.util.Map ; 16 import org.eclipse.jdt.internal.ui.text.SubstitutionTextReader; 17 18 19 26 public class Java2HTMLEntityReader extends SubstitutionTextReader { 27 28 29 private static final Map fgEntityLookup; 30 31 static { 32 fgEntityLookup= new HashMap (7); 33 fgEntityLookup.put("<", "<"); fgEntityLookup.put(">", ">"); fgEntityLookup.put("&", "&"); fgEntityLookup.put("^", "ˆ"); fgEntityLookup.put("~", "˜"); fgEntityLookup.put("\"", """); } 40 41 46 public Java2HTMLEntityReader(Reader reader) { 47 super(reader); 48 setSkipWhitespace(false); 49 } 50 51 54 protected String computeSubstitution(int c) { 55 String lookup= (String ) fgEntityLookup.get(String.valueOf((char) c)); 56 return lookup; 57 } 58 } 59 | Popular Tags |