Java Code Examples for gate.util.GateException#printStackTrace()

The following examples show how to use gate.util.GateException#printStackTrace() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BootStrap.java    From gate-core with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static void main(String[] args) {
  System.out.println(System.getProperty("path.separator"));
  System.out.println("intre");
  System.out.println(System.getProperty("java.class.path"));
  BootStrap bootStrap = new BootStrap();
  Set<String> interfaces = new HashSet<String>();
  interfaces.add("gate.Document");
  interfaces.add("gate.ProcessingResource");
  try{

  bootStrap.createResource("morph","creole.sheffield.ac.lisa","LanguageResource",
    "Documente", interfaces, "z:/test");
  } catch (GateException ge) {
    ge.printStackTrace(Err.getPrintWriter());
  } catch (ClassNotFoundException cnfe) {
    cnfe.printStackTrace(Err.getPrintWriter());
  } catch (IOException ioe) {
    ioe.printStackTrace(Err.getPrintWriter());
  } catch (InterruptedException ie){
    ie.printStackTrace(Err.getPrintWriter());
  }
}
 
Example 2
Source File: CorpusEditor.java    From gate-core with GNU Lesser General Public License v3.0 5 votes vote down vote up
protected void initLocalData(){
  docTableModel = new DocumentTableModel();
  try {
    documentsLoadedCount = Gate.getCreoleRegister()
      .getAllInstances("gate.Document").size();
  } catch (GateException exception) {
    exception.printStackTrace();
  }
}
 
Example 3
Source File: SerialControllerEditor.java    From gate-core with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public int getSize(){
  //get all corpora regardless of their actual type
  List<Resource> loadedCorpora = null;
  try{
    loadedCorpora = Gate.getCreoleRegister().
                           getAllInstances("gate.Corpus");
  }catch(GateException ge){
    ge.printStackTrace(Err.getPrintWriter());
  }

  return loadedCorpora == null ? 1 : loadedCorpora.size() + 1;
}
 
Example 4
Source File: SerialControllerEditor.java    From gate-core with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public Object getElementAt(int index){
  if(index == 0) return "<none>";
  else{
    //get all corpora regardless of their actual type
    List<Resource> loadedCorpora = null;
    try{
      loadedCorpora = Gate.getCreoleRegister().
                             getAllInstances("gate.Corpus");
    }catch(GateException ge){
      ge.printStackTrace(Err.getPrintWriter());
    }
    return loadedCorpora == null? "" : loadedCorpora.get(index - 1);
  }
}