Package com.ytec.jdap.model

Examples of com.ytec.jdap.model.Application


   * @see com.ytec.jdap.reader.IXmlReader#getAppById(java.lang.String)
   */
  public Application getAppById(String appId) throws Exception {
    Element element = getDocument().getDocumentElement();
    NodeList apps = element.getElementsByTagName(Constants.APPLICATION);
    Application application = new Application();

    for (int i = 0; i < apps.getLength(); i++) {
      Element ele = (Element) apps.item(i);
      if (appId.equals(ele.getAttribute(Constants.APP_ID))) {
        application.setProperties(ele);
        NodeList params = ele.getElementsByTagName(Constants.PARAM);

        if (params != null && params.getLength() > 0) {
          Map<String, String> paramMap = new HashMap<String, String>();
          for (int k = 0; k < params.getLength(); k++) {
            Element param = (Element) params.item(k);
            paramMap.put(param.getAttribute(Constants.PARAM_NAME), param.getAttribute(Constants.PARAM_VALUE));
          }
          application.setParams(paramMap);
        }
      }
    }
    return application;
  }
View Full Code Here


   * @see com.ytec.jdap.reader.IXmlReader#getAppByName(java.lang.String)
   */
  public Application getAppByName(String appName) throws Exception {
    Element element = getDocument().getDocumentElement();
    NodeList apps = element.getElementsByTagName(Constants.APPLICATION);
    Application application = new Application();

    for (int i = 0; i < apps.getLength(); i++) {
      Element ele = (Element) apps.item(i);
      if (appName.equals(ele.getAttribute(Constants.APP_NAME))) {
        application.setProperties(ele);
        NodeList params = ele.getElementsByTagName(Constants.PARAM);

        if (params != null && params.getLength() > 0) {
          Map<String, String> paramMap = new HashMap<String, String>();
          for (int k = 0; k < params.getLength(); k++) {
            Element param = (Element) params.item(k);
            paramMap.put(param.getAttribute(Constants.PARAM_NAME), param.getAttribute(Constants.PARAM_VALUE));
          }
          application.setParams(paramMap);
        }
      }
    }
    return application;
  }
View Full Code Here

TOP

Related Classes of com.ytec.jdap.model.Application

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.