Exemple #1
0
    public synchronized void save(Property<?> property, ContentValues newStore, Object value) {
      this.store = newStore;

      // we don't allow null values, as they indicate unset properties
      // when the database was written

      if (value != null) {
        property.accept(this, value);
      }
    }
Exemple #2
0
  /** Turn a model into xml attributes */
  private void serializeModel(
      AbstractModel model, Property<?>[] properties, Property<?>... excludes) {
    outer:
    for (Property<?> property : properties) {
      for (Property<?> exclude : excludes) {
        if (property.name.equals(exclude.name)) {
          continue outer;
        }
      }

      try {
        property.accept(xmlWritingVisitor, model);
      } catch (Exception e) {
        Timber.e(e, e.getMessage());
      }
    }
  }
  /**
   * Turn a model into xml attributes
   *
   * @param model
   */
  private void serializeModel(
      AbstractModel model, Property<?>[] properties, Property<?>... excludes) {
    outer:
    for (Property<?> property : properties) {
      for (Property<?> exclude : excludes) if (property.name.equals(exclude.name)) continue outer;

      try {
        property.accept(xmlWritingVisitor, model);
      } catch (Exception e) {
        Log.e(
            "astrid-exporter", //$NON-NLS-1$
            "Caught exception while reading "
                + property.name
                + //$NON-NLS-1$
                " from "
                + model.getDatabaseValues(),
            e); //$NON-NLS-1$
      }
    }
  }