@Override public void run() { jg.main0(new String[] { "-jcasgeninput", inFileName, "-jcasgenoutput", outDirName }, jg.merger, new GuiProgressMonitor(), new GuiErrorImpl()); } };
/** * Gets the gets the set array name part. * * @param fd the fd * @return the gets the set array name part */ String getGetSetArrayNamePart(FeatureDescription fd) { return sc(getJavaRangeArrayElementType(fd)); }
/** * The main method. * * @param args the arguments */ // exits with -1 if failure public static void main(String[] args) { int rc = (new Jg()).main0(args, null, null, new LogThrowErrorImpl()); System.exit(rc); }
/** * Generate type classes from the specified templates. * * @param td TypeDescription object * @param outputDirectory output directory * @param jcasTypeInstance Template instance used to generate class * @return void * @throws IOException - */ private void generateClassesFromTemplate(TypeDescription td, String outputDirectory, IJCasTypeTemplate jcasTypeInstance) throws IOException { simpleClassName = removePkg(getJavaName(td)); generateClass(progressMonitor, outputDirectory, td, jcasTypeInstance.generate(new Object[] { this, td }), getJavaName(td), merger); // simpleClassName = removePkg(getJavaName_Type(td)); // generateClass(progressMonitor, outputDirectory, td, jcas_TypeInstance.generate(new Object[] { // this, td }), getJavaName_Type(td), merger); }
/** * Gets the array feature value. * * @param fd the fd * @param td the td * @return the array feature value */ String getArrayFeatureValue(FeatureDescription fd, TypeDescription td) { String getSetArrayNamePart = getGetSetArrayNamePart(fd); String core = arrayCore("get", getSetArrayNamePart, getJavaRangeType(fd), fd.getName()); return castResult(getJavaRangeArrayElementType(fd), core); }
/** * Gets the feature value. * * @param fd the fd * @param td the td * @return the feature value */ String getFeatureValue(FeatureDescription fd, TypeDescription td) { String getSetNamePart = getGetSetNamePart(fd); String core = simpleCore("get", getSetNamePart, fd.getName()); return castResult(getJavaRangeType(fd), core); }
/** * Sets the array feature value. * * @param fd the fd * @param td the td * @return the string */ String setArrayFeatureValue(FeatureDescription fd, TypeDescription td) { return arrayCore("set", getGetSetArrayNamePart(fd), getJavaRangeType(fd), fd.getName()); }
TypeInfo(String xmlName, String javaName) { this.xmlName = xmlName; this.javaNameWithPkg = javaName; this.javaName = org.apache.uima.tools.jcasgen.Jg.removePkg(javaName); this.isArray = false; this.arrayElNameWithPkg = ""; }
/** * Gets the gets the set name part. * * @param fd the fd * @return the gets the set name part */ String getGetSetNamePart(FeatureDescription fd) { return sc(getJavaRangeType(fd)); }
/** * Main for cde. * * @param aMerger the a merger * @param aProgressMonitor the a progress monitor * @param aError the a error * @param inputFile the input file * @param outputDirectory the output directory * @param tds the tds * @param aCas the a cas * @throws IOException Signals that an I/O exception has occurred. */ public void mainForCde(IMerge aMerger, IProgressMonitor aProgressMonitor, IError aError, String inputFile, String outputDirectory, TypeDescription[] tds, CASImpl aCas) throws IOException { mainForCde(aMerger, aProgressMonitor, aError, inputFile, outputDirectory, tds, aCas, "", false, null); }
/** * Sets the feature value. * * @param fd the fd * @param td the td * @return the string */ String setFeatureValue(FeatureDescription fd, TypeDescription td) { return simpleCore("set", getGetSetNamePart(fd), fd.getName()); }
/** * Gets the java name type. * * @param td the td * @return the java name type */ String getJavaName_Type(TypeDescription td) { return getJavaName(td) + "_Type"; }
/** * Adds the built in type info. * * @param casName the cas name * @param javaName the java name */ static private void addBuiltInTypeInfo(String casName, String javaName) { addBuiltInTypeInfo(casName, javaName, null); }
/** * Returns the string from the plugin's resource bundle, or 'key' if not found. * * @param key the key * @return the resource string */ public String getResourceString(String key) { ResourceBundle bundle = getResourceBundle(); try { return bundle.getString(key); } catch (MissingResourceException e) { return key; } }
/** * Adds the built in type info. * * @param casName the cas name * @param javaName the java name * @param casElementName the cas element name */ static private void addBuiltInTypeInfo(String casName, String javaName, String casElementName) { TypeInfo ti = new TypeInfo(casName, javaName, casElementName); builtInTypes.put(casName, ti); }
/** * Gets the string. * * @param key the key * @param substitutions the substitutions * @return the string */ public String getString(String key, Object[] substitutions) { return MessageFormat.format(getResourceString(key), substitutions); }
/** * Gets the pkg. * * @param td the td * @return the pkg */ String getPkg(TypeDescription td) { return getPkg(td.getName()); }
/** * Instantiates a new type info. * * @param xmlName the xml name * @param javaName the java name */ TypeInfo(String xmlName, String javaName) { this.xmlName = xmlName; this.javaNameWithPkg = javaName; this.javaName = Jg.removePkg(javaName); this.isArray = false; this.arrayElNameWithPkg = ""; }
/** * Gets the java name. * * @param td the td * @return the java name */ String getJavaName(TypeDescription td) { return getJavaName(td.getName()); }