/// <summary> /// Returns stream factory for the type of this tool for the </code>format</code>. /// </summary> /// <param name="format"> data format name </param> /// <returns> stream factory for the type of this tool for the format </returns> protected internal virtual ObjectStreamFactory getStreamFactory(string format) { ObjectStreamFactory factory = StreamFactoryRegistry.getFactory(type, format); if (null != factory) { return(factory); } else { throw new TerminateToolException(1, "Format " + format + " is not found.\n" + Help); } }
public override string getHelp(string format) { if ("".Equals(format) || StreamFactoryRegistry.DEFAULT_FORMAT.Equals(format)) { return(getBasicHelp(paramsClass, StreamFactoryRegistry.getFactory(type, StreamFactoryRegistry.DEFAULT_FORMAT).getParameters <P>())); } else { ObjectStreamFactory factory = StreamFactoryRegistry.getFactory(type, format); if (null == factory) { throw new TerminateToolException(1, "Format " + format + " is not found.\n" + Help); } return("Usage: " + CLI.CMD + " " + Name + "." + format + " " + ArgumentParser.createUsage(paramsClass, factory.getParameters <P>())); } }
protected internal override string getBasicHelp <A>(params Type[] argProxyInterfaces) { IDictionary <string, ObjectStreamFactory> factories = StreamFactoryRegistry.getFactories(type); string formatsHelp = " "; if (1 < factories.Count) { StringBuilder formats = new StringBuilder(); foreach (string format in factories.Keys) { if (!StreamFactoryRegistry.DEFAULT_FORMAT.Equals(format)) { formats.Append(".").Append(format).Append("|"); } } formatsHelp = "[" + formats.Substring(0, formats.Length - 1) + "] "; } return("Usage: " + CLI.CMD + " " + Name + formatsHelp + ArgumentParser.createUsage(argProxyInterfaces)); }