Package org.milyn.edisax.model.internal

Examples of org.milyn.edisax.model.internal.Field


            NodeList nodes = node.getChildNodes();
            for (int i = 0; i < nodes.getLength(); i++) {
                Node currentNode = nodes.item(i);

                if (currentNode.getNodeName().equalsIgnoreCase(namespacePrefix + "field")) {
                    Field field = new Field();
                    segment.getFields().add(field);
                    digestField(currentNode, field, namespacePrefix, segment);
                } else {
                    digestSegmentGroup(currentNode, segment.getSegments(), namespacePrefix, segment);
                }
View Full Code Here


        Segment ugh = new Segment();
        Segment ugt = new Segment();

        ugh.setSegcode("UGH");
        ugh.setXmltag("UGH");
        ugh.addField(new Field("id", UNEdifact41ControlBlockHandlerFactory.NAMESPACE, true));

        ugt.setSegcode("UGT");
        ugt.setXmltag("UGT");
        ugt.addField(new Field("id", UNEdifact41ControlBlockHandlerFactory.NAMESPACE, true));

        definitionModel.getSegments().getSegments().add(ugh);
        definitionModel.getSegments().getSegments().add(ugt);
    }
View Full Code Here

            segment.getFields().add(convertToField(componens.get(id), isMandatory));
        }
    }

    private static Field convertToField(Component component, boolean isMandatory) {
        Field field = new Field();
        field.setName(component.getName());
        field.setXmltag(XmlTagEncoder.encode(component.getXmltag()));
        field.setNodeTypeRef(component.getNodeTypeRef());
        field.setDocumentation(component.getDocumentation());
        field.setMaxLength(component.getMaxLength());
        field.setMinLength(component.getMinLength());
        field.setRequired(isMandatory);
        field.setTruncatable(true);
        field.setDataType(component.getDataType());
        field.setDataTypeParameters(component.getTypeParameters());
        return field;
    }
View Full Code Here

        field.setDataTypeParameters(component.getTypeParameters());
        return field;
    }

    private static Field copyField(Field oldField, boolean isMandatory) {
        Field field = new Field();
        field.setName(oldField.getName());
        field.setXmltag(XmlTagEncoder.encode(oldField.getXmltag()));
        field.setNodeTypeRef(oldField.getNodeTypeRef());
        field.setDocumentation(oldField.getDocumentation());
        field.setMaxLength(oldField.getMaxLength());
        field.setMinLength(oldField.getMinLength());
        field.setRequired(isMandatory);
        field.setTruncatable(true);
        field.setDataType(oldField.getDataType());
        field.setDataTypeParameters(oldField.getTypeParameters());
        field.getComponents().addAll(oldField.getComponents());
        return field;
    }
View Full Code Here

        Map<String, Field> fields = new HashMap<String, Field>();

        BufferedReader _reader = new BufferedReader(reader);
        moveToNextPart(_reader);

        Field field = new Field();
        String id = populateField(_reader, components, field, useShortName);
        while (id != null) {
            fields.put(id, field);
            moveToNextPart(_reader);
            field = new Field();
            id = populateField(_reader, components, field, useShortName);
        }

        return fields;
    }
View Full Code Here

    for(int i = 0; i < numFields; i++) {
      if (ignoreUnmappedFields && i >= numFieldsMapped) {
                break;
            }
      String fieldMessageVal = currentSegmentFields[i + 1]; // +1 to skip the segment code
      Field expectedField = expectedFields.get(i);

      if(fieldRepeat != null) {
        String[] repeatedFields = EDIUtils.split(fieldMessageVal, fieldRepeat, delimiters.getEscape());
        for(String repeatedField : repeatedFields) {
          mapField(repeatedField, expectedField, i, segmentCode);
View Full Code Here

          // number of fields matches the expected number of fields.
          numberOfFieldsToValidate = currentSegmentFields.length;
        }

        for (int i = 1; i < numberOfFieldsToValidate; i++) {
            Field field = expectedFields.get(i-1);
            if (field.getComponents().size() == 0 && (!currentSegmentFields[i].equals(""))) {
                validateValueNode(field, currentSegmentFields[i]);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.milyn.edisax.model.internal.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.