Package org.w3c.dom

Examples of org.w3c.dom.NodeList


    if (StringUtils.isNotEmpty(getAttribute(ele, TYPE_ATTRIBUTE))) {
      String mappingDirection = getAttribute(ele, TYPE_ATTRIBUTE);
      MappingDirection direction = MappingDirection.valueOf(mappingDirection);
      fieldMapBuilder.type(direction);
    }
    NodeList nodeList = ele.getChildNodes();
    for (int i = 0; i < nodeList.getLength(); i++) {
      Node node = nodeList.item(i);
      if (node instanceof Element) {
        Element element = (Element) node;
        debugElement(element);
        parseFieldElements(element, fieldMapBuilder);
      }
View Full Code Here


  }

  private DozerBuilder.FieldMappingBuilder determineFieldMap(DozerBuilder.MappingBuilder definitionBuilder, Element ele) {
    DozerBuilder.FieldMappingBuilder fieldMapBuilder = definitionBuilder.field();

    NodeList nl = ele.getChildNodes();
    for (int i = 0; i < nl.getLength(); i++) {
      Node node = nl.item(i);
      if (node instanceof Element) {
        Element element = (Element) node;

        if (A_ELEMENT.equals(element.getNodeName())) {
          String name = getNodeValue(element);
View Full Code Here

    if (StringUtils.isNotEmpty(getAttribute(ele, REMOVE_ORPHANS))) {
      fieldMapBuilder.removeOrphans(BooleanUtils.toBoolean(getAttribute(ele, REMOVE_ORPHANS)));
    }

    NodeList nl = ele.getChildNodes();
    for (int i = 0; i < nl.getLength(); i++) {
      Node node = nl.item(i);
      if (node instanceof Element) {
        Element element = (Element) node;

        debugElement(element);
View Full Code Here

    }
  }

  private void parseConfiguration(Element ele, DozerBuilder builder) {
    DozerBuilder.ConfigurationBuilder configBuilder = builder.configuration();
    NodeList nl = ele.getChildNodes();
    for (int i = 0; i < nl.getLength(); i++) {
      Node node = nl.item(i);
      if (node instanceof Element) {
        Element element = (Element) node;

        debugElement(element);
View Full Code Here

      }
    }
  }

  private void parseVariables(Element element) {
    NodeList nl = element.getChildNodes();
    for (int i = 0; i < nl.getLength(); i++) {
      Node node = nl.item(i);
      if (node instanceof Element) {
        Element ele = (Element) node;

        debugElement(ele);
View Full Code Here

    }

  }

  private void parseCustomConverters(Element ele, DozerBuilder.ConfigurationBuilder config) {
    NodeList nl = ele.getChildNodes();
    for (int i = 0; i < nl.getLength(); i++) {
      Node node = nl.item(i);
      if (node instanceof Element) {
        Element element = (Element) node;

        debugElement(element);

        if (CONVERTER_ELEMENT.equals(element.getNodeName())) {
          String converterType = getAttribute(element, TYPE_ATTRIBUTE);
          DozerBuilder.CustomConverterBuilder customConverterBuilder = config.customConverter(converterType);

          NodeList list = element.getChildNodes();
          for (int x = 0; x < list.getLength(); x++) {
            Node node1 = list.item(x);
            if (node1 instanceof Element) {
              Element element1 = (Element) node1;
              if (CLASS_A_ELEMENT.equals(element1.getNodeName())) {
                customConverterBuilder.classA(getNodeValue(element1));
              } else if (CLASS_B_ELEMENT.equals(element1.getNodeName())) {
View Full Code Here

      }
    }
  }

  private void parseCopyByReferences(Element ele, DozerBuilder.ConfigurationBuilder config) {
    NodeList nl = ele.getChildNodes();
    for (int i = 0; i < nl.getLength(); i++) {
      Node node = nl.item(i);
      if (node instanceof Element) {
        Element element = (Element) node;

        debugElement(element);
View Full Code Here

      }
    }
  }

  private void parseAllowedExceptions(Element ele, DozerBuilder.ConfigurationBuilder config) {
    NodeList nl = ele.getChildNodes();
    for (int i = 0; i < nl.getLength(); i++) {
      Node node = nl.item(i);
      if (node instanceof Element) {
        Element element = (Element) node;

        debugElement(element);
View Full Code Here

    private void extactJoinResults(Element node, List<Object[]> result) throws TranslatorException {
      if(isSObject(node)) {
        extractValuesFromElement(node, result);
      } else {
        NodeList children = node.getChildNodes();
        if(null != children && children.getLength() > 0) {
          for( int i = 0; i < children.getLength(); i++) {
            Node item = children.item(i);
            if(item instanceof Element) {
              Element childElement = (Element)item;
              if(isSObject(childElement)) {
                extractValuesFromElement(childElement, result);
              } else if(item.getChildNodes().getLength() > 0) {
View Full Code Here

      throws IOException, SAXException, ParserConfigurationException
  {
    content.clear();
    final Document doc = DOMUtilities.parseInputStream(in);
    final Element e = doc.getDocumentElement();
    final NodeList list = e.getElementsByTagName("key"); //$NON-NLS-1$
    for (int i = 0; i < list.getLength(); i++)
    {
      final Element keyElement = (Element) list.item(i);
      final String keyName = keyElement.getAttribute("name"); //$NON-NLS-1$
      final boolean keyGlobal = "true".equals(keyElement.getAttribute("global")); //$NON-NLS-1$
      final boolean keyHidden = "true".equals(keyElement.getAttribute("hidden")); //$NON-NLS-1$
      final String descr = getDescription(keyElement).trim();

      final NodeList enumNodes = keyElement.getElementsByTagName("enum"); //$NON-NLS-1$
      if (enumNodes.getLength() != 0)
      {
        final String[] alteratives = collectEnumEntries((Element) enumNodes.item(0));
        final EnumConfigDescriptionEntry en = new EnumConfigDescriptionEntry(keyName);
        en.setDescription(descr);
        en.setGlobal(keyGlobal);
        en.setHidden(keyHidden);
        en.setOptions(alteratives);
        add(en);
        continue;
      }

      final NodeList classNodes = keyElement.getElementsByTagName("class"); //$NON-NLS-1$
      if (classNodes.getLength() != 0)
      {
        final Element classElement = (Element) classNodes.item(0);
        final String className = classElement.getAttribute("instanceof"); //$NON-NLS-1$
        if (className == null)
        {
          throw new ParseException(messages.getString(
              "ConfigDescriptionModel.ERROR_0005_MISSING_INSTANCEOF")); //$NON-NLS-1$
        }
        try
        {
          final ClassLoader classLoader = ObjectUtilities.getClassLoader(getClass());
          final Class baseClass = Class.forName(className, false, classLoader);
          final ClassConfigDescriptionEntry ce = new ClassConfigDescriptionEntry(keyName);
          ce.setBaseClass(baseClass);
          ce.setDescription(descr);
          ce.setGlobal(keyGlobal);
          ce.setHidden(keyHidden);
          add(ce);
          continue;
        }
        catch (Exception ex)
        {
          final String message = messages.getString(
              "ConfigDescriptionModel.ERROR_0006_BASE_CLASS_LOAD_FAILED"); //$NON-NLS-1$
          ConfigDescriptionModel.logger.error(message, ex);
          continue;
        }
      }

      final NodeList textNodes = keyElement.getElementsByTagName("text"); //$NON-NLS-1$
      if (textNodes.getLength() != 0)
      {
        final TextConfigDescriptionEntry textEntry = new TextConfigDescriptionEntry(keyName);
        textEntry.setDescription(descr);
        textEntry.setGlobal(keyGlobal);
        textEntry.setHidden(keyHidden);
View Full Code Here

TOP

Related Classes of org.w3c.dom.NodeList

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.