Ejemplo 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());
  }
Ejemplo 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;
  }