Package yalp.templates

Examples of yalp.templates.TemplateCompiler$Tag


   
    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

   */
  @Override
  public void processRow(ResultSet resultSet) throws SQLException {
        String key;
        String value;
        Tag tag;
       
    key = resultSet.getString("k");
    value = resultSet.getString("v");
   
    tag = new Tag(key, value);
   
        listener.process(tag, resultSet);
  }
View Full Code Here

    }

    // Replace the entity tags with the transformed values.
    entityTags.clear();
    for (Entry<String, String> tag : tagMap.entrySet()) {
      entityTags.add(new Tag(tag.getKey(), tag.getValue()));
    }

    return writeableEntityContainer;
  }
View Full Code Here

TOP

Related Classes of yalp.templates.TemplateCompiler$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.