Init ACL of the node.
@param parent
- a parent, can be null (get item by id)
@param node
- an item data
@return - an item data with ACL was initialized
@throws RepositoryException
543955
private ItemData initACL(NodeData parent, NodeData node) throws RepositoryException
   {
      return initACL(parent, node, null);
   }
1094795
private void initDefinition(NodeData parent) throws RepositoryException, ConstraintViolationException
   {
      if (this.isRoot())
      {
         // root - no parent
         this.definition =
            new NodeDefinitionData(null, null, true, true, OnParentVersionAction.ABORT, true,
               new InternalQName[]{Constants.NT_BASE}, null, false);
         return;
      }

      if (parent == null)
      {
         parent = (NodeData)dataManager.getItemData(getParentIdentifier());
      }

      this.definition =
         session.getWorkspace().getNodeTypesHolder().getChildNodeDefinition(getInternalName(),
            nodeData().getPrimaryTypeName(), parent.getPrimaryTypeName(), parent.getMixinTypeNames());

      if (definition == null)
      {
         throw new ConstraintViolationException("Node definition not found for " + getPath());
      }
   }
821103
public void init(Object parent, Object record)
    {
        super.init(parent, record);
        record = this.getFieldList();   // Created/set in JBaseScreen.init
        this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
        FieldTable table = ((FieldList)record).getTable();
        CalendarModel model = this.getCalendarModel(table);
        ImageIcon backgroundImage = null;
        if (this.getBaseApplet() != null)
        	backgroundImage = this.getBaseApplet().getBackgroundImage();	// Calendar panel is transparent, but this helps with rendering see-thru components 
        CalendarPanel panel = new CalendarPanel(model, true, backgroundImage);
        this.add(panel);
    }
418136
private TreeNode getParentTreeNode(TreeNode child) {
        TreeNode parentTreeNode = parentIndex.get(child);

        if (parentTreeNode == null)
            return null;

        // Makes sure the parent node is still present in the tree
        else if (contains(parentTreeNode.getQueryNode()))
            return parentTreeNode;
        else
            throw new RuntimeException("Internal error: points to a parent that is not (anymore) in the tree");
    }
860695
private Node getMemberResource(final FedoraResource parent) throws RepositoryException {
        final Node membershipResource;

        if (parent.hasProperty(LDP_MEMBER_RESOURCE)) {
            final Property memberResource = getJcrNode(parent).getProperty(LDP_MEMBER_RESOURCE);

            if (REFERENCE_TYPES.contains(memberResource.getType())) {
                membershipResource = nodeConverter().convert(memberResource.getNode()).asNode();
            } else {
                membershipResource = createURI(memberResource.getString());
            }
        } else {
            membershipResource = uriFor(parent);
        }

        return membershipResource;
    }
1124386
public int setParent(Node parent)
    {
        if (parent != null)
        {
            depth = parent.getDepth() + 1;
        }
        this.parent = parent;
        return depth;
    }
1072143
public static <T> T root(TreeDef.Parented<T> treeDef, T node) {
		T lastParent;
		T parent = node;
		do {
			lastParent = parent;
			parent = treeDef.parentOf(lastParent);
		} while (parent != null);
		return lastParent;
	}
388642
public Object visit(QueryRootNode node, Object data) throws RepositoryException {
        StringBuilder sb = (StringBuilder) data;
        node.getLocationNode().accept(this, data);
        InternalQName[] selectProps = node.getSelectProperties();
        if (selectProps.length > 0) {
            sb.append('/');
            boolean union = selectProps.length > 1;
            if (union) {
                sb.append('(');
            }
            String pipe = "";
            for (int i = 0; i < selectProps.length; i++) {
                try {
                    sb.append(pipe);
                    sb.append('@');
                    sb.append(resolver.createJCRName(encode(selectProps[i])).getAsString());
                    pipe = "|";
                } catch (NamespaceException e) {
                    exceptions.add(e);
                }
            }
            if (union) {
                sb.append(')');
            }
        }
        if (node.getOrderNode() != null) {
            node.getOrderNode().accept(this, data);
        }
        return data;
    }
370873
@Override
  protected void visitExprNode(ExprNode node) {

    if (!(node instanceof ParentExprNode)) {
      return;
    }
    ParentExprNode nodeAsParent = (ParentExprNode) node;

    // Recurse.
    visitChildren(nodeAsParent);

    // If all children are constants, we attempt to preevaluate this node and replace it with a
    // constant.
    for (ExprNode child : nodeAsParent.getChildren()) {
      if (!isConstant(child)) {
        return; // cannot preevaluate
      }
    }
    attemptPreeval(nodeAsParent);
  }
