Examples of ConfigParser


Examples of org.jvnet.hk2.config.ConfigParser

  // TOC
  Map<String, List<URL>> mapUrls = getResources(locale + "/help/index.xml");

  // Get our parser...
  ConfigParser parser = new ConfigParser(habitat);

  // Setup a new "merged" TOC...
  mergedIndex = new Index();
  mergedIndex.setIndexItems(new ArrayList<IndexItem>());
  mergedIndex.setVersion("2.0");

  // Loop through the urls and add them all
  String id = null; // module id
  String prefix = "/" + locale + "/help/"// prefix (minus module id)
  List<URL> urls = null; // URLs to TOC files w/i each plugin module
  for (Map.Entry<String, List<URL>> entry : mapUrls.entrySet()) {
      id = entry.getKey();
      urls = entry.getValue();
      for (URL url : urls) {
    DomDocument doc = parser.parse(url);

    // Merge all the TOC's...
    Index index = (Index) doc.getRoot().get();
    for (IndexItem item : index.getIndexItems()) {
        insertIndexItem(mergedIndex.getIndexItems(), item, id + prefix);
View Full Code Here

Examples of org.jvnet.hk2.config.ConfigParser

    /**
     * @param <T> the ConfigBeanProxy type we are looking for
     */
    public <T extends ConfigBeanProxy> void parseAndSetConfigBean(List<ConfigBeanDefaultValue> values) {

        ConfigParser configParser = new ConfigParser(serviceLocator);
        // I don't use the GlassFish document here as I don't need persistence
        final DomDocument doc = new DomDocument<GlassFishConfigBean>(serviceLocator) {
            @Override
            public Dom make(final ServiceLocator serviceLocator, XMLStreamReader xmlStreamReader, GlassFishConfigBean dom, ConfigModel configModel) {
                return new GlassFishConfigBean(serviceLocator, this, dom, configModel, xmlStreamReader);
View Full Code Here

Examples of org.jvnet.hk2.config.ConfigParser

        //TODO make this method target aware!
        Class parentClass = getOwningClassForLocation(defaultValue.getLocation());
        Class configBeanClass = getClassForFullName(defaultValue.getConfigBeanClassName());
        Method m = findSuitableCollectionGetter(parentClass, configBeanClass);
        if (m != null) {
            ConfigParser configParser = new ConfigParser(serviceLocator);
            // I don't use the GlassFish document here as I don't need persistence
            final DomDocument doc = new DomDocument<GlassFishConfigBean>(serviceLocator) {
                @Override
                public Dom make(final ServiceLocator serviceLocator, XMLStreamReader xmlStreamReader, GlassFishConfigBean dom,
                                ConfigModel configModel) {
View Full Code Here

Examples of org.jvnet.hk2.config.ConfigParser

        //TODO make this method target aware!
        Class parentClass = getOwningClassForLocation(defaultValue.getLocation());
        Class configBeanClass = getClassForFullName(defaultValue.getConfigBeanClassName());
        Method m = findSuitableCollectionGetter(parentClass, configBeanClass);
        if (m != null) {
            ConfigParser configParser = new ConfigParser(serviceLocator);
            // I don't use the GlassFish document here as I don't need persistence
            final DomDocument doc = new DomDocument<GlassFishConfigBean>(serviceLocator) {
                @Override
                public Dom make(final ServiceLocator serviceLocator, XMLStreamReader xmlStreamReader, GlassFishConfigBean dom,
                                ConfigModel configModel) {
View Full Code Here

Examples of org.jvnet.hk2.config.ConfigParser

            return null;
        }

        try {
            Habitat habitat = Globals.getStaticHabitat();
            ConfigParser parser = new ConfigParser(habitat);
            URL domainURL = domainXMLFile.toURI().toURL();
            DomDocument doc = parser.parse(domainURL);
            Dom domDomain = doc.getRoot();
            Domain d = domDomain.createProxy(Domain.class);
            return d;
        } catch (Exception ex) {
            throw new RuntimeException(ex);
View Full Code Here

Examples of org.radargun.config.ConfigParser

      String config = getConfigOrExit(args);

      out("Configuration file is: " + config);

      try {
         ConfigParser configParser = ConfigParser.getConfigParser();
         MasterConfig masterConfig = configParser.parseConfig(config);
         Master master = new Master(masterConfig);
         master.run();
      } catch (Exception e) {
         log.error("Master failed", e);
         e.printStackTrace();
View Full Code Here

Examples of org.zkoss.zk.ui.sys.ConfigParser

  }
  private static void load0() throws java.io.IOException {
    final ClassLocator locator = new ClassLocator();

    //1. parse config.xml
    final ConfigParser parser = new ConfigParser();
    parser.parseConfigXml(null); //only system default configs

    //2. process lang.xml (no particular dependency)
    for (Enumeration en = locator.getResources("metainfo/zk/lang.xml");
    en.hasMoreElements();) {
      final URL url = (URL)en.nextElement();
View Full Code Here

Examples of org.zkoss.zk.ui.sys.ConfigParser

    Servlets.setBrowserIdentifier(new BrowserIdentifier());
      //plugin device-dependent browser identifier

    //load config as soon as possible since it might set some system props
    final Configuration config = new Configuration();
    final ConfigParser parser = new ConfigParser();

    //load metainfo/zk/config.xml
    try {
      parser.parseConfigXml(config);
    } catch (Throwable ex) {
      log.error("Unable to load metainfo/zk/config.xml", ex);
    }

    //load metainfo/zk/zk.xml
    try {
      final ClassLocator loc = new ClassLocator();
      for (Enumeration en = loc.getResources("metainfo/zk/zk.xml");
      en.hasMoreElements();) {
        final URL cfgUrl = (URL)en.nextElement();
        try {
          parser.parse(cfgUrl, config, loc);
        } catch (Throwable ex) {
          log.error("Unable to load "+cfgUrl, ex);
        }
      }
    } catch (Throwable ex) {
      log.error("Unable to load metainfo/zk/zk.xml", ex);
    }

    //load /WEB-INF/zk.xml
    try {
      final URL cfgUrl = _ctx.getResource("/WEB-INF/zk.xml");
      if (cfgUrl != null)
        parser.parse(cfgUrl, config, new ServletContextLocator(_ctx));
    } catch (Throwable ex) {
      log.error("Unable to load /WEB-INF/zk.xml", ex);
    }

    //after zk.xml is loaded since it depends on the configuration
View Full Code Here

Examples of ptolemy.backtrack.xmlparser.ConfigParser

            SourceOutputStream stream = SourceOutputStream.getStream(
                    _configName, _overwrite);
            Set<String> classSet = new HashSet<String>();
            classSet.addAll(_classes);

            ConfigParser parser = new ConfigParser();
            parser.addExcludedFile(new File(_configName).getCanonicalPath());
            parser.parseConfigFile(ConfigParser.DEFAULT_SYSTEM_ID, classSet);

            if ((_prefix != null) && (_prefix.length() > 0)) {
                parser.addPackagePrefix(_prefix, classSet);
            }

            OutputStreamWriter writer = null;
            try {
                writer = new OutputStreamWriter(stream);
                XmlOutput.outputXmlTree(parser.getTree(), writer);
            } finally {
                if (writer != null) {
                    writer.close();
                }
            }
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.