Examples of FeatureException


Examples of org.maltparserx.core.feature.FeatureException

     for (Plugin plugin : plugins) {
      URL url = null;
      try {
        url = new URL("jar:"+plugin.getUrl() + "!/appdata/plugin.xml");
      } catch (MalformedURLException e) {
        throw new FeatureException("Malformed URL: 'jar:"+plugin.getUrl() + "!plugin.xml'", e);
      }
      try {
        InputStream is = url.openStream();
        is.close();
      } catch (IOException e) {
View Full Code Here

Examples of org.maltparserx.core.feature.FeatureException

            Element root = null;

            root = db.parse(specModelURL.openStream()).getDocumentElement();

            if (root == null) {
              throw new FeatureException("The feature system file '"+specModelURL.getFile()+"' cannot be found. ");
            }
           
            readFeatureSystem(root);
        } catch (IOException e) {
          throw new FeatureException("The feature system file '"+specModelURL.getFile()+"' cannot be found. ", e);
        } catch (ParserConfigurationException e) {
          throw new FeatureException("Problem parsing the file "+specModelURL.getFile()+". ", e);
        } catch (SAXException e) {
          throw new FeatureException("Problem parsing the file "+specModelURL.getFile()+". ", e);
        }
  }
View Full Code Here

Examples of org.maltparserx.core.feature.FeatureException

      }
      if (clazz == null) {
        clazz = Class.forName(function.getAttribute("class"));
      }
    } catch (ClassNotFoundException e) {
      throw new FeatureException("The feature system could not find the function class"+function.getAttribute("class")+".", e);
    }
    if (hasSubFunctions) {
      NodeList subfunctions = function.getElementsByTagName("subfunction");
      for (int i = 0; i < subfunctions.getLength(); i++) {
        readSubFunction((Element)subfunctions.item(i), clazz, hasFactory);
View Full Code Here

Examples of org.maltparserx.core.feature.FeatureException

    Constructor<?>[] constructors = functionClass.getConstructors();
    if (constructors.length == 0) {
      try {
        return (Function)functionClass.newInstance();
      } catch (InstantiationException e) {
        throw new FeatureException("The function '"+functionClass.getName()+"' cannot be initialized. ", e);
      } catch (IllegalAccessException e) {
        throw new FeatureException("The function '"+functionClass.getName()+"' cannot be initialized. ", e);
      }
    }
    Class<?>[] params = constructors[0].getParameterTypes();
    if (params.length == 0) {
      try {
        return (Function)functionClass.newInstance();
      } catch (InstantiationException e) {
        throw new FeatureException("The function '"+functionClass.getName()+"' cannot be initialized. ", e);
      } catch (IllegalAccessException e) {
        throw new FeatureException("The function '"+functionClass.getName()+"' cannot be initialized. ", e);
      }
    }
    Object[] arguments = new Object[params.length];
    for (int i = 0; i < params.length; i++) {
      if (hasSubfunctions && params[i] == java.lang.String.class) {
        arguments[i] = name;
      } else {
        arguments[i] = registry.get(params[i]);
        if (arguments[i] == null) {
          return null;
        }
      }
    }
    try {
      return (Function)constructors[0].newInstance(arguments);
    } catch (InstantiationException e) {
      throw new FeatureException("The function '"+functionClass.getName()+"' cannot be initialized. ", e);
    } catch (IllegalAccessException e) {
      throw new FeatureException("The function '"+functionClass.getName()+"' cannot be initialized. ", e);
    } catch (InvocationTargetException e) {
      throw new FeatureException("The function '"+functionClass.getName()+"' cannot be initialized. ", e);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.