Check if a property definition is a reference property
@param node the given node
@param propertyName the property name
@return whether a property definition is a reference property
@throws RepositoryException if repository exception occurred
172069
public static boolean isReferenceProperty(final Node node, final String propertyName) throws RepositoryException {
        final Optional<PropertyDefinition> propertyDefinition = getDefinitionForPropertyName(node, propertyName);

        return propertyDefinition.isPresent() &&
                (propertyDefinition.get().getRequiredType() == REFERENCE
                        || propertyDefinition.get().getRequiredType() == WEAKREFERENCE);
    }
758184
protected boolean isIndexed(InternalQName propertyName)
   {
      if (indexingConfig == null)
      {
         return true;
      }
      else
      {
         return indexingConfig.isIndexed(node, propertyName);
      }
   }
1284977
public static boolean hasMixin(final Node node) {
        try {
            return node.isNodeType(FEDORA_TIME_MAP);
        } catch (final RepositoryException e) {
            throw new RepositoryRuntimeException(e);
        }
    }
1145669
def parse_property_reference(self, tup_tree):
        

        self.check_node(tup_tree, 'PROPERTY.REFERENCE', ('NAME',),
                        ('REFERENCECLASS', 'CLASSORIGIN', 'PROPAGATED'),
                        ('QUALIFIER', 'VALUE.REFERENCE'))

        value = self.list_of_matching(tup_tree, ('VALUE.REFERENCE',))

        if not value:
            value = None
        elif len(value) == 1:
            value = value[0]
        else:
            raise CIMXMLParseError(
                _format("Element {0!A} has more than one child element "
                        "'VALUE.REFERENCE' (allowed are zero or one)",
                        name(tup_tree)),
                conn_id=self.conn_id)

        attrl = attrs(tup_tree)

        qualifiers = self.list_of_matching(tup_tree, ('QUALIFIER',))

        pref = CIMProperty(attrl['NAME'],
                           value,
                           type='reference',
                           is_array=False,
                           qualifiers=qualifiers,
                           reference_class=attrl.get('REFERENCECLASS', None),
                           class_origin=attrl.get('CLASSORIGIN', None),
                           propagated=self.unpack_boolean(
                               attrl.get('PROPAGATED', 'false')),
                           embedded_object=False)

        return pref
1074441
private static Long getNodePropertySize(final Node node)
        throws RepositoryException {
        Long size = 0L;
        for (final PropertyIterator i = node.getProperties(); i.hasNext();) {
            final Property p = i.nextProperty();
            if (p.isMultiple()) {
                for (final Value v : p.getValues()) {
                    size += v.getBinary().getSize();
                }
            } else {
                size += p.getBinary().getSize();
            }
        }
        return size;
    }
1178839
function (propertyName) {
        if (!ariaUtilsType.isString(propertyName)) {
            return true;
        }

        // which property names are included for back references
        return (propertyName != jsonUtils.OBJECT_PARENT_PROPERTY &&
            propertyName.substr(0, jsonUtils.META_FOR_LISTENERS.length) != jsonUtils.META_FOR_LISTENERS &&
            propertyName.substr(0, jsonUtils.META_FOR_RECLISTENERS.length) != jsonUtils.META_FOR_RECLISTENERS);
    }
223099
private void endNode() throws RepositoryException
   {
      ImportNodeData currentNodeInfo = (ImportNodeData)tree.pop();

      NodePropertiesInfo currentNodePropertiesInfo = mapNodePropertiesInfo.get(currentNodeInfo.getIdentifier());

      if (currentNodePropertiesInfo != null)
      {
         checkProperties(currentNodePropertiesInfo);
      }

      mapNodePropertiesInfo.remove(currentNodeInfo.getIdentifier());

      currentNodeInfo.setMixinTypeNames(currentNodeInfo.getMixinTypeNames());

      if (currentNodeInfo.isMixVersionable())
      {
         createVersionHistory(currentNodeInfo);
      }

      currentNodeInfo.setACL(ACLInitializationHelper.initAcl(currentNodeInfo.getACL(), currentNodeInfo.getExoOwner(),
         currentNodeInfo.getExoPrivileges()));
   }
