Traverses this representer configuration traverser with the given
        visitor.

        :param visitor: :class:`RepresenterConfigVisitorBase` instance.
509180
def run(self, visitor):
        
        attr_option_map = self.__config.get_attribute_options()
        # Sorting the keys results in a depth-first traversal, which is just
        # what we want.
        for (key, key_attr_option_map) in sorted(iteritems_(attr_option_map)):
            if not self.__max_depth is None and len(key) > self.__max_depth:
                continue
            visitor.visit(key, key_attr_option_map)
168054
public void accept(InteractionUnitVisitor visitor)
    {
        visitor.startVisit(this);
        for (InteractionUnit child : children)
        {
            child.accept(visitor);
        }
        visitor.endVisit(this);
    }
678998
public function visit(Visitor $visitor, Generator $generator, $data)
    {
        $contentInfo = $data->contentInfo;

        $generator->startObjectElement('User');

        $generator->startAttribute(
            'href',
            $this->router->generate('ezpublish_rest_loadUser', array('userId' => $contentInfo->id))
        );
        $generator->endAttribute('href');

        $generator->startAttribute('id', $contentInfo->id);
        $generator->endAttribute('id');

        $generator->startAttribute('remoteId', $contentInfo->remoteId);
        $generator->endAttribute('remoteId');

        $visitor->setHeader('Content-Type', $generator->getMediaType('User'));
        $visitor->setHeader('Accept-Patch', $generator->getMediaType('UserUpdate'));

        $generator->startObjectElement('ContentType');

        $generator->startAttribute(
            'href',
            $this->router->generate('ezpublish_rest_loadContentType', array('contentTypeId' => $contentInfo->contentTypeId))
        );
        $generator->endAttribute('href');

        $generator->endObjectElement('ContentType');

        $generator->startValueElement('name', $contentInfo->name);
        $generator->endValueElement('name');

        $generator->startObjectElement('Versions', 'VersionList');
        $generator->startAttribute(
            'href',
            $this->router->generate('ezpublish_rest_loadContentVersions', array('contentId' => $contentInfo->id))
        );
        $generator->endAttribute('href');
        $generator->endObjectElement('Versions');

        $generator->startObjectElement('Section');
        $generator->startAttribute(
            'href',
            $this->router->generate('ezpublish_rest_loadSection', array('sectionId' => $contentInfo->sectionId))
        );
        $generator->endAttribute('href');
        $generator->endObjectElement('Section');

        $generator->startObjectElement('MainLocation', 'Location');
        $generator->startAttribute(
            'href',
            $this->router->generate(
                'ezpublish_rest_loadLocation',
                array('locationPath' => trim($data->mainLocation->pathString, '/'))
            )
        );
        $generator->endAttribute('href');
        $generator->endObjectElement('MainLocation');

        $generator->startObjectElement('Locations', 'LocationList');
        $generator->startAttribute(
            'href',
            $this->router->generate('ezpublish_rest_loadLocationsForContent', array('contentId' => $contentInfo->id))
        );
        $generator->endAttribute('href');
        $generator->endObjectElement('Locations');

        $generator->startObjectElement('Groups', 'UserGroupRefList');
        $generator->startAttribute(
            'href',
            $this->router->generate('ezpublish_rest_loadUserGroupsOfUser', array('userId' => $contentInfo->id))
        );
        $generator->endAttribute('href');
        $generator->endObjectElement('Groups');

        $generator->startObjectElement('Owner', 'User');
        $generator->startAttribute(
            'href',
            $this->router->generate('ezpublish_rest_loadUser', array('userId' => $contentInfo->ownerId))
        );
        $generator->endAttribute('href');
        $generator->endObjectElement('Owner');

        $generator->startValueElement('publishDate', $contentInfo->publishedDate->format('c'));
        $generator->endValueElement('publishDate');

        $generator->startValueElement('lastModificationDate', $contentInfo->modificationDate->format('c'));
        $generator->endValueElement('lastModificationDate');

        $generator->startValueElement('mainLanguageCode', $contentInfo->mainLanguageCode);
        $generator->endValueElement('mainLanguageCode');

        $generator->startValueElement(
            'alwaysAvailable',
            $this->serializeBool($generator, $contentInfo->alwaysAvailable)
        );
        $generator->endValueElement('alwaysAvailable');

        $visitor->visitValueObject(
            new VersionValue(
                $data->content,
                $data->contentType,
                $data->relations
            )
        );

        $generator->startValueElement('login', $data->content->login);
        $generator->endValueElement('login');

        $generator->startValueElement('email', $data->content->email);
        $generator->endValueElement('email');

        $generator->startValueElement(
            'enabled',
            $this->serializeBool($generator, $data->content->enabled)
        );
        $generator->endValueElement('enabled');

        $generator->startObjectElement('UserGroups', 'UserGroupList');
        $generator->startAttribute(
            'href',
            $this->router->generate(
                'ezpublish_rest_loadUserGroupsOfUser',
                array('userId' => $contentInfo->id)
            )
        );
        $generator->endAttribute('href');
        $generator->endObjectElement('UserGroups');

        $generator->startObjectElement('Roles', 'RoleAssignmentList');
        $generator->startAttribute(
            'href',
            $this->router->generate(
                'ezpublish_rest_loadRoleAssignmentsForUser',
                array(
                    'userId' => $contentInfo->id,
                )
            )
        );
        $generator->endAttribute('href');
        $generator->endObjectElement('Roles');

        $generator->endObjectElement('User');
    }
