Package org.jitterbit.xml

Examples of org.jitterbit.xml.XmlNameFactory$Expanded


        }
        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

TOP

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

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.