Esempio n. 1
0
  /**
   * Retrieves the property state for the given id
   *
   * @param id
   * @return
   * @throws NoSuchItemStateException
   * @throws ItemStateException
   */
  protected VirtualPropertyState internalGetPropertyState(PropertyId id)
      throws NoSuchItemStateException, ItemStateException {

    // get parent state
    NodeState parent = (NodeState) getItemState(id.getParentId());

    // handle some default prop states
    if (parent instanceof VirtualNodeState) {
      return ((VirtualNodeState) parent).getProperty(id.getName());
    }
    throw new NoSuchItemStateException(id.toString());
  }
Esempio n. 2
0
  /**
   * Checks if this provider has the property state of the given id.
   *
   * @param id
   * @return <code>true</code> if it has the property state
   */
  protected boolean internalHasPropertyState(PropertyId id) {

    try {
      // get parent state
      NodeState parent = (NodeState) getItemState(id.getParentId());

      // handle some default prop states
      if (parent instanceof VirtualNodeState) {
        return parent.hasPropertyName(id.getName());
      }
    } catch (ItemStateException e) {
      // ignore
    }
    return false;
  }