827389
def visitor(klass)
      visitor = visitor_by_module[klass]

      unless visitor
        klass.ancestors.each do |mod|
          visitor = visitor_by_module[mod]

          unless visitor
            visitor = visitor_by_module_name[mod.name]
          end

          if visitor
            visitor_by_module[klass] = visitor

            break
          end
        end
      end

      unless visitor
        raise TypeError,
              "No visitor that handles #{klass} or " \
                    "any of its ancestors (#{klass.ancestors.map(&:name).to_sentence})"
      end

      visitor
    end
134324
public static void walk(final Type one, final Type two, final TypesVisitor visitor) {
        // Use possibly more specific generics (otherwise root class generics would be used as Object and this
        // way it could be used as upper bound)
        // Also, types could contain outer class generics declarations, which must be preserved
        // e.g. (Outer<String>.Inner field).getGenericType() == ParameterizedType with parametrized owner
        // Wrapped into ignore map for very specific case, when type is TypeVariable
        final Map<String, Type> oneKnownGenerics =
                new IgnoreGenericsMap(GenericsResolutionUtils.resolveGenerics(one, IGNORE_VARS));
        final Map<String, Type> twoKnownGenerics =
                new IgnoreGenericsMap(GenericsResolutionUtils.resolveGenerics(two, IGNORE_VARS));
        // Resolve variables mainly to simplify empty wildcards (? extends Object and ? super Object) to Object
        // Still have to pass map because of possibly declared outer class generics. Note that for all
        // types operations ignoring map could be used as we already replaced all variables. These generics
        // are required only for type context building (on some level to resolve comparable type)
        doWalk(GenericsUtils.resolveTypeVariables(one, oneKnownGenerics), oneKnownGenerics,
                GenericsUtils.resolveTypeVariables(two, twoKnownGenerics), twoKnownGenerics, visitor);
    }
12857
public IndexNode visitFirstIndex(Consumer<? super IndexNode> visitor) {
    visitor.accept(this);
    IndexNode refresh = refresh();
    refresh.getChildren().forEach(n -> n.visitFirstIndex(visitor));
    return refresh;
  }
1248163
public void go(EditsVisitor visitor) throws IOException  {
    setEditsLoader(EditsLoader.LoaderFactory.getLoader(visitor));
    editsLoader.loadEdits();
  }
616381
def traverse(element, visitor, context = Visitor::Context.new)
      ns_bindings = namespace_bindings_from_defs(element.namespace_definitions)
      context.ns_stack.push(ns_bindings)

      eelement, eattrs = explode_element(element)

      begin
        visitor.element(context, eelement, eattrs, ns_bindings) do
          element.children.each do |child|
            if child.element?
              traverse(child, visitor, context)
            elsif child.text?
              visitor.text(context, child.content)
            else
              Rsxml.log{|logger| logger.warn("unknown Nokogiri Node type: #{child.inspect}")}
            end
          end
        end
      ensure
        context.ns_stack.pop
      end

      visitor
    end
1049439
public function visit(Visitor $visitor, Generator $generator, $data)
    {
        $fieldDefinitionList = $data;
        $contentType = $fieldDefinitionList->contentType;

        $urlTypeSuffix = $this->getUrlTypeSuffix($contentType->status);

        $generator->startObjectElement('FieldDefinitions', 'FieldDefinitionList');
        $visitor->setHeader('Content-Type', $generator->getMediaType('FieldDefinitionList'));
        //@todo Needs refactoring, disabling certain headers should not be done this way
        $visitor->setHeader('Accept-Patch', false);

        $generator->startAttribute(
            'href',
            $this->router->generate(
                'ezpublish_rest_loadContentType' . $urlTypeSuffix . 'FieldDefinitionList',
                array(
                    'contentTypeId' => $contentType->id,
                )
            )
        );
        $generator->endAttribute('href');

        $generator->startList('FieldDefinition');
        foreach ($fieldDefinitionList->fieldDefinitions as $fieldDefinition) {
            $visitor->visitValueObject(
                new ValuesRestFieldDefinition($contentType, $fieldDefinition)
            );
        }
        $generator->endList('FieldDefinition');

        $generator->endObjectElement('FieldDefinitions');
    }
362065
def get_visitor(self, node):
        
        method = 'visit_' + node.__class__.__name__
        return getattr(self, method, None)
1285970
function traverseBroad(object, visitor) {
        var key, child;

        if (!object) {
            return;
        }

        if (visitor.call(null, object) === false) {
            return false;
        }
        for (key in object) {
            if (object.hasOwnProperty(key)) {
                child = object[key];
                if (typeof child === 'object' && child !== null) {
                    traverseBroad(child, visitor);
                }
            }
        }
    }
