class OpenLREncoder implements openlr.OpenLREncoder {

    @Override
    public List<LocationReferenceHolder> encodeLocations(
            final OpenLREncoderParameter parameter, final List<Location> loc)
            throws OpenLRProcessingException {
        if (loc == null || loc.isEmpty()) {
            LOG.error("No location provided!");
            throw new OpenLREncoderProcessingException(
                    EncoderProcessingError.INVALID_PARAMETER);
        }
        if (LOG.isDebugEnabled()) {
            LOG.debug("OpenLR encoding of " + loc.size() + " locations started");
        }
        List<LocationReferenceHolder> llr = new ArrayList<LocationReferenceHolder>();
        OpenLREncoderProperties properties = new OpenLREncoderProperties(parameter.getConfiguration(), parameter.getPhysicalEncoders());
        // encode every single location
        for (Location l : loc) {
            LocationReferenceHolder lr = encodeLocation(parameter, properties, l);

            llr.add(lr);
        }
        return llr;
    }

}