544256
public static void assertPrimaryNodeType(final Node node, final String nodeType) throws RepositoryException {
        final NodeType primaryNodeType = node.getPrimaryNodeType();
        assertEquals(nodeType, primaryNodeType.getName());
    }
1045685
public static boolean hasMixin(final Node node) {
        try {
            return node.isNodeType(FEDORA_TOMBSTONE);
        } catch (final RepositoryException e) {
            throw new RepositoryRuntimeException(e);
        }
    }
759785
protected void doMerge(NodeData mergeNode) throws RepositoryException
   {
      // let n' be the corresponding node of n in ws'.
      // find corr node for this node
      NodeData corrNode = getCorrNodeData(mergeNode);
      if (corrNode != null)
      {

         NodeData mergeVersion = getBaseVersionData(mergeNode, mergeSession);

         if (mergeVersion != null)
         {

            NodeData corrVersion = getBaseVersionData(corrNode, corrSession);

            if (corrVersion != null)
            {
               // let v be base version of n.
               // let v' be base version of n'.

               SessionDataManager mergeDataManager = mergeSession.getTransientNodesManager();

               PropertyData isCheckedOutProperty =
                  (PropertyData)mergeDataManager.getItemData(mergeNode, new QPathEntry(Constants.JCR_ISCHECKEDOUT, 0),
                     ItemType.PROPERTY);

               if (!ValueDataUtil.getBoolean(isCheckedOutProperty.getValues().get(0))
                  && isSuccessor(mergeVersion, corrVersion))
               {
                  // if v' is a successor of v and
                  // n is not checked-in doupdate(n, n').
                  doUpdate(mergeNode, corrNode);
               }
               else if (mergeVersion.getQPath().equals(corrVersion.getQPath())
                  || isPredecessor(mergeVersion, corrVersion))
               {
                  // else if v is equal to or a predecessor of v' doleave(n).
                  doLeave(mergeNode);
               }
               else
               {
                  // else dofail(n, v').
                  doFail(mergeNode, corrVersion);
               }
            }
            else
            {
               // else if n' is not versionable doleave(n)
               doLeave(mergeNode);
            }
         }
         else
         {
            // else if n is not versionable doupdate(n, n')
            doUpdate(mergeNode, corrNode);
         }
      }
      else
      {
         // if no such n' doleave(n).
         doLeave(mergeNode);
      }
   }
826528
private HierarchicalProperty getProperty(Node node, QName name) throws PathNotFoundException, RepositoryException
   {
      Property property = node.getProperty(WebDavNamespaceContext.createName(name));
      String propertyValue;
      if (property.getDefinition().isMultiple())
      {
         if (property.getValues().length >= 1)
         {
            propertyValue = property.getValues()[0].getString();
         }
         else
         {
            // this means that we return empty value, because according to WebDAV spec:
            // this is a property whose semantics and syntax are not enforced by the server
            // the server only records the value of a dead property;
            // the client is responsible for maintaining the consistency of the syntax and semantics of a dead property. 
            propertyValue = "";
         }
      }
      else
      {
         propertyValue = property.getString();
      }
      return new HierarchicalProperty(name, propertyValue);
   }
