Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
     Copyright (c) 2012 LinkedIn Corp.
  
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
  
         http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
 */
 
 package com.linkedin.restli.docgen;
 
 import java.util.List;

Visits various features of a REST resource hierarchy. The hierarchy is formed from disparate resource types, each of which has common method types, such as rest methods, finders and actions.

Author(s):
dellamag
 
 public interface ResourceSchemaVisitior
 {
  
Callback function when the visitor visits a com.linkedin.restli.restspec.ResourceSchema.

Parameters:
visitContext hierarchy of all parent resource schemas (root is the first element)
resourceSchema resource being visited
 
   void visitResourceSchema(VisitContext visitContext,
                            ResourceSchema resourceSchema);

  
Callback function when the visitor visits a com.linkedin.restli.restspec.CollectionSchema.

Parameters:
visitContext hierarchy of all parent resource schemas (root is the first element)
collectionSchema collection being visited
 
   void visitCollectionResource(VisitContext visitContext,
                                CollectionSchema collectionSchema);

  
Callback function when the visitor visits a com.linkedin.restli.restspec.AssociationSchema.

Parameters:
visitContext hierarchy of all parent resource schemas (root is the first element)
associationSchema association being visited
 
   void visitAssociationResource(VisitContext visitContext,
                                 AssociationSchema associationSchema);

  
Callback function when the visitor visits a com.linkedin.restli.restspec.SimpleSchema.

Parameters:
visitContext hierarchy of all parent resource schemas (root is the first element)
simpleSchema simple being visited
 
   void visitSimpleResource(VisitContext visitContextSimpleSchema simpleSchema);

  
Callback function when the visitor visits a com.linkedin.restli.restspec.ActionsSetSchema.

Parameters:
visitContext hierarchy of all parent resource schemas (root is the first element)
actionSetSchema action set being visited
 
   void visitActionSetResource(VisitContext visitContext,
                               ActionsSetSchema actionSetSchema);

  
Callback function when the visitor visits a com.linkedin.restli.restspec.EntitySchema.

Parameters:
visitContext hierarchy of all parent resource schemas (root is the first element)
entitySchema entity being visited
 
   void visitEntityResource(VisitContext visitContext,
                            EntitySchema entitySchema);

  
Callback function when the visitor visits a com.linkedin.restli.restspec.RestMethodSchema.

Parameters:
visitContext hierarchy of all parent resource schemas (root is the first element)
parentResource can be any of com.linkedin.restli.restspec.CollectionSchema, com.linkedin.restli.restspec.ActionsSetSchema or com.linkedin.restli.restspec.EntitySchema
restMethodSchema REST method being visited, e.g. GET, POST, BATCH_GET, etc
  void visitRestMethod(VisitContext visitContext,
                       RecordTemplate parentResource,
                       RestMethodSchema restMethodSchema);

  
Callback function when the visitor visits a com.linkedin.restli.restspec.FinderSchema.

Parameters:
visitContext hierarchy of all parent resource schemas (root is the first element)
parentResource can be any of com.linkedin.restli.restspec.CollectionSchema, com.linkedin.restli.restspec.ActionsSetSchema or com.linkedin.restli.restspec.EntitySchema
finderSchema finder being visited
  void visitFinder(VisitContext visitContext,
                   RecordTemplate parentResource,
                   FinderSchema finderSchema);

  
Callback function when the visitor visits a com.linkedin.restli.restspec.ActionSchema.

Parameters:
visitContext hierarchy of all parent resource schemas (root is the first element)
parentResource can be any of com.linkedin.restli.restspec.CollectionSchema, com.linkedin.restli.restspec.ActionsSetSchema or com.linkedin.restli.restspec.EntitySchema
resourceLevel com.linkedin.restli.server.ResourceLevel of the action
actionSchema action being visited
  void visitAction(VisitContext visitContext,
                   RecordTemplate parentResource,
                   ResourceLevel resourceLevel,
                   ActionSchema actionSchema);

  
Callback function when the visitor visits a com.linkedin.restli.restspec.ParameterSchema.

Parameters:
visitContext hierarchy of all parent resource schemas (root is the first element)
parentResource can be any of com.linkedin.restli.restspec.CollectionSchema, com.linkedin.restli.restspec.ActionsSetSchema or com.linkedin.restli.restspec.EntitySchema
parentMethodSchema can be any of com.linkedin.restli.restspec.RestMethodSchema, com.linkedin.restli.restspec.ActionSchema or com.linkedin.restli.restspec.FinderSchema
parameterSchema parameter to be visited
  void visitParameter(VisitContext visitContext,
                      RecordTemplate parentResource,
                      Object parentMethodSchema,
                      ParameterSchema parameterSchema);

  
Context data passed between visit callbacks.
  static class VisitContext
  {
    

Parameters:
resourceSchemaHierarchy list of com.linkedin.restli.restspec.ResourceSchema that the visitor has traversed
resourcePath path of the resource
    public VisitContext(List<ResourceSchemaresourceSchemaHierarchy,
                        String resourcePath)
    {
       = resourceSchemaHierarchy;
       = resourcePath;
    }

    

Returns:
list of com.linkedin.restli.restspec.ResourceSchema that the visitor has traversed
    {
      return ;
    }

    

Returns:
path of the resource
    public String getResourcePath()
    {
      return ;
    }

    

Returns:
the most recently visited com.linkedin.restli.restspec.ResourceSchema
    {
    }
    private final String _resourcePath;
  }
New to GrepCode? Check out our FAQ X