javax.jcr.Repository.isSingleValueDescriptor()方法的使用及代码示例

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

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

Repository.isSingleValueDescriptor介绍

[英]Returns true if key is a valid single-value descriptor; otherwise returns false.
[中]如果key是有效的单值描述符,则返回true;否则返回false

代码示例

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

@Override
public boolean isSingleValueDescriptor( String key ) {
  return repository.isSingleValueDescriptor(key);
}

代码示例来源:origin: net.adamcin.oakpal/oakpal-core

@Override
public boolean isSingleValueDescriptor(String key) {
  return delegate.isSingleValueDescriptor(key);
}

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

public boolean isSingleValueDescriptor(String key) {
  return repository.isSingleValueDescriptor(key);
}

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

/** {@inheritDoc} */
public boolean isSingleValueDescriptor(String key) throws RemoteException {
  return repository.isSingleValueDescriptor(key);
}

代码示例来源:origin: io.wcm/io.wcm.testing.sling-mock

@Override
public boolean isSingleValueDescriptor(final String key) {
 return this.delegate.isSingleValueDescriptor(key);
}

代码示例来源:origin: org.onehippo.cms7.hst.components/hst-core

public boolean isSingleValueDescriptor(String key) {
  return delegatee.isSingleValueDescriptor(key);
}

代码示例来源:origin: org.onehippo.cms7/hippo-repository-connector

public boolean isSingleValueDescriptor(String key) {
  return repository.isSingleValueDescriptor(key);
}

代码示例来源:origin: org.apache.sling/org.apache.sling.commons.testing

public boolean isSingleValueDescriptor(String key) {
  return wrapped.isSingleValueDescriptor(key);
}

代码示例来源:origin: org.apache.sling/org.apache.sling.jcr.base

@Override
public boolean isSingleValueDescriptor(String key) {
  Repository repo = getRepository();
  if (repo != null) {
    return repo.isSingleValueDescriptor(key);
  }
  logger.error("isSingleValueDescriptor: Repository not available");
  return false;
}

代码示例来源:origin: org.onehippo.cms7.hst.components/hst-session-pool

public boolean isSingleValueDescriptor(String key) {
  Repository curRepository = getCurrentThreadRepository();
  if (curRepository != null) {
    return curRepository.isSingleValueDescriptor(key);
  }
  return false;
}

代码示例来源:origin: org.onehippo.cms7.hst.components/hst-session-pool

public boolean isSingleValueDescriptor(String key) {
  try {
    return getRepository().isSingleValueDescriptor(key);
  } catch (RepositoryException e) {
    log.error("RepositoryException: ",e);
  }
  return false;
}

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

/**
 * Checks whether the given key identifies a valid single-valued
 * descriptor key in the proxied repository. Returns <code>false</code>
 * if the proxied repository can not be accessed.
 *
 * @return <code>true</code> if the key identifies a valid single-valued
 *         descriptor in the proxied repository,
 *         <code>false</code> otherwise
 */
public boolean isSingleValueDescriptor(String key) {
  try {
    return getRepository().isSingleValueDescriptor(key);
  } catch (RepositoryException e) {
    return false;
  }
}

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

/**
 * Checks whether the given key identifies a valid single-valued
 * descriptor key in the proxied repository. Returns <code>false</code>
 * if the proxied repository can not be accessed.
 *
 * @return <code>true</code> if the key identifies a valid single-valued
 *         descriptor in the proxied repository,
 *         <code>false</code> otherwise
 */
public boolean isSingleValueDescriptor(String key) {
  try {
    return getRepository().isSingleValueDescriptor(key);
  } catch (RepositoryException e) {
    return false;
  }
}

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

/**
 * Checks whether the given key identifies a valid single-valued
 * descriptor key in the proxied repository. Returns <code>false</code>
 * if the proxied repository can not be accessed.
 *
 * @return <code>true</code> if the key identifies a valid single-valued
 *         descriptor in the proxied repository,
 *         <code>false</code> otherwise
 */
public boolean isSingleValueDescriptor(String key) {
  try {
    return factory.getRepository().isSingleValueDescriptor(key);
  } catch (RepositoryException e) {
    return false;
  }
}

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

/**
 * Checks whether the given key identifies a valid single-valued
 * descriptor key in the proxied repository. Returns <code>false</code>
 * if the proxied repository can not be accessed.
 *
 * @return <code>true</code> if the key identifies a valid single-valued
 *         descriptor in the proxied repository,
 *         <code>false</code> otherwise
 */
public boolean isSingleValueDescriptor(String key) {
  try {
    return getRepository().isSingleValueDescriptor(key);
  } catch (RepositoryException e) {
    return false;
  }
}

代码示例来源:origin: org.onehippo.cms7.hst.components/hst-session-pool

public boolean isSingleValueDescriptor(String key) {
  if (jcrDelegateeRepository != null) {
    return jcrDelegateeRepository.isSingleValueDescriptor(key);
  }
  if (hippoRepository != null) {
    ClassLoader currentClassloader = switchToRepositoryClassloader();
    try {
      return hippoRepository.getRepository().isSingleValueDescriptor(key);
    } finally {
      if (currentClassloader != null) {
        Thread.currentThread().setContextClassLoader(currentClassloader);
      }
    }
  }
  return false;
}

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

/**
 * Tests that the required repository descriptors are available.
 */
public void testRequiredDescriptors() {
  Repository rep = session.getRepository();
  for (Iterator<String> it = requiredDescriptorKeys.iterator(); it.hasNext();) {
    String descName = it.next();
    assertTrue(descName + " is a standard descriptor", rep.isStandardDescriptor(descName));
    if (rep.isSingleValueDescriptor(descName)) {
      Value val = rep.getDescriptorValue(descName);
      assertNotNull("Required descriptor is missing: " + descName,
          val);
    } else {
      Value[] vals = rep.getDescriptorValues(descName);
      assertNotNull("Required descriptor is missing: " + descName,
          vals);
    }
  }
}

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

/**
   * Tests whether {@link Repository#getDescriptorValues(String)} returns an
   * Value[] of size 1 for single valued descriptors.
   */
  public void testGetDescriptorValues() {
    Repository rep = session.getRepository();
    // "option.node.type.management.supported" denotes a single-valued BOOLEAN descriptor
    String descName = Repository.OPTION_NODE_TYPE_MANAGEMENT_SUPPORTED;
    assertTrue(rep.isSingleValueDescriptor(descName));
    Value[] vals = rep.getDescriptorValues(descName);
    assertNotNull("Required descriptor is missing: " + descName, vals);
    assertEquals(1, vals.length);
    assertEquals(PropertyType.BOOLEAN, vals[0].getType());
    try {
      // getDescriptorValue(key).getString() is equivalent to getDescriptor(key)
      assertEquals(vals[0].getString(), rep.getDescriptor(descName));
    } catch (RepositoryException e) {
      fail(e.getMessage());
    }

    // "option.node.type.management.supported" denotes a single-valued BOOLEAN descriptor
    descName = Repository.QUERY_LANGUAGES;
    assertFalse(rep.isSingleValueDescriptor(descName));
    Value val = rep.getDescriptorValue(descName);
    assertNull(descName + " is a multi-value descriptor, getDescriptorValue() should return null", val);
  }
}

相关文章