Package org.jitterbit.xml

Examples of org.jitterbit.xml.XmlStringBuilder


            KongaIoUtils.createAndWrite(file, getXml());
        }
    }

    private String getXml() {
        XmlStringBuilder xml = new XmlStringBuilder();
        appendXml(multipleFolders, xml);
        return xml.getXml();
    }
View Full Code Here


            KongaIoUtils.createAndWrite(file, getXml());
        }
    }

    private String getXml() {
        XmlStringBuilder builder = new XmlStringBuilder();
        builder.addElement(MappingsXmlConstants.ROOT);
        writeMappings(builder);
        writeMultipleFolders(builder);
        builder.closeElement();
        return builder.getXml();
    }
View Full Code Here

        this.includeDefaultValues = values;
    }

    public XSD buildXsd(DatabaseStructure dbStruct) {
        illegalNameEncountered = false;
        xsd = new XmlStringBuilder();
        addSchemaElement();
        openRootElement();
        if (!addTables(dbStruct)) {
            return new XSD(null, null, false);
        }
View Full Code Here

            ErrorLog.log(this, "Failed to store file store dependencies", ex);
        }
    }

    private String generateXml() {
        XmlStringBuilder builder = new XmlStringBuilder();
        builder.addElement(ROOT);
        for (String mainPath : links.keySet()) {
            addFileToXml(mainPath, builder);
        }
        builder.closeElement();
        return builder.getXml();
    }
View Full Code Here

        private final XmlStringBuilder xml;

        public Builder(OperationLogEntry logEntry) {
            this.logEntry = logEntry;
            this.xml = new XmlStringBuilder();
        }
View Full Code Here

    // TODO: Remove this method, and add a method save() instead. (When we do that, we
    // should remove the saveUiState method from ManagedProject.) The implementation
    // class is passed an InterchangeXmlSaver (or maybe rather a ProjectPersistor),
    // so it can save itself.
    public String getXml() {
        XmlStringBuilder builder = new XmlStringBuilder();
        builder.addElement(XmlConstants.Elements.UI_STATE);
        if (displayOnStartUp != null) {
            appendOpenPagesXml(builder);
        }
        if (expandedOnStartUp != null) {
            appendExpandedNodesXml(builder);
        }
        builder.closeElement();
        return builder.getXml();
    }
View Full Code Here

    private class XmlBuilder {

        private final XmlStringBuilder xml;

        public XmlBuilder() {
            xml = new XmlStringBuilder();
        }
View Full Code Here

        private final XmlStringBuilder outputXml;

        private final Map<String, String> stringMap;

        public JtrReader(Map<String, String> stringMap) {
            outputXml = new XmlStringBuilder();
            this.stringMap = stringMap;
        }
View Full Code Here

    File file = new File(fileName);
    // file.canWrite() always returns false here since the file hasn't been created on disk yet
    //if ( !file.canWrite() )
      //throw new IOException("The specified file \"" + file.getAbsolutePath() + "\" is not writable by this process.");

    XmlStringBuilder builder = new XmlStringBuilder();
    builder.addElement(ROOT);

    builder.addElement(HEADERS);
    Set<JmsHeader> headers = jmsHeaders.getDefinedHeaders();
    for ( JmsHeader header : headers ) {
      DataElement de = jmsHeaders.getHeader(header);
      builder.addElement(HEADER);
      builder.addAttribute(TYPE, de.getType().toString());
      builder.addAttribute(NAME, header.getName());
      builder.setElementValue(de.toString());
      builder.closeElement();
    }
    builder.closeElement();

    builder.addElement(PROPERTIES);
    Set<String> properties = jmsProperties.getPropertyNames();
    for (String name : properties) {
      DataElement de = jmsProperties.getProperty(name);
      builder.addElement(PROPERTY);
      builder.addAttribute(TYPE, de.getType().toString());
      builder.addAttribute(NAME, name);
      builder.setElementValue(de.toString());
      builder.closeElement();
    }
    builder.closeAllElements();
   
    FileWriter fileWriter = null;
    try {
      fileWriter = new FileWriter(file);
      fileWriter.write(builder.getXml());
    }
    finally {
      KongaIoUtils.close(fileWriter);
    }
  }
View Full Code Here

    public File getFile(IntegrationEntity entity) {
        throw new UnsupportedOperationException();
    }

    private String createDeletedItemsXml() {
        XmlStringBuilder builder = new XmlStringBuilder();
        builder.addElement(XmlConstants.Elements.DELETED_ITEMS);
        for (EntityType type : EntityTypeConfig.getInstance().getSupportedEntityTypes()) {
            for (IntegrationId id : managedProject.getDeletedItemsOfType(type)) {
                builder.addElement(type.toString());
                builder.addAttribute(XmlConstants.Attributes.ID, id.toString());
                builder.closeElement();
            }
        }
        builder.closeElement();
        return builder.getXml();
    }
View Full Code Here

TOP

Related Classes of org.jitterbit.xml.XmlStringBuilder

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.