Package com.dbxml.labrador.configuration

Examples of com.dbxml.labrador.configuration.Configuration


                     String instName = className.substring(0, idx);
                     className = className.substring(idx + 1);
                     instElem.setAttribute(ATTR_NAME, instName);
                  }
                  instElem.setAttribute(ATTR_CLASS, className);
                  Configuration cfg = new Configuration(instElem);
                  Object o = constructInstance(cfg, ELEM_CLASSES[TYPE_INSTANCE]);
                  Broker.println("Instance: " + o.getClass().getName());
               }
            }
         }
View Full Code Here


   }

   private void loadConfiguration(InputStream is) throws ConfigurationException, IOException {
      try {
         Document doc = DOMHelper.parse(is);
         Configuration root = new Configuration(doc);

         if ( !root.getName().equals(ELEM_LABRADOR) )
            throw new IOException("Invalid configuration format");

         root.processChildren(new ConfigurationCallback() {
            public void process(Configuration cfg) {
               for ( int j = 0; j < ELEM_NAMES.length; j++ ) {
                  if ( cfg.getName().equals(ELEM_NAMES[j]) ) {
                     Class c = ELEM_CLASSES[j];
                     Object o = constructInstance(cfg, c);
View Full Code Here

      return new ID(request.getPath().substring(PREFIX.length() - 1));
   }

   public void setConfig(Configuration config) throws ConfigurationException {
      super.setConfig(config);
      Configuration mimeCfg = config.getChild(MIMEMAPPINGS);
      if ( mimeCfg != null ) {
         mimeCfg.processChildren(MIMEMAPPING, new ConfigurationCallback() {
            public void process(Configuration cfg) {
               String ext = cfg.getAttribute(EXT);
               String type = cfg.getAttribute(TYPE);
               mimeTypes.put(ext, type);
            }
View Full Code Here

         filename = config.getAttribute(FILENAME, DEFAULT_FILENAME);
         FileOutputStream fos = new FileOutputStream(filename, true);
         BufferedOutputStream bos = new BufferedOutputStream(fos, BUFFER_SIZE);
         ps = new PrintStream(bos);

         Configuration itemsCfg = config.getChild(ITEMS);
         if ( itemsCfg != null ) {
            final List lst = new ArrayList();
            itemsCfg.processChildren(ITEM, new ConfigurationCallback() {
               public void process(Configuration cfg) {
                  String type = cfg.getAttribute(TYPE);
                  String name = cfg.getAttribute(NAME);
                  if ( type.equals(PATH) )
                     lst.add(new ItemInfo(TYPE_PATH));
View Full Code Here

TOP

Related Classes of com.dbxml.labrador.configuration.Configuration

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.