Resolves suplied node. Basically returns the node unchanged if
supplied parameter is an instance of NestedModel. Otherwise it will try
to find the node in the database.

@param   NestedModel|int
@return  NestedModel
165728
protected function resolveNode( $model )
	{
		if ( $model instanceof NestedModel )
			return $model->reload();

		return $this->model->newNestedSetQuery()->find( $model );
	}
319554
private Object resolve(FieldData fieldData) {
        Object value;
        if (fieldData.metaData.isThisReference()) {
            // The field is a @This reference
            value = convertThisResourceToFieldType(fieldData);
        } else if (fieldData.metaData.isChildrenAnnotationPresent()) {
            // The field is a collection of @Children
            value = resolveChildren(fieldData);
        } else if (fieldData.metaData.isReference()) {
            // The field is a @Reference
            value = resolveReferenceValueOfField(fieldData);
        } else if (fieldData.metaData.isPropertyType()) {
            // The field points to a property of the resource
            value = resolvePropertyTypedValue(fieldData);
        } else {
            // The field points to another resource
            value = resolveResource(fieldData.path, fieldData.metaData.getType());
        }
        return value;
    }
117078
public ManagementModelNode getSelectedNode() {
        if (tree.getSelectionPath() == null) return null;
        return (ManagementModelNode)tree.getSelectionPath().getLastPathComponent();
    }
1122921
public static Class<?> resolveCaller()
    {
        Class<?> callerClass = null;

        StackTraceElement[] stackTraces = Thread.currentThread().getStackTrace();
        int stackSize = stackTraces.length;

        // StackTrace is below. So check from 3rd element.
        // 1st:java.lang.Thread
        // 2nd:ResourceResolver#resolveCaller(this method)
        for (int stackIndex = 2; stackIndex < stackSize; stackIndex++)
        {
            StackTraceElement stackTrace = stackTraces[stackIndex];
            String callerClassName = stackTrace.getClassName();
            if (StringUtils.equals(ResourceResolver.class.getName(), callerClassName) == false)
            {
                try
                {
                    callerClass = Class.forName(callerClassName);
                    break;
                }
                catch (ClassNotFoundException ex)
                {
                    return null;
                }
            }
        }

        return callerClass;
    }
307713
public function resolvePath()
    {
        $model = $this->getModel();
        $relations = explode('.', $this->getPath());
        $count = count($relations);

        if ($count === 1) {
            return $model;
        }

        foreach ($relations as $relation) {
            if ($count === 1) {
                return $model;
            }

            if ($model->exists && ($value = $model->getAttribute($relation)) instanceof Model) {
                $model = $value;

                $count--;
                continue;
            }

            if (method_exists($model, $relation)) {
                $relation = $model->{$relation}();

                if ($relation instanceof Relation) {
                    $model = $relation->getModel();
                    $count--;
                    continue;
                }
            }

            break;
        }

        throw new LogicException("Can not resolve path for field '{$this->getPath()}'. Probably relation definition is incorrect");
    }
55902
protected int getNextNode()
  {
    if (null != m_exprObj)
    {
      m_lastFetched = m_exprObj.nextNode();
    }
    else
      m_lastFetched = DTM.NULL;

    return m_lastFetched;
  }
874132
private DefaultTreeModel getTreeModel() {
        if (treeModel == null) {
            treeModel = new DefaultTreeModel(getRootNode());
            treeModel.setRoot(getRootNode());
        }
        
        return treeModel;
    }
109613
public AdjacencyMatrix searchSIFGetMatrix(Model model)
	{
		Set<SIFInteraction> sifInts = searchSIF(model);
		return new AdjacencyMatrix(
			SIFInteraction.convertToAdjacencyMatrix(sifInts),
			SIFInteraction.getSortedGeneNames(sifInts));
	}
763394
public function getResolver()/*# : ParameterInterface */
    {
        if (!$this->hasResolver()) {
            throw new NotFoundException(
                Message::get(Message::PARAM_RESOLVER_MISS),
                Message::PARAM_RESOLVER_MISS
            );
        }
        return $this->resolver;
    }
836522
protected SchemaNode resolveSchemaNode(final Map<String, SchemaNode> schemaNodes, final App app, final URI uri) throws FrameworkException {

		// find schema nodes for the given source and target nodes
		final Object source = root.resolveURI(uri);
		if (source != null && source instanceof StructrTypeDefinition) {

			return (SchemaNode)((StructrTypeDefinition)source).getSchemaNode();

		} else {

			if (uri.isAbsolute()) {

				final Class type = StructrApp.resolveSchemaId(uri);
				if (type != null) {

					return schemaNodes.get(type.getSimpleName());
				}
			}
		}

		return null;
	}
1029923
protected function resolve(Node $node)
    {
        $value = null;
        try {
            ++$this->nodeLevel;

            $methodName = $this->getDispatchMethodFor($node);
            if (method_exists($this, $methodName)) {
                $value = $this->$methodName($node);
            }
        } finally {
            --$this->nodeLevel;
        }

        return $value;
    }
1112759
public Node getNode() {
        if (node == null) {
            if (resource != null) {
                node = resource.adaptTo(Node.class);
            }
        }
        return node;
    }
526509
@Override
    public ModelNode resolveValue(ExpressionResolver resolver, ModelNode value) throws OperationFailedException {

        // Pass non-LIST values through the superclass so it can reject weird values and, in the odd chance
        // that's how this object is set up, turn undefined into a default list value.
        ModelNode superResult = value.getType() == ModelType.LIST ? value : super.resolveValue(resolver, value);

        // If it's not a LIST (almost certainly UNDEFINED), then nothing more we can do
        if (superResult.getType() != ModelType.LIST) {
            return superResult;
        }
        // Resolve each element.
        // Don't mess with the original value
        ModelNode clone = superResult == value ? value.clone() : superResult;
        ModelNode result = new ModelNode();
        result.setEmptyList();
        for (ModelNode element : clone.asList()) {
            result.add(valueType.resolveValue(resolver, element));
        }
        // Validate the entire list
        getValidator().validateParameter(getName(), result);
        return result;
    }
