Exemplo n.º 1
0
 static void emitExporter(EmitContext context, ModelDeclaration model, Name supportClassName)
     throws IOException {
   assert context != null;
   assert model != null;
   assert supportClassName != null;
   DescriptionGenerator emitter =
       new DescriptionGenerator(context, model, supportClassName, false);
   emitter.emit();
 }
 @Override
 public void deleteWaypoint(long waypointId, DescriptionGenerator descriptionGenerator) {
   final Waypoint waypoint = getWaypoint(waypointId);
   if (waypoint != null && waypoint.getType() == Waypoint.TYPE_STATISTICS) {
     final Waypoint nextWaypoint = getNextStatisticsWaypointAfter(waypoint);
     if (nextWaypoint == null) {
       Log.d(TAG, "Unable to find the next statistics marker after deleting one.");
     } else {
       nextWaypoint.getTripStatistics().merge(waypoint.getTripStatistics());
       nextWaypoint.setDescription(
           descriptionGenerator.generateWaypointDescription(nextWaypoint.getTripStatistics()));
       if (!updateWaypoint(nextWaypoint)) {
         Log.e(TAG, "Unable to update the next statistics marker after deleting one.");
       }
     }
   }
   contentResolver.delete(
       WaypointsColumns.CONTENT_URI,
       WaypointsColumns._ID + "=?",
       new String[] {Long.toString(waypointId)});
 }
Exemplo n.º 3
0
 private Name generateExporter(EmitContext context, ModelDeclaration model, Name supportName)
     throws IOException {
   assert context != null;
   assert model != null;
   assert supportName != null;
   EmitContext next =
       new EmitContext(
           context.getSemantics(),
           context.getConfiguration(),
           model,
           CATEGORY_STREAM,
           "Abstract{0}CsvExporterDescription");
   LOG.debug(
       "Generating CSV exporter description for {}",
       context.getQualifiedTypeName().toNameString());
   DescriptionGenerator.emitExporter(next, model, supportName);
   LOG.debug(
       "Generated CSV exporter description for {}: {}",
       context.getQualifiedTypeName().toNameString(),
       next.getQualifiedTypeName().toNameString());
   return next.getQualifiedTypeName();
 }