Examples of IXMLElement


Examples of com.izforge.izpack.adaptator.IXMLElement

   * @param  panelRoot  The tree to put the data in.
   */
  public void makeXMLData(IXMLElement panelRoot)
  {
    // Data path markup
    IXMLElement ipath = new XMLElementImpl("teamdatapath", panelRoot);
    ipath.setContent(idata.getVariable(TEAM_DATA_PATH));
    panelRoot.addChild(ipath);
  }
View Full Code Here

Examples of com.izforge.izpack.adaptator.IXMLElement

   * @param  panelRoot  The XML tree to read the data from.
   */
  public void runAutomated(IXMLElement panelRoot)
  {
    // We set the data path
    IXMLElement ipath = panelRoot.getFirstChildNamed("teamdatapath");
    idata.setVariable(TEAM_DATA_PATH, ipath.getContent());
  }
View Full Code Here

Examples of com.izforge.izpack.adaptator.IXMLElement

    // now we need to tell the packs panel to recreate its XML data.
    for (int i = 0;  i < idata.panels.size();   i++) {
      IzPanel panel = (IzPanel) idata.panels.get(i);
      if ("packsPanel".equals(panel.metadata.getPanelid())) {
        IXMLElement panelXML = idata.xmlData.getChildAtIndex(i);
        while (panelXML.hasChildren())
          panelXML.removeChild(panelXML.getChildAtIndex(0));
        panel.makeXMLData(panelXML);
        break;
      }
    }
  }
View Full Code Here

Examples of com.izforge.izpack.adaptator.IXMLElement

   * @param  panelRoot  The tree to put the data in.
   */
  public void makeXMLData(IXMLElement panelRoot)
  {
    // Data path markup
    IXMLElement ipath = new XMLElementImpl("datapath", panelRoot);
    ipath.setContent(idata.getVariable(DATA_PATH));
    panelRoot.addChild(ipath);
  }
View Full Code Here

Examples of com.izforge.izpack.adaptator.IXMLElement

   * @param  panelRoot  The XML tree to read the data from.
   */
  public void runAutomated(IXMLElement panelRoot)
  {
    // We set the data path
    IXMLElement ipath = panelRoot.getFirstChildNamed("datapath");
    idata.setVariable(DATA_PATH, ipath.getContent());
  }
View Full Code Here

Examples of net.n3.nanoxml.IXMLElement

  {
    try
    {
      final IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
      parser.setReader(new StdXMLReader(rdr));
      IXMLElement element = (IXMLElement) parser.parse();
      // Bug 2942351 (Program doesn't launch)
      // looking at the source for StdXMLBuilder, it appears that parser.parse() could possibly return
      // null.  So check for null here and skip if necessary.
      if (element != null)
      {
        Iterator it = new EnumerationIterator(element.enumerateChildren());
        while (it.hasNext())
        {
          final IXMLElement elem = (IXMLElement) it.next();
          if (isBeanElement(elem))
          {
            _beanColl.add(loadBean(elem));
          }
        }
View Full Code Here

Examples of net.n3.nanoxml.IXMLElement

        props.put(propDesc[i].getName(), propDesc[i]);
      }
      final List<IXMLElement> children = beanElement.getChildren();
      for (Iterator<IXMLElement> it = children.iterator(); it.hasNext();)
      {
        final IXMLElement propElem = it.next();
        final PropertyDescriptor curProp = props.get(propElem.getName());
        if (curProp != null)
        {
          loadProperty(bean, curProp, propElem);
        }
      }
View Full Code Here

Examples of net.n3.nanoxml.IXMLElement

  }

  private IXMLElement createElement(Object bean, String name)
    throws XMLException
  {
    IXMLElement elem = null;
    BeanInfo info = null;
    try
    {
      if (bean != null)
      {
        info = Introspector.getBeanInfo(bean.getClass(), Object.class);
      }
    }
    catch (IntrospectionException ex)
    {
      throw new XMLException(ex);
    }
    elem = new XMLElement(name != null ? name : XMLConstants.BEAN_ELEMENT_NAME);
    if (info != null)
    {
      if (bean instanceof IXMLAboutToBeWritten)
      {
        ((IXMLAboutToBeWritten) bean).aboutToBeWritten();
      }
      PropertyDescriptor[] propDesc = info.getPropertyDescriptors();
      elem = new XMLElement(name != null ? name : XMLConstants.BEAN_ELEMENT_NAME);
      elem.setAttribute(XMLConstants.CLASS_ATTRIBUTE_NAME,
                      bean.getClass().getName());
      for (int i = 0; i < propDesc.length; ++i)
      {
        processProperty(propDesc[i], bean, elem);
      }
View Full Code Here

Examples of net.n3.nanoxml.IXMLElement

        {
          final boolean isStringArray = returnType.getName().equals("[Ljava.lang.String;");
          Object[] props = (Object[]) getter.invoke(bean, (Object[])null);
          if (props != null)
          {
            IXMLElement indexElem = new XMLElement(propName);
            indexElem.setAttribute(XMLConstants.INDEXED, "true");
            beanElem.addChild(indexElem);
            for (int i = 0; i < props.length; ++i)
            {
              if (isStringArray)
              {
                StringWrapper sw = new StringWrapper((String)props[i]);
                indexElem.addChild(createElement(sw,
                      XMLConstants.BEAN_ELEMENT_NAME));
              }
              else
              {
                indexElem.addChild(createElement(props[i],
                        XMLConstants.BEAN_ELEMENT_NAME));
              }
            }
          }
        }
        else if (returnType == boolean.class
            || returnType == int.class
            || returnType == short.class
            || returnType == long.class
            || returnType == float.class
            || returnType == double.class
            || returnType == char.class)
        {
          IXMLElement propElem = new XMLElement(propName);
          propElem.setContent("" + getter.invoke(bean, (Object[])null));
          beanElem.addChild(propElem);
        }
        else if (returnType == String.class)
        {
          IXMLElement propElem = new XMLElement(propName);
          propElem.setContent((String) getter.invoke(bean, (Object[])null));
          beanElem.addChild(propElem);
        }
        else
        {
          beanElem.addChild(createElement(getter.invoke(bean, (Object[])null), propName));
View Full Code Here

Examples of net.n3.nanoxml.IXMLElement

        request.setHeaderField("Host", con.getHostHeaderValue()); //$NON-NLS-1$
        if (depth != null)
            request.setHeaderField("Depth", depth); //$NON-NLS-1$
        request.setHeaderField("Content-Type", "text/xml; charset=\"UTF-8\""); //$NON-NLS-1$ //$NON-NLS-2$

        IXMLElement root = new XMLElement(WebDAVConstants.PROPFIND_ELEM, WebDAVConstants.XML_DAV_NAMESPACE);
        root.addChild(new XMLElement(WebDAVConstants.ALLPROP_ELEM));

        StringWriter xml = new StringWriter();
        XMLWriter writer = new XMLWriter(xml);
        writer.write(root);
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.