1038180
public function visit(Visitor $visitor, Generator $generator, $data)
    {
        $generator->startObjectElement('ObjectStateList');
        $visitor->setHeader('Content-Type', $generator->getMediaType('ObjectStateList'));
        //@todo Needs refactoring, disabling certain headers should not be done this way
        $visitor->setHeader('Accept-Patch', false);

        $generator->startAttribute(
            'href',
            $this->router->generate('ezpublish_rest_loadObjectStates', array('objectStateGroupId' => $data->groupId))
        );

        $generator->endAttribute('href');

        $generator->startList('ObjectState');
        foreach ($data->states as $state) {
            $visitor->visitValueObject(
                new RestObjectStateValue($state, $data->groupId)
            );
        }
        $generator->endList('ObjectState');

        $generator->endObjectElement('ObjectStateList');
    }
1058864
public function visit(NodeVisitorInterface $visitor)
    {
        foreach ($this->children as $child)
        {
            $child->visit($visitor);
        }
    }
1001511
public function visit(Visitor $visitor, Generator $generator, $data)
    {
        $generator->startObjectElement('Relation');
        $visitor->setHeader('Content-Type', $generator->getMediaType('Relation'));

        $generator->startAttribute(
            'href',
            $this->router->generate(
                'ezpublish_rest_loadVersionRelation',
                array(
                    'contentId' => $data->contentId,
                    'versionNumber' => $data->versionNo,
                    'relationId' => $data->relation->id,
                )
            )
        );
        $generator->endAttribute('href');

        $generator->startObjectElement('SourceContent', 'ContentInfo');
        $generator->startAttribute(
            'href',
            $this->router->generate(
                'ezpublish_rest_loadContent',
                array(
                    'contentId' => $data->contentId,
                )
            )
        );
        $generator->endAttribute('href');
        $generator->endObjectElement('SourceContent');

        $generator->startObjectElement('DestinationContent', 'ContentInfo');
        $generator->startAttribute(
            'href',
            $this->router->generate(
                'ezpublish_rest_loadContent',
                array(
                    'contentId' => $data->relation->getDestinationContentInfo()->id,
                )
            )
        );
        $generator->endAttribute('href');
        $generator->endObjectElement('DestinationContent');

        if ($data->relation->sourceFieldDefinitionIdentifier !== null) {
            $generator->startValueElement('SourceFieldDefinitionIdentifier', $data->relation->sourceFieldDefinitionIdentifier);
            $generator->endValueElement('SourceFieldDefinitionIdentifier');
        }

        $generator->startValueElement('RelationType', $this->getRelationTypeString($data->relation->type));
        $generator->endValueElement('RelationType');

        $generator->endObjectElement('Relation');
    }
757663
public function visit(Visitor $visitor, Generator $generator, $data)
    {
        $generator->startObjectElement('RoleAssignment');
        $visitor->setHeader('Content-Type', $generator->getMediaType('RoleAssignment'));

        $roleAssignment = $data->roleAssignment;
        $role = $roleAssignment->getRole();

        $generator->startAttribute(
            'href',
            $this->router->generate(
                'ezpublish_rest_loadRoleAssignmentForUserGroup',
                array(
                    'groupPath' => trim($data->id, '/'),
                    'roleId' => $role->id,
                )
            )
        );
        $generator->endAttribute('href');

        $roleLimitation = $roleAssignment->getRoleLimitation();
        if ($roleLimitation instanceof RoleLimitation) {
            $this->visitLimitation($generator, $roleLimitation);
        }

        $generator->startObjectElement('Role');
        $generator->startAttribute(
            'href',
            $this->router->generate('ezpublish_rest_loadRole', array('roleId' => $role->id))
        );
        $generator->endAttribute('href');
        $generator->endObjectElement('Role');

        $generator->endObjectElement('RoleAssignment');
    }
738672
function traverse(ast) {
    var visitors = flatten(slice.call(arguments, 1));

    estraverse.traverse(ast, {
        enter: function(node) {
            var type = node.type;
            var methodName = type + 'Enter';
            visitorsCall('enter', this, arguments);
            visitorsCall(methodName, this, arguments);
        },
        leave: function(node) {
            var type = node.type;
            var methodName = type + 'Leave';
            visitorsCall('leave', this, arguments);
            visitorsCall(methodName, this, arguments);
        }
    });


    function visitorsCall(methodName, context, args) {
        var callArgs = slice.call(args);
        var callBreak;
        var visitorContext = Object.assign(
            Object.create(context),
            {
                skip: function() {
                    callBreak = true;
                    context.skip();
                },
                break: function() {
                    callBreak = true;
                    context.break();
                }
            }
        );
        visitors.some(function(visitor) {
            var method = visitor[methodName];
            if (method) {
                method.apply(visitorContext, callArgs);
            }
            return callBreak;
        });
    }
}
45363
public final void visit(final Visitor visitor)
	{
		final Visit visit = new Visit();
		try
		{
			visit(visitor, visit);
		}
		catch (final StopVisitationException ignored)
		{
		}
	}