package com.ronsoft.books.nio.appendix; public class ClassXml { // This method is invoked as an XSL extension function from xalan. // This should be moved to ClassInfo and this class deleted. public static String getClassApi (String pname, String cname, String protFlag) throws Exception { boolean prot = false; if ((protFlag != null) && (protFlag.equals ("true"))) { prot = true; } ClassInfo ci = new ClassInfo (pname + "." + cname, prot); return (ci.toString (" ", false)); } // defunct crap private static String formatClass (String classname, ClassInfo ci, String desc) { StringBuffer sb = new StringBuffer(); sb.append (""); sb.append ("<classname>"); sb.append (classname); sb.append ("</classname>\n"); sb.append ("" + desc + ""); sb.append (""); if (ci.isInterface()) { sb.append ("Interface "); } else { sb.append ("Class "); } sb.append ("Definition"); sb.append ("
"); ci.stringify (sb, " ", 0, true); sb.append ("
"); sb.append ("See Also: "); sb.append ("
"); return (sb.toString()); } public static void main (String[] argv) throws Exception { for (int i = 0; i < argv.length; i++) { ClassInfo ci = new ClassInfo (argv [i]); System.out.println (formatClass (argv [i], ci, "XXX")); } } }