Package com.linkedin.restli.restspec

Examples of com.linkedin.restli.restspec.ActionSchemaArray


  private static ActionSchema findCollectionAction(ResourceSchema resourceSchema, String actionName)
  {
    final CollectionSchema collectionSchema = resourceSchema.getCollection();
    if (collectionSchema != null)
    {
      final ActionSchemaArray actions = collectionSchema.getActions();
      if (actions != null)
      {
        for (ActionSchema actionSchema: actions)
        {
          if (actionSchema.getName().equals(actionName))
          {
            return actionSchema;
          }
        }
      }
    }

    final AssociationSchema associationSchema = resourceSchema.getAssociation();
    if (associationSchema != null)
    {
      final ActionSchemaArray actions = associationSchema.getActions();
      if (actions != null)
      {
        for (ActionSchema actionSchema: actions)
        {
          if (actionSchema.getName().equals(actionName))
View Full Code Here


  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

    return null;
  }

  private static ActionSchema findActionInEntity(EntitySchema entitySchema, String actionName)
  {
    final ActionSchemaArray actions = entitySchema.getActions();
    if (actions != null)
    {
      for (ActionSchema actionSchema: actions)
      {
        if (actionSchema.getName().equals(actionName))
View Full Code Here

      CollectionSchema collection = resourceSchema.getCollection();
      _type = ResourceType.COLLECTION;
      _supports = collection.getSupports();
      _methods = collection.hasMethods() ? collection.getMethods() : new RestMethodSchemaArray(0);
      _finders = collection.hasFinders() ? collection.getFinders() : new FinderSchemaArray(0);
      _actions = collection.hasActions() ? collection.getActions() : new ActionSchemaArray(0);
      _entity = collection.getEntity();

    }
    else if(resourceSchema.hasAssociation())
    {
      _type = ResourceType.ASSOCIATION;
      AssociationSchema association = resourceSchema.getAssociation();
      _supports = association.getSupports();
      _methods = association.hasMethods() ? association.getMethods() : new RestMethodSchemaArray(0);
      _finders = association.hasFinders() ? association.getFinders() : new FinderSchemaArray(0);
      _actions = association.hasActions() ? association.getActions() : new ActionSchemaArray(0);
      _entity = association.getEntity();

    }
    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);
    }
    else
    {
      _entityActions = new ActionSchemaArray(0);
    }

    if(_entity != null)
    {
      _subresources = _entity.hasSubresources() ? toRichResourceSchemas(_entity.getSubresources()) : Collections.<RichResourceSchema>emptyList();
View Full Code Here

  }

  @SuppressWarnings({"unchecked", "rawtypes"})
  private ResourceSpec collectionToResourceSpec(ResourceSchema resourceSchema, CollectionSchema collection)
  {
    ActionSchemaArray actions = null, entityActions = null;
    StringArray supports = collection.getSupports();
    if(collection.hasActions())
    {
      actions = collection.getActions();
    }
View Full Code Here

    }
  }

  private ResourceSpec associationToResourceSpec(ResourceSchema resourceSchema, AssociationSchema association)
  {
    ActionSchemaArray actions = null, entityActions = null;
    StringArray supports = association.getSupports();
    if(association.hasActions())
    {
      actions = association.getActions();
    }
View Full Code Here

                             entityActions);
  }

  private ResourceSpec actionSetToResourceSpec(ActionsSetSchema actionsSet)
  {
    ActionSchemaArray actions = null;
    if(actionsSet.hasActions())
    {
      actions = actionsSet.getActions();
    }
    return buildResourceSpec(new StringArray(0),
View Full Code Here

                             null);
  }

  private ResourceSpec simpleToResourceSpec(ResourceSchema resourceSchema, SimpleSchema simple)
  {
    ActionSchemaArray entityActions = null;
    StringArray supports = simple.getSupports();
    if(simple.hasActions())
    {
      entityActions = simple.getActions();
    }
View Full Code Here

TOP

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

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.