Package org.jitterbit.integration.data.structure

Examples of org.jitterbit.integration.data.structure.ComplexTextStructure


    private boolean isNewDocument(TextDocument document) {
        return document.isUnknownDoc() || document.getDataStructure() == null;
    }

    private void createNewTextStructure(TextDocument document) {
        textStructure = new ComplexTextStructure(document.getName(), document.isFixedField());
        Segment root = Segment.newRootSegment();
        addRow(root);
    }
View Full Code Here


            delimQualifierPanel.applyToTextDocument(document);
        }
    }

    private void applyStructure(TextDocument document) {
        ComplexTextStructure cts = getTextStructure(document);
        addSegmentInformation(document, cts);
    }
View Full Code Here

    @Test
    public void ensureComplexTextStructureWithNoSegmentsIsDetected() {
        TextDocument doc = new TextDocument("Borken");
        setDelimiterAndQualifier(doc);
        doc.setStructure(new ComplexTextStructure("X", false));
        runValidation(doc, ValidationStatus.INVALID);
    }
View Full Code Here

        doc.setDelimiter(FieldDelimiter.COMMA);
        return doc;
    }

    private static ComplexTextStructure createValidComplexDelimitedTextStructure() {
        ComplexTextStructure s = new ComplexTextStructure("Complex", false);
        Segment root = Segment.newRootSegment();
        s.addSegment(root);
        Segment order = new Segment("Order");
        order.setOccurrence(SegmentOccurrence.ZeroOrMore);
        order.setParentName(root.getName());
        Field id = Field.newDelimitedIdentifier("O");
        order.fieldList.add(id);
        Field date = new Field(1, "Date", FieldDataType.Date.name(), "", "", 0, 0, 0, id);
        order.fieldList.add(date);
        s.addSegment(order);
        return s;
    }
View Full Code Here

        s.addSegment(order);
        return s;
    }

    private static ComplexTextStructure createComplexDelimitedTextStructureWithEmptySegment() {
        ComplexTextStructure s = new ComplexTextStructure("Complex", false);
        Segment root = Segment.newRootSegment();
        s.addSegment(root);
        Segment order = new Segment("Order");
        order.setOccurrence(SegmentOccurrence.ZeroOrMore);
        order.setParentName(root.getName());
        s.addSegment(order);
        return s;
    }
View Full Code Here

        s.addSegment(order);
        return s;
    }

    private static ComplexTextStructure createComplexDelimitedTextStructureWithDuplicatedFieldName() {
        ComplexTextStructure s = new ComplexTextStructure("Complex", false);
        Segment root = Segment.newRootSegment();
        s.addSegment(root);
        Segment order = new Segment("Order");
        order.setOccurrence(SegmentOccurrence.ZeroOrMore);
        order.setParentName(root.getName());
        Field id = Field.newDelimitedIdentifier("O");
        order.fieldList.add(id);
        Field date = new Field(1, "Date", FieldDataType.Date.name(), "", "", 0, 0, 0, id);
        order.fieldList.add(date);
        Field anotherDate = new Field(2, "Date", FieldDataType.Date.name(), "", "", 0, 0, 0, date);
        order.fieldList.add(anotherDate);
        s.addSegment(order);
        return s;
    }
View Full Code Here

        return EntityUtils.getAvailableChildName(parent, suggestedName);
    }

    private ComplexTextStructure createComplexText(Node tableNode) {
        // TODO: If the same table is used several times we should use segment aliases.
        ComplexTextStructure structure = new ComplexTextStructure("", false);
        Segment root = Segment.newRootSegment();
        structure.addSegment(root);
        addSegmentForTable(tableNode, root.getName(), structure, new HashSet<String>());
        return structure;
    }
View Full Code Here

                return null;
            }
            if (isSimpleDoc()) {
                textStructure = new SimpleTextStructure(getName(), isFixedField(), lines);
            } else {
                textStructure = new ComplexTextStructure(getName(), isFixedField(), lines);
            }
            updateTextStructureDelimiterAndQualifier();
            setDeployDirty(true);
            return textStructure;
        }
View Full Code Here

        }
        // TODO: Make sure this works (i.e. that this property is restored by the call to super.restoreFrom)
        if (isSimpleDoc()) {
            textStructure = new SimpleTextStructure("", false);
        } else {
            textStructure = new ComplexTextStructure("", false);
        }
        textStructure.restoreFrom(p.getFirstChild("Structure"));
        updateTextStructureDelimiterAndQualifier();
    }
View Full Code Here

        return s;
    }

    private TextStructure createComplexStructure() {
        generateSegmentIds();
        ComplexTextStructure structure = new ComplexTextStructure(name, false);
        structure.addSegment(rootSegment);
        for (Segment segment : completedSegments) {
            structure.addSegment(segment);
        }
        return structure;
    }
View Full Code Here

TOP

Related Classes of org.jitterbit.integration.data.structure.ComplexTextStructure

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.