Package com.linkedin.restli.restspec

Examples of com.linkedin.restli.restspec.SimpleSchema


    }
  }

  private void findModelsSimple(ResourceSchema resourceSchema, Map<String, NamedDataSchema> foundTypes, List<NamedDataSchema> typeOrder)
  {
    SimpleSchema simple = resourceSchema.getSimple();
    if (simple != null)
    {
      if (simple.hasMethods())
      {
        for (RestMethodSchema restMethodSchema : simple.getMethods())
        {
          findModelsMethod(restMethodSchema, foundTypes, typeOrder);
        }
      }
      if (simple.hasActions())
      {
        for (ActionSchema actionSchema : simple.getActions())
        {
          findModelsAction(actionSchema, foundTypes, typeOrder);
        }
      }
      if (simple.hasEntity())
      {
        EntitySchema entity = simple.getEntity();
        findModelsEntity(entity, foundTypes, typeOrder);
      }
    }
  }
View Full Code Here


      pathToAssocKeys.put(keyName, assocKeys);
    }
    else if (resource.getSimple() != null)
    {
      resourceSchemaClass = SimpleSchema.class;
      SimpleSchema simpleSchema = resource.getSimple();
      keyClass = _voidClass;
      supportsList = simpleSchema.getSupports();
      restMethods = simpleSchema.getMethods();
      subresources = simpleSchema.getEntity().getSubresources();
      resourceActions = simpleSchema.getActions();
    }
    else if (resource.getActionsSet() != null)
    {
      resourceSchemaClass = ActionsSetSchema.class;
      ActionsSetSchema actionsSet = resource.getActionsSet();
View Full Code Here

      processEntitySchema(visitor, context, associationSchema.getEntity());
    }
    else if (resourceSchema.hasSimple())
    {
      final SimpleSchema simpleSchema = resourceSchema.getSimple();
      visitor.visitSimpleResource(context, simpleSchema);

      processRestMethods(visitor, context, simpleSchema, simpleSchema.getMethods());
      processActions(visitor, context, simpleSchema, simpleSchema.getActions());

      processEntitySchema(visitor, context, simpleSchema.getEntity());
    }
    else if (resourceSchema.hasActionsSet())
    {
      final ActionsSetSchema actionsSet = resourceSchema.getActionsSet();
      visitor.visitActionSetResource(context, actionsSet);
View Full Code Here

  private void appendSimple(ResourceSchema resourceSchema, ResourceModel resourceModel)
  {
    appendCommon(resourceModel, resourceSchema);

    SimpleSchema simpleSchema = new SimpleSchema();

    appendSupportsNodeToSimpleSchema(simpleSchema, resourceModel);
    appendMethodsToSimpleSchema(simpleSchema, resourceModel);

    ActionSchemaArray actions = createActions(resourceModel, ResourceLevel.ENTITY);
    if (actions.size() > 0)
    {
      simpleSchema.setActions(actions);
    }

    appendEntityToSimpleSchema(simpleSchema, resourceModel);

    resourceSchema.setSimple(simpleSchema);
View Full Code Here

    if (associationSchema != null)
    {
      methods = associationSchema.getMethods();
    }

    final SimpleSchema simpleSchema = resourceSchema.getSimple();
    if (simpleSchema != null)
    {
      methods = simpleSchema.getMethods();
    }

    if (methods != null)
    {
      for (RestMethodSchema restMethodSchema: methods)
View Full Code Here

    return null;
  }

  private static ActionSchema findSimpleResourceAction(ResourceSchema resourceSchema, String actionName)
  {
    final SimpleSchema simpleSchema = resourceSchema.getSimple();
    if (simpleSchema != null)
    {
      final ActionSchemaArray actions = simpleSchema.getActions();
      if (actions != null)
      {
        for (ActionSchema actionSchema: actions)
        {
          if (actionSchema.getName().equals(actionName))
View Full Code Here

    }
    else if(resourceSchema.hasSimple())
    {
      _type = ResourceType.SIMPLE;
      SimpleSchema simple = resourceSchema.getSimple();
      _supports = simple.getSupports();
      _methods = simple.hasMethods() ? simple.getMethods() : new RestMethodSchemaArray(0);
      _finders = new FinderSchemaArray(0);
      _actions = new ActionSchemaArray(0);
      _entity = simple.getEntity();
    }
    else if(resourceSchema.hasActionsSet())
    {
      _type = ResourceType.ACTION_SET;
      ActionsSetSchema actionSet = resourceSchema.getActionsSet();
      _supports = new StringArray(0);
      _methods = new RestMethodSchemaArray(0);
      _finders = new FinderSchemaArray(0);;
      _actions = actionSet.hasActions() ? actionSet.getActions() : new ActionSchemaArray(0);
      _entity = null;
    }
    else
    {
      throw new IllegalArgumentException("Invalid resourceSchema, must be one of: " + EnumSet.allOf(ResourceType.class));
    }

    if(resourceSchema.hasSimple())
    {
      SimpleSchema simple = resourceSchema.getSimple();
      _entityActions = simple.hasActions() ? simple.getActions() : new ActionSchemaArray(0);
    }
    else if(_entity != null)
    {
      _entityActions = _entity.hasActions() ? _entity.getActions() : new ActionSchemaArray(0);
    }
View Full Code Here

      ActionsSetSchema actionsSet = resourceSchema.getActionsSet();
      return actionSetToResourceSpec(actionsSet);
    }
    else if(resourceSchema.hasSimple())
    {
      SimpleSchema simple = resourceSchema.getSimple();
      return simpleToResourceSpec(resourceSchema, simple);
    }
    else
    {
      throw new IllegalStateException("ResourceSchema does not have any of the recognized types (collection, association, actionSet, simple), exactly one is required.");
View Full Code Here

TOP

Related Classes of com.linkedin.restli.restspec.SimpleSchema

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.