Package org.jdbf.engine.configuration

Examples of org.jdbf.engine.configuration.ConfigurationImpl


    Iterator iter = conf.getConfigurations("database");
    ArrayList dbs = new ArrayList();
    while(iter.hasNext()){
        conf = (ConfigurationImpl)iter.next();
        DatabaseMap dbMap = new DatabaseMap();
        ConfigurationImpl child = (ConfigurationImpl)conf.getConfiguration("name");
            logger.log(Level.FINEST,"name " + child.getValue());
        dbMap.setName(child.getValue());
        child = (ConfigurationImpl)conf.getConfiguration("vendor");
            logger.log(Level.FINEST,"vendor " + child.getValue());
        dbMap.setVendor(child.getValue());
        child = (ConfigurationImpl)conf.getConfiguration("dbDriver");
            logger.log(Level.FINEST,"dbDriver " + child.getValue());
        String dbDriver = child.getValue();
        if(dbDriver == null){       
              logger.throwing(CLASS_NAME,"createConnection()",
                            new MappingException("mapping.missingDriver")
                           );
            throw new MappingException(Messages.message("mapping.missingDriver"));
        }
        else
        dbMap.setDbDriver(dbDriver);
     
        child = (ConfigurationImpl)conf.getConfiguration("dbServer");
            logger.log(Level.FINEST,"dbServer " + child.getValue());
        dbMap.setDbServer(child.getValue());
        child = (ConfigurationImpl)conf.getConfiguration("dbLogin");
            logger.log(Level.FINEST,"dbLogin " + child.getValue());
        dbMap.setDbLogin(child.getValue());
        child = (ConfigurationImpl)conf.getConfiguration("dbPassword");
            logger.log(Level.FINEST,"dbPassword " + child.getValue());
        dbMap.setDbPassword(child.getValue());
     
        dbs.add(dbMap);
    }
    createConnection(dbs);
    }
View Full Code Here


   *
     */
    public ObjectMapped getUnmarshallObject(String xml)
        throws UnmarshallException{
       
        ConfigurationImpl child;
        ObjectMapped om = null;
        logger.log(Level.INFO,Messages.message("Unmarshaller.unmarshall"));
        try{
      byte [] byteArray = xml.getBytes();
      ConfigurationImpl conf = (ConfigurationImpl)
            ConfigurationBuilder.build (
                new ByteArrayInputStream(byteArray)
            );
           
      child = (ConfigurationImpl) conf.getConfiguration("class-name");     
            logger.log(Level.FINEST,"tag class-name " + child.getValue());
      Class classFor = Class.forName(child.getValue());
      om = (ObjectMapped) classFor.newInstance();
      child = (ConfigurationImpl) conf.getConfiguration("repository-name");
            logger.log(Level.FINEST,"tag repository-name " + child.getValue());
      om.setRepositoryViewName(child.getValue());
      Iterator iter = conf.getConfigurations("attributes");     
     
            while (iter.hasNext()){
        child = (ConfigurationImpl) iter.next();
        Iterator iterChild = child.getConfigurations("attribute");       
        while (iterChild.hasNext()) {
          conf = (ConfigurationImpl) iterChild.next();
          child = (ConfigurationImpl) conf.getConfiguration("name");
          String name = child.getValue();
                    logger.log(Level.FINEST,"tag name " + name);
          child = (ConfigurationImpl) conf.getConfiguration("value");
          String value = child.getValue();
                    logger.log(Level.FINEST,"tag value " + value);
          /*
           * Bug fixing 957296 (Gmartone)
           */
 
View Full Code Here

    */
   public void startElement (String uri,String localName,
                         String name, Attributes atts) throws SAXException{
      
       logger.log(Level.FINEST,Messages.format("SAXParser.startEle",name));
       ConfigurationImpl conf = new ConfigurationImpl(name);
 
       if (this.root == null) this.root = conf;

       if ( !stack.isEmpty() ){
           ((ConfigurationImpl)stack.peek()).addConfiguration(conf);
View Full Code Here

    * @param len - The number of characters to use from the character array.
  *
    */
    public void characters(char ch[], int start, int len) {
        logger.log(Level.FINEST,Messages.message("SAXParser.readChar"));
        ConfigurationImpl c = (ConfigurationImpl) this.stack.peek();
    c.appendValueData( new String(ch,start,len) );   
    }
View Full Code Here

TOP

Related Classes of org.jdbf.engine.configuration.ConfigurationImpl

Copyright © 2018 www.massapicom. 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.