62149
public static <T> NamedParameterNode<T> createNamedParameterNode(final Node parent,
                                                                   final Class<? extends Name<T>> clazz,
                                                                   final Type argClass)
      throws ClassHierarchyException {

    Class<?> argRawClass = ReflectionUtilities.getRawClass(argClass);

    final boolean isSet = argRawClass.equals(Set.class);
    final boolean isList = argRawClass.equals(List.class);

    final Type argClazz;

    if (isSet || isList) {
      argClazz = ReflectionUtilities.getInterfaceTarget(Collection.class, argClass);
    } else {
      argClazz = argClass;
    }

    final String simpleName = ReflectionUtilities.getSimpleName(clazz);
    final String fullName = ReflectionUtilities.getFullName(clazz);
    final String fullArgName = ReflectionUtilities.getFullName(argClazz);
    final String simpleArgName = ReflectionUtilities.getSimpleName(argClazz);


    final NamedParameter namedParameter = clazz.getAnnotation(NamedParameter.class);

    if (namedParameter == null) {
      throw new IllegalStateException("Got name without named parameter post-validation!");
    }
    final boolean hasStringDefault, hasClassDefault, hasStringSetDefault, hasClassSetDefault;

    int defaultCount = 0;
    if (namedParameter.default_value().equals(NamedParameter.REEF_UNINITIALIZED_VALUE)) {
      hasStringDefault = false;
    } else {
      hasStringDefault = true;
      defaultCount++;
    }
    if (namedParameter.default_class() != Void.class) {
      hasClassDefault = true;
      defaultCount++;
    } else {
      hasClassDefault = false;
    }
    if (namedParameter.default_values() != null && namedParameter.default_values().length > 0) {
      hasStringSetDefault = true;
      defaultCount++;
    } else {
      hasStringSetDefault = false;
    }
    if (namedParameter.default_classes() != null && namedParameter.default_classes().length > 0) {
      hasClassSetDefault = true;
      defaultCount++;
    } else {
      hasClassSetDefault = false;
    }
    if (defaultCount > 1) {
      throw new ClassHierarchyException("Named parameter " + fullName +
          " defines more than one of default_value, default_class, default_values and default_classes");
    }

    final String[] defaultInstanceAsStrings;

    if (defaultCount == 0) {
      defaultInstanceAsStrings = new String[]{};
    } else if (hasClassDefault) {
      final Class<?> defaultClass = namedParameter.default_class();
      assertIsSubclassOf(clazz, defaultClass, argClazz);
      defaultInstanceAsStrings = new String[]{ReflectionUtilities.getFullName(defaultClass)};
    } else if (hasStringDefault) {
      // Don't know if the string is a class or literal here, so don't bother validating.
      defaultInstanceAsStrings = new String[]{namedParameter.default_value()};
    } else if (hasClassSetDefault) {
      final Class<?>[] clzs = namedParameter.default_classes();
      defaultInstanceAsStrings = new String[clzs.length];
      for (int i = 0; i < clzs.length; i++) {
        assertIsSubclassOf(clazz, clzs[i], argClazz);
        defaultInstanceAsStrings[i] = ReflectionUtilities.getFullName(clzs[i]);
      }
    } else if (hasStringSetDefault) {
      defaultInstanceAsStrings = namedParameter.default_values();
    } else {
      throw new IllegalStateException("The named parameter " + namedParameter.short_name() + " has a default value,"
              + " but the value cannot be retrieved. The defaultCount is " + defaultCount
              + ", but hasClassDefault, hasStringDefault, hasClassSetDefault, hasStringSetDefault"
              + " conditions are all false");
    }

    final String documentation = namedParameter.doc();

    final String shortName = namedParameter.short_name().isEmpty()
        ? null : namedParameter.short_name();

    return new NamedParameterNodeImpl<>(parent, simpleName, fullName,
        fullArgName, simpleArgName, isSet, isList, documentation, shortName, defaultInstanceAsStrings);
  }
440444
void buildEntityJson(ObjectNode parent) {
    for (Element child : this.children) {
      ObjectNode node = child.asEntityJson(parent);

      if (node != null) {
        child.buildEntityJson(node);
      } else {
        child.buildEntityJson(parent);
      }
    }
  }
384637
private NodeData getACL(String identifier, ACLSearch search) throws RepositoryException
   {
      final ItemData item = getItemData(identifier, false);
      return item != null && item.isNode() ? initACL(null, (NodeData)item, search) : null;
   }
254028
protected final void setParentNode(final DiffNode parentNode)
	{
		if (this.parentNode != null && this.parentNode != parentNode)
		{
			throw new IllegalStateException("The parent of a node cannot be changed, once it's set.");
		}
		this.parentNode = parentNode;
	}
271382
public static <T extends HierarchyEntity<T, ?>> void addParent(Collection<T> nodes) {
    addParent(nodes, null);
  }
41829
public void init(Object parent, Object strURL)
    {
        BaseApplet applet = null;
        if (parent instanceof BaseApplet)
            applet = (BaseApplet)parent;
        if (strURL instanceof BaseApplet)
            applet = (BaseApplet)strURL;
        if (applet == null)
            applet = this.getBaseApplet();

        if (strURL == null)
        	if (applet != null)
        		if (applet.getProperty(Params.URL) == null)
        			strURL = "?" + Params.HELP + "=";

        this.setOpaque(false);
        super.init(parent, strURL);

        if (parent instanceof BaseApplet)
        	((BaseApplet)parent).setHelpView(this.getHtmlEditor());
    }
1204968
public NodeData parentData() throws RepositoryException
   {
      checkValid();
      NodeData parent = (NodeData)dataManager.getItemData(getData().getParentIdentifier());
      if (parent == null)
      {
         throw new ItemNotFoundException("FATAL: Parent is null for " + getPath() + " parent UUID: "
            + getData().getParentIdentifier());
      }

      return parent;
   }
527385
public void setParent( IParseTree l )
  {
    if( l != null && !l.contains( this ) && getLength() > 0 )
    {
      throw new IllegalArgumentException( "Attempted set the parent location, but the parent location's area is not a superset of this location's area." );
    }
    if( _pe != null )
    {
      ParsedElement parentElement = (ParsedElement)_pe.getParent();
      if( parentElement != null )
      {
        ParseTree oldParent = parentElement.getLocation();
        if( oldParent != null )
        {
          oldParent._children.remove( this );
        }
      }
      _pe.setParent( l == null ? null : ((ParseTree)l)._pe );
    }
  }