コード例 #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();
 }
コード例 #2
0
 @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)});
 }
コード例 #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();
 }