javax.jcr.query.Row.getNode()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(102)

本文整理了Java中javax.jcr.query.Row.getNode方法的一些代码示例,展示了Row.getNode的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Row.getNode方法的具体详情如下:
包路径:javax.jcr.query.Row
类名称:Row
方法名:getNode

Row.getNode介绍

[英]Returns the Node corresponding to this Row.
[中]

代码示例

代码示例来源:origin: nl.vpro/jcr-criteria

@Override
protected Node getNode() throws RepositoryException {
  return row.getNode();
}
@Override

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-core

@Override
  public Object next() {
    Row row = (Row) super.next();
    try {
      return row.getNode();
    } catch (RepositoryException e) {
      throw new RuntimeException(
          "Unable to access the node in " + row, e);
    }
  }
};

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-core

public Node getNode(String selectorName) throws RepositoryException {
  Row row = getRow(selectorName);
  if (row != null) {
    return row.getNode(selectorName);
  } else {
    return null;
  }
}

代码示例来源:origin: apache/jackrabbit

/**
 * Evaluates the given row. If a selector name is specified, then
 * the corresponding node in this row is evaluated by calling the
 * protected {@link #evaluate(Node)} method.
 */
protected boolean evaluate(Row row) throws RepositoryException {
  if (selectorName != null) {
    return evaluate(row.getNode(selectorName));
  } else {
    return true;
  }
}

代码示例来源:origin: apache/jackrabbit

public void testGetNode() throws RepositoryException {
  Row r = getRow();
  String expectedPath = testRootNode.getNode(nodeName1).getPath();
  assertEquals("unexpected result node", expectedPath, r.getNode().getPath());
}

代码示例来源:origin: info.magnolia.dam/magnolia-dam-jcr

@Override
  public Object transform(Object input) {
    try {
      Node node = ((Row) input).getNode(ASSET_SELECTOR_NAME);
      return createItem(node);
    } catch (RepositoryException e) {
      throw new RuntimeRepositoryException(e);
    }
  }
}

代码示例来源:origin: apache/jackrabbit

/** {@inheritDoc} */
public RemoteNode getNode() 
    throws RepositoryException, RemoteException {
  try {
    return getRemoteNode(row.getNode());
  } catch (RepositoryException ex) {
    throw getRepositoryException(ex);    		
  }
}

代码示例来源:origin: apache/jackrabbit

/** {@inheritDoc} */
public RemoteNode getNode(String selectorName) 
    throws RepositoryException, RemoteException {
  try {
    return getRemoteNode(row.getNode(selectorName));
  } catch (RepositoryException ex) {
    throw getRepositoryException(ex);    		
  }
}

代码示例来源:origin: info.magnolia/magnolia-core

@Override
  public Node nextNode() throws NoSuchElementException {
    Row row = (Row) next();
    try {
      return row.getNode(selector);
    } catch (RepositoryException e) {
      // no way to pass a root cause to NSEE
      log.debug(e.getMessage(), e);
      throw new NoSuchElementException(e.getMessage());
    }
  }
};

代码示例来源:origin: ModeShape/modeshape

@Override
  public void validate( int rowNumber,
             Row row ) throws RepositoryException {
    assertThat(row.getNode().getName(), is("Hybrid"));
  }
}).validate(query, result);

代码示例来源:origin: ModeShape/modeshape

@Override
  public void validate( int rowNumber,
             Row row ) throws RepositoryException {
    resultIds.add(row.getNode().getIdentifier());
  }
}).validate(query, result);

代码示例来源:origin: ModeShape/modeshape

@Override
  public void validate( int rowNumber,
             Row row ) throws RepositoryException {
    expected.add(row.getNode().getIdentifier());
  }
}).validate(query, query.execute());

代码示例来源:origin: ModeShape/modeshape

@Override
  public void validate( int rowNumber,
             Row row ) throws RepositoryException {
    assertTrue(row.getNode().hasProperty("car:model"));
  }
}).validate(query, result);

代码示例来源:origin: apache/jackrabbit-oak

protected void search(QueryManager qm, ExecutionContext context) throws RepositoryException {
  Query q = getQuery(qm, context);
  QueryResult r = q.execute();
  RowIterator it = r.getRows();
  for (int rows = 0; it.hasNext() && rows < MAX_RESULTS; rows++) {
    Node node = it.nextRow().getNode();
    LOG.debug(node.getPath());
  }
}

代码示例来源:origin: ModeShape/modeshape

@Override
  public void validate( int rowNumber,
             Row row ) throws RepositoryException {
    assertThat(row.getNode().hasProperty("car:wheelbaseInInches"), is(true));
  }
}).validate(query, result);

代码示例来源:origin: ModeShape/modeshape

@Override
  public void validate( int rowNumber,
             Row row ) throws RepositoryException {
    resultIds.add(row.getNode().getIdentifier());
  }
}).validate(query, result);

代码示例来源:origin: apache/jackrabbit-oak

@Override
protected void search(QueryManager qm, ExecutionContext context)
  throws RepositoryException {
  searchCommon(qm, context);
  Query q = getQuery(qm, context);
  QueryResult r = q.execute();
  RowIterator it = r.getRows();
  for (int rows = 0; it.hasNext() && rows < LIMIT; rows++) {
    Node node = it.nextRow().getNode();
    LOG.debug(node.getPath());
  }
}

代码示例来源:origin: apache/jackrabbit

private List<String> qrToPaths(QueryResult qr) throws RepositoryException {
    List<String> ret = new ArrayList<String>();
    for (Row row : JcrUtils.getRows(qr)) {
      Node n = row.getNode();
      ret.add(n.getPath().replace(n.getParent().getPath() + "/", ""));
    }
    return ret;
  }
}

代码示例来源:origin: ModeShape/modeshape

@Override
  public void validate( int rowNumber,
             Row row ) throws RepositoryException {
    // All the rows are identical ...
    assertThat(row.getValue("pa").getString(), is("value1"));
    assertThat(row.getValue("pb").getString(), is("value1"));
    // The path of the first column is the same ...
    assertThat(row.getNode("x").getPath(), is("/Other/NodeA"));
    // The path of the second selector will vary in each row ...
    assertThat(expectedPaths.remove(row.getNode("y").getPath()), is(true));
  }
}).validate(query, result);

代码示例来源:origin: ModeShape/modeshape

@Override
  public void validate( int rowNumber,
             Row row ) throws RepositoryException {
    String id = row.getValue("mode:id").getString();
    Node nodeFromQuery = row.getNode();
    Node resolvedNode = session().getNodeByIdentifier(id);
    assertSame(nodeFromQuery, resolvedNode);
    nodesById.put(id, nodeFromQuery);
  }
}).validate(query, result);

相关文章