Package org.jitterbit.integration.data.structure.text

Examples of org.jitterbit.integration.data.structure.text.Field


     */
    private static class DelimitedFieldTableModel2 extends DelimitedFieldTableModel {

        @Override
        public Field createNewObject() {
            Field field = super.createNewObject();
            if (getRowCount() == 0) {
                // For the first field we set the data type to Identifier:
                field.setDataType(FieldDataType.Identifier);
            }
            return field;
        }
View Full Code Here


        if (isUpdateBlocked()) {
            return false;
        }
        boolean updated = false;
        if (o instanceof Field) {
            Field f = (Field) o;
            switch (columnIndex) {
            case 1:
                updated = renameField(f, ((String) value).trim());
                break;
            case 2:
View Full Code Here

        int rows = getRowCount();
        return (rows == 0) ? createNewFirstField() : createNewLastField(rows);
    }

    private Field createNewFirstField() {
        return new Field(0, "", "String", "", "", 0, 1, 1, null);
    }
View Full Code Here

    private Field createNewFirstField() {
        return new Field(0, "", "String", "", "", 0, 1, 1, null);
    }

    private Field createNewLastField(int rows) {
        Field lastField = getField(rows - 1);
        return new Field(0, "", "String", "", "", 0, 0, 1, lastField);
    }
View Full Code Here

            }
            CROM_ext ext=crom.getExtension();
            String del=Utils.getDelimiterString(text);
            ext.setDelimiter(del);
            ext.setStrQual(text.getStringQualifier());
            Field identifier=s.findIdentField();
            if(identifier!=null && isFixedField){
              ext.setIdentPos(identifier.getBeginPosition());
              ext.setIdentLength(identifier.getLength());
            }
            if(root!=null && !bExtDefinedForRoot){
              ext=root.getExtension();
                ext.setDelimiter(del);
                ext.setStrQual(text.getStringQualifier());
                if(identifier!=null && isFixedField){
                  ext.setIdentPos(identifier.getBeginPosition());
                  ext.setIdentLength(identifier.getLength());
                }
                bExtDefinedForRoot=true;
            }
            map.put(s, crom);
            if(parent==null)root=crom;
View Full Code Here

    @Test
    public void testSimpleDelimitedStructureValidation() {
        TextDocument doc = createValidSimpleDelimitedDocument(2);
        SimpleTextStructure struct = (SimpleTextStructure) doc.getDataStructure();
        Field f0 = struct.getSegment().getFieldList().get(0);
        Field f1 = struct.getSegment().getFieldList().get(1);
        f1.setName(f0.getName());
        runValidation(doc, ValidationStatus.INVALID);
    }
View Full Code Here

    @Test
    public void testSimpleFixedFieldStructureValidation() {
        TextDocument doc = createValidSimpleFixedFieldDocument();
        SimpleTextStructure struct = (SimpleTextStructure) doc.getDataStructure();
        Field f0 = struct.getSegment().getFieldList().get(0);
        Field f1 = struct.getSegment().getFieldList().get(1);
        f1.setName(f0.getName());
        runValidation(doc, ValidationStatus.INVALID);
    }
View Full Code Here

    private static TextDocument createValidSimpleDelimitedDocument(int numberOfFields) {
        TextDocument doc = new TextDocument("Test");
        SimpleTextStructure struct = new SimpleTextStructure(doc.getName(), false);
        Segment seg = new Segment("seg_1");
        for (int n = 0; n < numberOfFields; ++n) {
            Field f = new Field(n, "F" + n, FieldDataType.String.name(), "", "", 0, false);
            seg.getFieldList().add(f);
        }
        struct.setSegment(seg);
        doc.setStructure(struct);
        doc.setDelimiter(FieldDelimiter.COMMA);
View Full Code Here

    private static TextDocument createValidSimpleFixedFieldDocument() {
        TextDocument doc = new TextDocument("Test");
        Segment seg = new Segment("seg_1");
        SimpleTextStructure struct = new SimpleTextStructure(doc.getName(), true);
        Field field_1 = new Field(1, "A", FieldDataType.String.name(), "", "", 0, true);
        field_1.setBeginPosition(0);
        field_1.setLength(2);
        seg.getFieldList().add(field_1);
        Field field_2 = new Field(1, "B", FieldDataType.String.name(), "", "", 0, true);
        field_2.setBeginPosition(2);
        field_2.setLength(4);
        seg.getFieldList().add(field_2);
        struct.setSegment(seg);
        doc.setStructure(struct);
        doc.setDelimiter(FieldDelimiter.COMMA);
        return doc;
View Full Code Here

        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

TOP

Related Classes of org.jitterbit.integration.data.structure.text.Field

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.