Package org.jitterbit.xml

Examples of org.jitterbit.xml.XmlNameFactory$Name


    }

    private static Name getFirstName(InternationalString iname) throws JAXRException {
        for (Object o : iname.getLocalizedStrings()) {
            LocalizedString locName = (LocalizedString) o;
            Name name = objectFactory.createName();
            name.setValue(locName.getValue());
            name.setLang(locName.getLocale().getLanguage());
            return name;
        }
        return null;
    }
View Full Code Here


        return null;
    }
    private static void addNames(List<Name> names, InternationalString iname) throws JAXRException {
        for (Object o : iname.getLocalizedStrings()) {
            LocalizedString locName = (LocalizedString) o;
            Name name = objectFactory.createName();
            name.setValue(locName.getValue());
            name.setLang(locName.getLocale().getLanguage());
            names.add(name);
        }
    }
View Full Code Here

        Name[] result = new Name[namePatterns.size()];
        int currLoc = 0;
        for (Iterator i = namePatterns.iterator(); i.hasNext();)
        {
            Object obj = i.next();
            Name name = objectFactory.createName();
            if (obj instanceof String) {
                name.setValue((String)obj);
            } else if (obj instanceof LocalizedString) {
                LocalizedString ls = (LocalizedString)obj;
                name.setValue(ls.getValue());
                name.setLang(ls.getLocale().getLanguage());
            }
            result[currLoc] = name;
            currLoc++;
        }
        return result;
View Full Code Here

        }
        String rootName = struct.getRootNodeName();
        if (rootName == null || rootName.length() == 0) {
            return;
        }
        XmlNameFactory nameFactory = getXmlNameFactory();
        ExpandedName root = nameFactory.newExpandedName(rootName);
        for (RootSelector sel : rootSelectors) {
            sel.setSelectedRoot(root);
        }
    }
View Full Code Here

        }
    }

    private ExpandedNameBag createBagOfAvailableRoots(String[] availableRoots) {
        ExpandedNameBag bag = new ExpandedNameBag();
        XmlNameFactory nameFactory = getXmlNameFactory();
        bag.addAll(availableRoots, nameFactory);
        return bag;
    }
View Full Code Here

    private ExpandedName getRootNameFromFile(File file) throws InvalidRootException {
        try {
            RootNodeExtractor extractor = RootNodeExtractor.getSaxExtractor();
            Element root = extractor.extractRoot(file);
            XmlNameFactory nameFactory = XmlNameFactory.conforming();
            return nameFactory.newExpandedName(root);
        } catch (KongaXmlException ex) {
            throw new InvalidRootException(ex.getMessage(), ex);
        } catch (RuntimeException ex) {
            throw new InvalidRootException(PackageResources.ROOT_EXTRACTION_FAILED, ex);
        }
View Full Code Here

            @Override
            public void startElement(String uri, String localName, String qName, Attributes attributes)
                            throws SAXException {
                if (rootName == null) {
                    XmlNameFactory nameFactory = XmlNameFactory.conforming();
                    rootName = nameFactory.newExpandedName(uri, localName);
                }
            }
        });
        return rootName;
    }
View Full Code Here

     * <code>boolean</code>, <code>double</code>, <code>integer</code>, and <code>long</code>. This
     * lessens the risk of inferring a too restrictive type from the JSON sample. It will also make
     * it easier to translate the XML back to JSON when JSON is used as target.
     */
    private void reviseSimpleTypes() {
        XmlNameFactory nameFactory = XmlNameFactory.nonConforming();
        for (Element e : findElements("//xs:element[@type]")) {
            String type = e.getAttribute("type");
            QualifiedName qName = nameFactory.newQualifiedName(type);
            if (XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(nsCtx.getNamespaceURI(qName.getPrefix()))) {
                QualifiedName revisedTypeName = translateSimpleType(nameFactory, qName);
                e.setAttribute("type", revisedTypeName.toString());
            }
        }
View Full Code Here

    }

    public static List<Field> decode(String s) {
        List<Field> fields = Lists.newArrayList();
        if (StringUtils.isNotEmpty(s)) {
            XmlNameFactory nameFactory = XmlNameFactory.nonConforming();
            String[] parts = s.split("\\|");
            for (String p : parts) {
                String name = StringUtils.substringBefore(p, ",");
                String type = StringUtils.substringAfter(p, ",");
                fields.add(new Field(name, nameFactory.newExpandedName(type)));
            }
        }
        return fields;
    }
View Full Code Here

      for (String string : findQualifyers) {
        findQualifiers.getFindQualifier().add(string);
      }
      findBusiness.setFindQualifiers(findQualifiers);

      Name name = new Name();
      name.setValue(nameStr);
      findBusiness.getName().add(name);


      logger.debug("FindBusiness " + findBusiness + " sending findBusinesses request..");
      List<Business> businesses = new ArrayList<Business>();
View Full Code Here

TOP

Related Classes of org.jitterbit.xml.XmlNameFactory$Name

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.