Package slash.navigation.earthtools.binding

Examples of slash.navigation.earthtools.binding.Height$Location


 
  public ValidationException[] apply(Message msg) {
    List<ValidationException> exceptions = new ArrayList<ValidationException>();

    ValidationException ve = new ValidationException("Invalid version: " + msg.getVersion());
    Location location = new Location()
        .withSegmentName("MSH")
        .withField(12);
    ve.setLocation(location);
    ve.setError(ErrorCode.UNSUPPORTED_VERSION_ID);
    exceptions.add(ve);
View Full Code Here


    public Location getLocation(Message msg) throws HL7Exception {
      Terser t = new Terser(msg);
      StringTokenizer tok = new StringTokenizer(expression, "-", false);
      Segment segment = t.getSegment(tok.nextToken());
      Location location = new Location()
          .withSegmentName(segment.getName())
          .withFieldIndizes(Terser.getIndices(expression));
      return location;
    }
View Full Code Here

    for (Iterator<Structure> iter = ReadOnlyMessageIterator
        .createPopulatedStructureIterator(msg, GenericSegment.class); iter.hasNext();) {
      String segmentName = iter.next().getName();
      ValidationException ve = new ValidationException("Found unknown segment: " + segmentName);
      Location location = new Location().withSegmentName(segmentName);
      ve.setLocation(location);
      exceptions.add(ve);
    }
    return exceptions.toArray(new ValidationException[exceptions.size()]);
  }
View Full Code Here

        }
        return visitor.end(this, currentLocation);
    }

    public Location provideLocation(Location parentLocation, int index, int repetition) {
        return new Location(parentLocation).withField(index);
    }
View Full Code Here

    public boolean accept(MessageVisitor visitor, Location location) throws HL7Exception {
        if (visitor.start(this, location)) {
            Type[] types = getComponents();
            for (int i = 0; i < types.length; i++) {
                Type t = getComponent(i);
                Location nextLocation = t.provideLocation(location, i+1, -1);
                if (!t.accept(visitor, nextLocation)) break;
            }
            ExtraComponents ec = getExtraComponents();
            for (int i = 0; i < ec.numComponents(); i++) {
               Varies v = ec.getComponent(i);
               Location nextLocation = v.provideLocation(location, i + types.length, -1);
               if (!v.accept(visitor, nextLocation)) break;
            }
        }
        return visitor.end(this, location);
    }
View Full Code Here

        }
        return visitor.end(this, location);
    }
   
    public Location provideLocation(Location location, int index, int repetition) {
        return new Location(location).pushGroup(getName(), repetition);
    }   
View Full Code Here

    protected void visitNestedStructures(MessageVisitor visitor, Location location) throws HL7Exception {
        for (String name : getNames()) {
            Structure[] structures = getAll(name);
            for (int j=0; j < structures.length; j++) {
                int rep = isRepeating(name) ? j : -1;
                Location nextLocation = structures[j].provideLocation(location, -1, rep);
                if (!structures[j].accept(visitor, nextLocation)) break;
            }
        }       
    }
View Full Code Here

    public boolean accept(MessageVisitor visitor, Location location) throws HL7Exception {
        if (visitor.start(this, location)) {
            String[] names = getNames();
            for (int i = 1; i <= names.length; i++) {
                Field f = new Field(getField(i), getMaxCardinality(i));
                Location nextLocation = f.provideLocation(location, i, -1);
                if (!f.accept(visitor, nextLocation))
                    break;
            }
        }
        return visitor.end(this, location);
View Full Code Here

        }
        return visitor.end(this, location);
    }

  public Location provideLocation(Location location, int index, int repetition) {
        return new Location(location)
            .withSegmentName(getName())
            .withSegmentRepetition(repetition);
    }
View Full Code Here

     * @param visitable message element to be visited
     * @return the MessageVisitor
     * @throws HL7Exception if an error occurs while visiting
     */
    public static <T extends MessageVisitor> T visit(Visitable visitable, T visitor) throws HL7Exception {
        visitable.accept(visitor, new Location());
        return visitor;
    }
View Full Code Here

TOP

Related Classes of slash.navigation.earthtools.binding.Height$Location

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.