Package com.google.gerrit.prettify.common

Examples of com.google.gerrit.prettify.common.PrettyFormatter$Tag


    Relation relation =
      new Relation(new CommonEntityData(1234, 2, timestamp, OsmUser.NONE, 0));
    relation.getMembers().add(new RelationMember(2345, EntityType.Node, "noderole"));
    relation.getMembers().add(new RelationMember(3456, EntityType.Way, "wayrole"));
    relation.getMembers().add(new RelationMember(4567, EntityType.Relation, "relationrole"));
    relation.getTags().add(new Tag("relationkey", "relationvalue"));
   
    testRelationWriter.process(relation);
    try {
      testBufferedWriter.flush();
    } catch (IOException e) {
View Full Code Here


          e);
    }
  }
 
  private Tag readTag() throws Exception {
    Tag tag = new Tag(reader.getAttributeValue(null, ATTRIBUTE_NAME_KEY),
        reader.getAttributeValue(null, ATTRIBUTE_NAME_VALUE));
    reader.nextTag();
    reader.nextTag();
    return tag;
  }
View Full Code Here

   
    writeableContainer = entityContainer.getWriteableInstance();
    entity = writeableContainer.getEntity();
   
    for (Iterator<Tag> i = entity.getTags().iterator(); i.hasNext();) {
      Tag tag;
     
      tag = i.next();
     
      if (keysToDrop.contains(tag.getKey())) {
        i.remove();
      } else {
        for (String prefix : keyPrefixesToDrop) {
          if (tag.getKey().startsWith(prefix)) {
            i.remove();
               break;
          }
        }
      }
View Full Code Here

  @Override
  public DbFeature<Tag> buildEntity(ResultSet resultSet) {
    try {
      return new DbFeature<Tag>(
        resultSet.getLong("entity_id"),
        new Tag(
          resultSet.getString("k"),
          resultSet.getString("v")
        )
      );
     
View Full Code Here

   */
  @Override
  public int populateEntityParameters(PreparedStatement statement, int initialIndex, DbFeature<Tag> entityFeature) {
    try {
      int prmIndex;
      Tag tag;
     
      tag = entityFeature.getFeature();
     
      prmIndex = initialIndex;
     
      statement.setLong(prmIndex++, entityFeature.getEntityId());
      statement.setString(prmIndex++, tag.getKey());
      statement.setString(prmIndex++, tag.getValue());
     
      return prmIndex;
     
    } catch (SQLException e) {
      throw new OsmosisRuntimeException(
View Full Code Here

   
    dbTags = (Map<String, String>) rs.getObject("tags");
    if (dbTags != null) {
      tags = entityData.getTags();
      for (Entry<String, String> tagEntry : dbTags.entrySet()) {
        tags.add(new Tag(tagEntry.getKey(), tagEntry.getValue()));
      }
    }
   
    return entityData;
  }
View Full Code Here

    Iterator<Integer> keyIterator = keys.iterator();
    Iterator<Integer> valueIterator = values.iterator();
    while (keyIterator.hasNext()) {
      String key = fieldDecoder.decodeString(keyIterator.next());
      String value = fieldDecoder.decodeString(valueIterator.next());
      Tag tag = new Tag(key, value);
      tags.add(tag);
    }
  }
View Full Code Here

          throw new OsmosisRuntimeException(
              "The PBF DenseInfo keys/values list contains a key with no corresponding value.");
        }
        int valueIndex = keysValuesIterator.next();

        Tag tag = new Tag(fieldDecoder.decodeString(keyIndex), fieldDecoder.decodeString(valueIndex));
        tags.add(tag);
      }

      node = new org.openstreetmap.osmosis.core.domain.v0_6.Node(entityData,
          fieldDecoder.decodeLatitude(latitude), fieldDecoder.decodeLongitude(longitude));
View Full Code Here

  public final void testProcessNormalNode() {
    Node node =
      new Node(
        new CommonEntityData(1234, 2, timestamp, new OsmUser(23, "someuser"), 0),
        20.12345678, -21.98765432);
    node.getTags().add(new Tag("nodekey", "nodevalue"));
    testNodeWriter.process(node);
    try {
      testBufferedWriter.flush();
    } catch (IOException e) {
      e.printStackTrace();
View Full Code Here

   * Test writing of a Node element with no user.
   */
  @Test
  public final void testProcessNodeWithNoUser() {
    Node node = new Node(new CommonEntityData(1234, 2, timestamp, OsmUser.NONE, 0), 20.12345678, -21.98765432);
    node.getTags().add(new Tag("nodekey", "nodevalue"));
    testNodeWriter.process(node);
    try {
      testBufferedWriter.flush();
    } catch (IOException e) {
      e.printStackTrace();
View Full Code Here

TOP

Related Classes of com.google.gerrit.prettify.common.PrettyFormatter$Tag

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.