Package org.zkoss.idom

Examples of org.zkoss.idom.Element$AttrMap


  }
  /** Parse config.xml. */
  private static void parseConfig(Map urls, Element root, Locator loc) {
    for (Iterator it = root.getElements("taglib").iterator();
    it.hasNext();) {
      final Element el = (Element)it.next();
      final String s = IDOMs.getRequiredElementValue(el, "taglib-location");
      final URL url = loc.getResource(s.startsWith("/") ? s.substring(1): s);
      if (url != null) {
        urls.put(
          IDOMs.getRequiredElementValue(el, "taglib-uri"), url);
      } else {
        log.error(s+" not found, "+el.getLocator());
      }
    }
  }
View Full Code Here


  }

  private static class TaglibLoader extends AbstractLoader {
    //-- Loader --//
    public Object load(Object src) throws Exception {
      final Element root =
        new SAXBuilder(true, false, true).build((URL)src).getRootElement();
      return Taglibs.load(root);
    }
View Full Code Here

        ioex.initCause(ex);
        throw ioex;
      }

      this.url = url;
      final Element root = this.document.getRootElement();
      this.name = IDOMs.getRequiredElementValue(root, elName);
      final String deps = root.getElementValue(elDepends, true);
      if (deps == null || deps.length() == 0) {
        this.depends = Collections.EMPTY_LIST;
      } else {
        this.depends = new LinkedList();
        CollectionsX.parse(this.depends, deps, ',');
View Full Code Here

    final URL xmlURL = Locators.getDefault().getResource(APP_XML);
    if (xmlURL == null)
      throw new SystemException("File not found: "+APP_XML);

//    if (log.debugable()) log.debug("Parsing "+APP_XML);
    final Element root =
      new SAXBuilder(false,false,true).build(xmlURL).getRootElement();

    for (Iterator it = root.getElements("module").iterator();
    it.hasNext();) {
      final Element e = (Element)it.next();
      final String ctxroot = (String)e.getContent("web/context-root");
      if (ctxroot == null) {
//        if (D.ON && log.finerable()) log.finer("Skip non-web: "+e.getContent("java"));
        continue;
      }
View Full Code Here

    final List<Object[]> xelmtds = new LinkedList<Object[]>();
    final List<VariableResolver> resolvers = new LinkedList<VariableResolver>();
    String[] exts = null;
    ErrorHandler errh = null;
    for (Iterator it = root.getElements().iterator(); it.hasNext();) {
      final Element el = (Element)it.next();
      final String elnm = el.getName();
      if ("action".equals(elnm)) {
        defs.add(parseAction(el));
      } else if ("error-handler-class".equals(elnm)) {
        final String clsnm = el.getText(true);
        noELnorEmpty(elnm, clsnm, el);
        errh = (ErrorHandler)Classes.newInstanceByThread(clsnm);
      } else if ("extensions".equals(elnm)) {
        final String s = el.getText(true);
        noEL(elnm, s, el);
        exts = parseExtensions(s);
      } else if ("taglib".equals(elnm)) {
        final String uri = IDOMs.getRequiredAttributeValue(el, "uri");
        noELnorEmpty("uri", uri, el);
View Full Code Here

  //parse action
  private static ActionDefinition parseAction(Element el)
  throws Exception {
    final Map<String, ViewInfoProxy> results = new HashMap<String, ViewInfoProxy>();
    for (Iterator it = el.getElements("result").iterator(); it.hasNext();) {
      final Element e = (Element)it.next();
      results.put(e.getAttributeValue("name"),
        new ViewInfoProxy(e.getAttributeValue("type"), e.getText(true)));
    }
    final String path = IDOMs.getRequiredAttributeValue(el, "path");
    noELnorEmpty("path", path, el);
    return new ActionDefinitionImpl(path,
      IDOMs.getRequiredAttributeValue(el, "class"),
View Full Code Here

TOP

Related Classes of org.zkoss.idom.Element$AttrMap

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.