Examples of XmlErrorException


Examples of com.uwyn.rife.xml.exceptions.XmlErrorException

        mCurrentServerInfo.addAddress(name, port);
        mCurrentServerInfo.setServerPassword(password);
      }
      catch (CoreException e)
      {
        throw new XmlErrorException(e);
      }
    }
    else if (qName.equals("bot"))
    {
      String  name     = atts.getValue("name");
      String  nick     = atts.getValue("nick");
      String  alt_nick  = atts.getValue("altnick");
      String  real_name  = atts.getValue("realname");
      String  server_name  = atts.getValue("servername");
     
      if (BotFactory.contains(name))
      {
        throw new XmlErrorException("A bot with name '"+name+"' has already been set up.");
      }
     
      mCurrentBot = BotFactory.get(name);
      mBots.add(mCurrentBot);
      mCurrentBot.initialize(nick, alt_nick, real_name, new Server(server_name, (ServerInfo)mServerInfos.get(server_name), mCurrentBot));
    }
    else if (qName.equals("channel"))
    {
      String  name = atts.getValue("name");
      String  password = atts.getValue("password");
     
      try
      {
        mCurrentBot.join(name, password);
      }
      catch (CoreException e)
      {
        throw new XmlErrorException(e);
      }
    }
    else if (qName.equals("module"))
    {
      String  classname = atts.getValue("classname");

      Class  module_class = null;
      Module  module_instance = null;
      try
      {
        module_class = Class.forName(classname);
        module_instance = (Module)module_class.newInstance();
      }
      catch (ClassNotFoundException e)
      {
        throw new XmlErrorException(e);
      }
      catch (InstantiationException e)
      {
        throw new XmlErrorException(e);
      }
      catch (IllegalAccessException e)
      {
        throw new XmlErrorException(e);
      }
     
      mCurrentModule = module_instance;
    }
    else if (qName.equals("property"))
    {
      String  name = atts.getValue("name");

      if (null == mCurrentModule)
      {
        throw new XmlErrorException("No module specified to set the property '"+name+"' for.");
      }
     
      mCharacterDataStack = new StringBuffer();
     
      mCurrentProperty = name;
    }
    else
    {
      throw new XmlErrorException("Unsupport element name '"+qName+"'.");
    }
  }
View Full Code Here

Examples of com.uwyn.rife.xml.exceptions.XmlErrorException

      {
        mCurrentBot.addModule(mCurrentModule);
      }
      catch (InvalidModuleNameException e)
      {
        throw new XmlErrorException("The name of the module '"+mCurrentModule.getClass()+"' is invalid.");
      }
    }
    else if (qName.equals("property"))
    {
      String value = mCharacterDataStack.toString();
      mCharacterDataStack = null;
     
      try
      {
        BeanUtils.setPropertyValue(mCurrentModule, mCurrentProperty, value);
      }
      catch (BeanUtilsException e)
      {
        throw new XmlErrorException(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.