Package avrora.core

Examples of avrora.core.SourceMapping$Location


        }
        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

    return b.toString();
  }

    public Location provideLocation(Location location, int index, int repetition) {
        if (location.getField() < 0)
            return new Location(location)
                .withField(index)
                .withFieldRepetition(repetition);
        if (location.getComponent() < 0)
            return new Location(location)
                .withComponent(index);
        return new Location(location)
            .withSubcomponent(index);
    }
View Full Code Here

    GeoTargeting geoTargeting = new GeoTargeting();

    // Include the US, Quebec, Canada, and the B3P Canada postal code.
    // To determine what other geographic criteria exists,
    // run GetGeoTargets.java.
    Location countryLocation = new Location();
    countryLocation.setId(2840L);

    Location regionLocation = new Location();
    regionLocation.setId(20133L);

    Location postalCodeLocation = new Location();
    postalCodeLocation.setId(9000093L);

    geoTargeting.setTargetedLocations(new Location[] {countryLocation, regionLocation,
        postalCodeLocation});

    // Exclude Chicago and the New York metro area.
    // To determine what other geographic criteria exists, run
    // GetGeoTargets.java.
    Location cityLocation = new Location();
    cityLocation.setId(1016367L);

    Location metroLocation = new Location();
    metroLocation.setId(200501L);
    geoTargeting.setExcludedLocations(new Location[] {cityLocation, metroLocation});

    // Exclude domains that are not under the network's control.
    UserDomainTargeting userDomainTargeting = new UserDomainTargeting();
    userDomainTargeting.setDomains(new String[] {"usa.gov"});
View Full Code Here

    GeoTargeting geoTargeting = new GeoTargeting();

    // Include the US, Quebec, Canada, and the B3P Canada postal code.
    // To determine what other geographic criteria exists,
    // run GetGeoTargets.java.
    Location countryLocation = new Location();
    countryLocation.setId(2840L);

    Location regionLocation = new Location();
    regionLocation.setId(20133L);

    Location postalCodeLocation = new Location();
    postalCodeLocation.setId(9000093L);

    geoTargeting.setTargetedLocations(new Location[] {countryLocation, regionLocation,
        postalCodeLocation});

    // Exclude Chicago and the New York metro area.
    // To determine what other geographic criteria exists, run
    // GetGeoTargets.java.
    Location cityLocation = new Location();
    cityLocation.setId(1016367L);

    Location metroLocation = new Location();
    metroLocation.setId(200501L);
    geoTargeting.setExcludedLocations(new Location[] {cityLocation, metroLocation});

    // Exclude domains that are not under the network's control.
    UserDomainTargeting userDomainTargeting = new UserDomainTargeting();
    userDomainTargeting.setDomains(new String[] {"usa.gov"});
View Full Code Here

TOP

Related Classes of avrora.core.SourceMapping$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.