Examples of XmlConfigParser


Examples of com.avast.syringe.config.internal.XmlConfigParser

        configFileName = completeFileName(configFileName, contextDir);

        LOGGER.info("Loading XML configuration from {}", configFileName);

        T instance;
        XmlConfigParser xmlConfigParser = new XmlConfigParser();
        InputStream input;
        final File configFile = new File(contextDir, configFileName);
        if (configFileName.endsWith(".ftl")) {
            // the input file is a FreeMarker template, so process it
            // TODO:could be used normalize from file
            // configFileName can be in form ../configuration/Template.ftl, we have to remove ../ so fm can recognize path
            String trimedConfigFileName = configFileName;
            while(trimedConfigFileName.startsWith("../")) {
                trimedConfigFileName = trimedConfigFileName.substring(3);
            }
            input = processFreeMarkerTemplate(trimedConfigFileName);
        } else {
            input = new FileInputStream(configFile);
        }

        final XmlConfig xmlConfig;
        try {
            xmlConfig = xmlConfigParser.loadConfig(input);
        } finally {
            input.close();
        }

        Class<?> cls = Thread.currentThread().getContextClassLoader().loadClass(xmlConfig.getClassName());
View Full Code Here

Examples of com.avast.syringe.config.internal.XmlConfigParser

        if (!configFile.exists() && !configInjector.containsMandatory()) {
            // the default config
            configBean = configClass.newInstance();
        } else {
            URL schemaUrl = getSchemaUrl(configClass);
            Map<String, Property> props = new XmlConfigParser(schemaUrl).loadProperties(configFile);
            configBean = configInjector.inject(props, new Injection.ContextualPropertyResolver() {
                @Override
                public Object getProperty(InjectableProperty property, Value configValue) throws Exception {
                    // Allow injection of this configuration loader
                    if (ConfigurationLoader.class.isAssignableFrom(property.getType())) {
View Full Code Here

Examples of com.dubture.symfony.core.parser.XMLConfigParser

    indexServices(parser.getServices());
  }

  protected void loadDumpedXmlContainer(IResource resource) throws Exception {
    FileInputStream fis = new FileInputStream(file.getLocation().toFile());
    XMLConfigParser parser = new XMLConfigParser(fis);
    parser.parse();
    indexServices(parser.getServices());
    indexParameters(parser.getParameters());
  }
View Full Code Here

Examples of com.dubture.symfony.core.parser.XMLConfigParser

  }

  protected void loadXML(IResource resource) {
    try {
      FileInputStream fis = new FileInputStream(file.getLocation().toFile());
      XMLConfigParser parser = new XMLConfigParser(fis);
      parser.parse();
      if (parser.hasRoutes()) {
        indexRoutes(parser.getRoutes());
      }
    } catch (Exception e) {
      Logger.logException(e);
    }
  }
View Full Code Here

Examples of com.dubture.symfony.core.parser.XMLConfigParser

    if (!"xml".equals(file.getFileExtension())) {
      return null;
    }
   
    IScriptProject scriptProject = DLTKCore.create(resource.getProject());
    XMLConfigParser parser;
    try {
      parser = new XMLConfigParser(file.getContents());
      parser.parse();
      HashMap<String,Service> services = parser.getServices();
     
      Iterator<String> it = services.keySet().iterator();
      PhpModelAccess model = PhpModelAccess.getDefault();
      IDLTKSearchScope scope = SearchEngine.createSearchScope(scriptProject);
     
View Full Code Here

Examples of com.dubture.symfony.core.parser.XMLConfigParser

   
    try {
     
      String dir = System.getProperty("user.dir") + "/Resources/config/routing.xml";
      FileInputStream input = new FileInputStream(new File(dir));
      XMLConfigParser parser = new XMLConfigParser(input);
      parser.parse();
     
      assertTrue(parser.hasRoutes());
     
      Stack<Route> routes = parser.getRoutes();     
      assertEquals(2, routes.size());
     
      Route route = routes.pop();
     
      assertEquals(route.name, "blog_index");
View Full Code Here

Examples of com.dubture.symfony.core.parser.XMLConfigParser

    try {
   
      String dir = System.getProperty("user.dir") + "/Resources/config/services1.xml";
      FileInputStream input = new FileInputStream(new File(dir));
      XMLConfigParser parser = new XMLConfigParser(input);
      parser.parse();
     
      HashMap<String, Service>services = parser.getServices();
     
      assertTrue(services.size() == 5);
     
      String tplAnnotation = "view.template_annotation";
      String tplSomething = "view.template_something";
View Full Code Here

Examples of com.dubture.symfony.core.parser.XMLConfigParser

     
      Service service = null;
     
      String dir = System.getProperty("user.dir") + "/Resources/config/orm.xml";
      FileInputStream input = new FileInputStream(new File(dir));
      XMLConfigParser parser = new XMLConfigParser(input);
      parser.parse();
     
      HashMap<String, Service>services = parser.getServices();     
      HashMap<String, String> parameters = parser.getParameters();
     
     
      assertTrue(services.size() == 7);
      assertTrue(parameters.size() == 19);
     
View Full Code Here

Examples of com.hetty.conf.XmlConfigParser

  public boolean start() {
    String configFile = HettyConfig.getInstance().getpropertiesFile();
    String[] fileArr = configFile.split(",");
   
    for(String file:fileArr){
      XmlConfigParser configParser = new XmlConfigParser(file);
     
      List<Application> appList = configParser.parseApplication();
      for(Application app:appList){
        HettySecurity.addToApplicationMap(app);
      }
     
      List<Service> serviceList = configParser.parseService();
      for(Service service:serviceList){
        ServiceHandler.addToServiceMap(service);
      }
     
      List<ServiceVersion>  versionList = configParser.parseSecurity();
      if(versionList != null){
        for(ServiceVersion version:versionList){
          ServiceHandler.addToVersionMap(version);
        }
      }
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.