328445
function(node) {
      var i;
      var j;
      var k;
      var l;
      var componentName;
      var componentNode;
      // Get the component path
      var componentPath = [];
      while (node) {
        if (node.property && node.property.type === 'Identifier') {
          componentPath.push(node.property.name);
        }
        if (node.object && node.object.type === 'Identifier') {
          componentPath.push(node.object.name);
        }
        node = node.object;
      }
      componentPath.reverse();
      componentName = componentPath.slice(0, componentPath.length - 1).join('.');

      // Find the variable in the current scope
      var variableName = componentPath.shift();
      if (!variableName) {
        return null;
      }
      var variableInScope;
      var variables = variableUtil.variablesInScope(context);
      for (i = 0, j = variables.length; i < j; i++) {
        if (variables[i].name === variableName) {
          variableInScope = variables[i];
          break;
        }
      }
      if (!variableInScope) {
        return null;
      }

      // Try to find the component using variable references
      var refs = variableInScope.references;
      var refId;
      for (i = 0, j = refs.length; i < j; i++) {
        refId = refs[i].identifier;
        if (refId.parent && refId.parent.type === 'MemberExpression') {
          refId = refId.parent;
        }
        if (sourceCode.getText(refId) !== componentName) {
          continue;
        }
        if (refId.type === 'MemberExpression') {
          componentNode = refId.parent.right;
        } else if (refId.parent && refId.parent.type === 'VariableDeclarator') {
          componentNode = refId.parent.init;
        }
        break;
      }

      if (componentNode) {
        // Return the component
        return components.add(componentNode, 1);
      }

      // Try to find the component using variable declarations
      var defInScope;
      var defs = variableInScope.defs;
      for (i = 0, j = defs.length; i < j; i++) {
        if (defs[i].type === 'ClassName' || defs[i].type === 'FunctionName' || defs[i].type === 'Variable') {
          defInScope = defs[i];
          break;
        }
      }
      if (!defInScope || !defInScope.node) {
        return null;
      }
      componentNode = defInScope.node.init || defInScope.node;

      // Traverse the node properties to the component declaration
      for (i = 0, j = componentPath.length; i < j; i++) {
        if (!componentNode.properties) {
          continue;
        }
        for (k = 0, l = componentNode.properties.length; k < l; k++) {
          if (componentNode.properties[k].key.name === componentPath[i]) {
            componentNode = componentNode.properties[k];
            break;
          }
        }
        if (!componentNode || !componentNode.value) {
          return null;
        }
        componentNode = componentNode.value;
      }

      // Return the component
      return components.add(componentNode, 1);
    }
1182946
public PropertyDefinitionDatas getPropertyDefinitions(final InternalQName propertyName,
      final InternalQName primaryNodeType, final InternalQName[] mixinTypes) throws RepositoryException
   {

      if (mixinTypes != null)
      {
         final InternalQName[] nts = new InternalQName[mixinTypes.length + 1];
         nts[0] = primaryNodeType;

         System.arraycopy(mixinTypes, 0, nts, 1, mixinTypes.length);

         return getPropertyDefinitions(propertyName, nts);
      }

      return getPropertyDefinitions(propertyName, primaryNodeType);
   }
942902
@Override
    public void metaPropertyDefine(String propertyName, Class<?> propertyType) {
        bean.propertyDefine(propertyName, propertyType);
    }
517306
public void addReference(final String propertyName, final Collection<BeanId> refs) {
        Preconditions.checkNotNull(refs);
        Preconditions.checkNotNull(propertyName);
        checkCircularReference(refs.toArray(new BeanId[refs.size()]));
        List<BeanId> list = references.get(propertyName);
        if (list == null) {
            list = new ArrayList<>();
            list.addAll(refs);
            references.put(propertyName, list);
        } else {
            list.addAll(refs);
        }
    }
519741
function hasProperty(node, name) {
  var props
  var value

  if (!node || !name || typeof node !== 'object' || node.type !== 'element') {
    return false
  }

  props = node.properties
  value = props && own.call(props, name) && props[name]

  return value !== null && value !== undefined && value !== false
}
1315763
public static void assertMixinNodeType(final Node node, final String mixinType) throws RepositoryException {
        for (final NodeType nt : node.getMixinNodeTypes()) {
            if (mixinType.equals(nt.getName())) {
                return;
            }
        }
        fail("Node " + node.getPath() + " has no mixin type " + mixinType);
    }