926396
public function getBuilder(AbstractModel $model): ?AbstractBuilder {
		if ($model instanceof PhpClass) {
			return $this->classBuilder;
		}

		if ($model instanceof PhpConstant) {
			return $this->constantBuilder;
		}

		if ($model instanceof PhpFunction) {
			return $this->functionBuilder;
		}

		if ($model instanceof PhpInterface) {
			return $this->interfaceBuilder;
		}

		if ($model instanceof PhpMethod) {
			return $this->methodBuilder;
		}

		if ($model instanceof PhpParameter) {
			return $this->parameterBuilder;
		}

		if ($model instanceof PhpProperty) {
			return $this->propertyBuilder;
		}

		if ($model instanceof PhpTrait) {
			return $this->traitBuilder;
		}

		return null;
	}
1066768
public void resolveKeyReference() throws IllegalDataStructureException {
        for (TestClass testClass : rootClassTable.getTestClasses()) {
            resolveTestMethod(testClass);
            resolveTestField(testClass);
            resolveDelegateToTestClass(testClass);
        }
        for (TestClass testClass : subClassTable.getTestClasses()) {
            resolveTestMethod(testClass);
            resolveTestField(testClass);
            resolveDelegateToTestClass(testClass);
        }
        for (TestMethod testMethod : rootMethodTable.getTestMethods()) {
            resolveTestClass(testMethod);
            for (CodeLine codeLine : testMethod.getCodeBody()) {
                resolveKeyReferenceInCode(codeLine.getCode());
            }
        }
        for (TestMethod testMethod : subMethodTable.getTestMethods()) {
            resolveTestClass(testMethod);
            for (CodeLine codeLine : testMethod.getCodeBody()) {
                resolveKeyReferenceInCode(codeLine.getCode());
            }
        }
        for (TestField testField : fieldTable.getTestFields()) {
            resolveTestClass(testField);
        }
    }
920321
function resolveRelations(attrNode, context) {
    if (attrNode.dataSources || attrNode.resource) {
        const parentResource = context.parentResource;
        let childResource = attrNode;

        context.errorContext = getErrorContext(!parentResource ? 'resource' : 'sub-resource', context);

        if (attrNode.resource) {
            if (!context.resourceConfigs[attrNode.resource]) {
                throw new ImplementationError('Unknown resource "' + attrNode.resource + '"' + context.errorContext);
            }
            childResource = context.resourceConfigs[attrNode.resource].config;
        }

        if (parentResource) {
            if (!('parentKey' in attrNode)) throw new ImplementationError('Missing parentKey' + context.errorContext);
            if (!('childKey' in attrNode)) throw new ImplementationError('Missing childKey' + context.errorContext);

            if (attrNode.parentKey === null) {
                attrNode.parentKey = _.cloneDeep(parentResource.primaryKey);
            }
            if (attrNode.childKey === null) {
                attrNode.childKey = _.cloneDeep(childResource.primaryKey);
            }

            if (attrNode.joinVia) {
                const joinViaDataSource = attrNode.dataSources[attrNode.joinVia];
                if (attrNode.parentKey.length !== joinViaDataSource.joinParentKey.length) {
                    throw new ImplementationError(
                        'Composite key length of parentKey (' +
                            attrNode.parentKey.length +
                            ') does not match joinParentKey length (' +
                            joinViaDataSource.joinParentKey.length +
                            ') ' +
                            'of DataSource "' +
                            attrNode.joinVia +
                            '"' +
                            context.errorContext
                    );
                }
                if (attrNode.childKey.length !== joinViaDataSource.joinChildKey.length) {
                    throw new ImplementationError(
                        'Composite key length of childKey (' +
                            attrNode.childKey.length +
                            ') does not match joinChildKey length (' +
                            joinViaDataSource.joinChildKey.length +
                            ') ' +
                            'of DataSource "' +
                            attrNode.joinVia +
                            '"' +
                            context.errorContext
                    );
                }
            } else if (attrNode.parentKey.length !== attrNode.childKey.length) {
                throw new ImplementationError(
                    'Composite key length of parentKey (' +
                        attrNode.parentKey.length +
                        ') does not match childKey length (' +
                        attrNode.childKey.length +
                        ')' +
                        context.errorContext
                );
            }

            const errorContext = context.errorContext;
            context.errorContext = ' in parentKey' + errorContext;
            attrNode.resolvedParentKey = resolveKey(
                attrNode.parentKey,
                parentResource,
                {
                    allowMultiValued: true
                },
                context
            );

            context.errorContext = ' in childKey' + errorContext;
            attrNode.resolvedChildKey = resolveKey(
                attrNode.childKey,
                childResource,
                {
                    neededDataSources: ['primary'],
                    allowMultiValued: false
                },
                context
            );
            context.errorContext = errorContext;
        }

        context.parentResource = attrNode;
    }

    if (attrNode.attributes) {
        Object.keys(attrNode.attributes).forEach(subAttrName => {
            const subAttrNode = attrNode.attributes[subAttrName];
            const subContext = Object.assign({}, context);
            subContext.attrPath = context.attrPath.concat([subAttrName]);

            resolveRelations(subAttrNode, subContext);
        });
    }
}
1160940
SimpleNode getNode() {
        if (this.callerInfoNode != null)
            return this.callerInfoNode;
        if (this.parent != null)
            return this.parent.getNode();
        else
            return null;
    }