javax.jcr.version.Version.getParent()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(97)

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

Version.getParent介绍

暂无

代码示例

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

/**
 * Tests if <code>VersionHistory.getName()</code> returns the right name
 */
public void testGetName() throws Exception {
  assertEquals("VersionHistory.getName() does not return the right name", version.getParent().getName(), vHistory.getName());
}

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

/**
 * Tests if <code>Version.getParent()</code> returns the right parent Node
 */
public void testGetParent() throws Exception {
  assertTrue("Version.getParent() does not return a parent-node of type nt:versionHistory", version.getParent().isNodeType(ntVersionHistory));
}

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

/**
 * Tests if <code>VersionHistory.isSame()</code> returns the right
 * <code>boolean</code> value
 */
public void testIsSame() throws Exception {
  assertTrue("VersionHistory.isSame(Item) did not return true", vHistory.isSame(version.getParent()));
}

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

/**
 * Checks if the given version belongs to this history
 *
 * @param version the version
 * @throws javax.jcr.version.VersionException if the specified version is
 *         not part of this version history
 * @throws javax.jcr.RepositoryException if a repository error occurs
 */
private void checkOwnVersion(Version version)
    throws VersionException, RepositoryException {
  if (!version.getParent().isSame(this)) {
    throw new VersionException("Specified version not contained in this history.");
  }
}

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

/**
 * Checks if the given version belongs to this history
 *
 * @param version the version
 * @throws javax.jcr.version.VersionException if the specified version is
 *         not part of this version history
 * @throws javax.jcr.RepositoryException if a repository error occurs
 */
private void checkOwnVersion(Version version)
    throws VersionException, RepositoryException {
  if (!version.getParent().isSame(this)) {
    throw new VersionException("Specified version not contained in this history.");
  }
}

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

/**
 * Returns the version labels that point to the given version
 * 
 * @param version the version for which the labels should be retrieved
 * @return the set of version labels for that version; never null
 * @throws RepositoryException if an error occurs accessing the repository
 */
private Set<String> versionLabelsFor( Version version ) throws RepositoryException {
  if (!version.getParent().equals(this)) {
    throw new VersionException(JcrI18n.invalidVersion.text(version.getPath(), getPath()));
  }
  String versionId = version.getIdentifier();
  PropertyIterator iter = versionLabels().getProperties();
  if (iter.getSize() == 0) return Collections.emptySet();
  Set<String> labels = new HashSet<String>();
  while (iter.hasNext()) {
    javax.jcr.Property prop = iter.nextProperty();
    if (versionId.equals(prop.getString())) {
      labels.add(prop.getName());
    }
  }
  return labels;
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

/**
 * Returns the version labels that point to the given version
 * 
 * @param version the version for which the labels should be retrieved
 * @return the set of version labels for that version; never null
 * @throws RepositoryException if an error occurs accessing the repository
 */
private Set<String> versionLabelsFor( Version version ) throws RepositoryException {
  if (!version.getParent().equals(this)) {
    throw new VersionException(JcrI18n.invalidVersion.text(version.getPath(), getPath()));
  }
  String versionId = version.getIdentifier();
  PropertyIterator iter = versionLabels().getProperties();
  if (iter.getSize() == 0) return Collections.emptySet();
  Set<String> labels = new HashSet<String>();
  while (iter.hasNext()) {
    javax.jcr.Property prop = iter.nextProperty();
    if (versionId.equals(prop.getString())) {
      labels.add(prop.getName());
    }
  }
  return labels;
}

代码示例来源:origin: pentaho/pentaho-platform

VersionHistory grandParent = mock( VersionHistory.class );
when( rootNode.getParent() ).thenReturn( parent );
when( parent.getParent() ).thenReturn( grandParent );

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

RepositoryException {
assert versionToBeRemoved.getParent().equals(this);

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

VersionHistory history = (VersionHistory) version.getParent();
final String versionableId = history.getVersionableIdentifier();
if (history.getRootVersion().isSame(version)) {

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

VersionHistory history = (VersionHistory) version.getParent();
final String versionableId = history.getVersionableIdentifier();
if (history.getRootVersion().isSame(version)) {

代码示例来源:origin: org.fcrepo/modeshape-jcr

RepositoryException {
assert versionToBeRemoved.getParent().equals(this);

代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

VersionHistory history = (VersionHistory) version.getParent();
final String versionableId = history.getVersionableIdentifier();
if (history.getRootVersion().isSame(version)) {

相关文章