Package com.linkedin.restli.restspec

Examples of com.linkedin.restli.restspec.AssociationSchema


    }
  }

  private void findModelsAssocation(ResourceSchema resourceSchema, Map<String, NamedDataSchema> foundTypes, List<NamedDataSchema> typeOrder)
  {
    AssociationSchema association = resourceSchema.getAssociation();
    if (association != null)
    {
      for (AssocKeySchema assocKeySchema : association.getAssocKeys())
      {
        String type = assocKeySchema.getType();
        recordType(type, foundTypes, typeOrder);
      }
      if (association.hasFinders())
      {
        for (FinderSchema restMethodSchema: association.getFinders())
        {
          findModelsFinder(restMethodSchema, foundTypes, typeOrder);
        }
      }
      if (association.hasMethods())
      {
        for (RestMethodSchema restMethodSchema: association.getMethods())
        {
          findModelsMethod(restMethodSchema, foundTypes, typeOrder);
        }
      }
      if (association.hasActions())
      {
        for (ActionSchema actionSchema : association.getActions())
        {
          findModelsAction(actionSchema, foundTypes, typeOrder);
        }
      }
      if (association.hasEntity())
      {
        EntitySchema entitySchema = association.getEntity();
        findModelsEntity(entitySchema, foundTypes, typeOrder);
      }
    }
  }
View Full Code Here


      entityActions = collection.getEntity().getActions();
    }
    else if (resource.getAssociation() != null)
    {
      resourceSchemaClass = AssociationSchema.class;
      AssociationSchema association = resource.getAssociation();
      keyClass = getCodeModel().ref(CompoundKey.class);
      supportsList = association.getSupports();
      restMethods = association.getMethods();
      finders = association.getFinders();
      subresources = association.getEntity().getSubresources();
      resourceActions = association.getActions();
      entityActions = association.getEntity().getActions();

      assocKeyTypeInfos = generateAssociationKey(facadeClass, association);

      String keyName = getAssociationKey(resource, association);
      pathKeyTypes.put(keyName, keyClass);
View Full Code Here

      processEntitySchema(visitor, context, collectionSchema.getEntity());
    }
    else if (resourceSchema.hasAssociation())
    {
      final AssociationSchema associationSchema = resourceSchema.getAssociation();
      visitor.visitAssociationResource(context, associationSchema);

      processRestMethods(visitor, context, associationSchema, associationSchema.getMethods());
      processFinders(visitor, context, associationSchema, associationSchema.getFinders());
      processActions(visitor, context, associationSchema, associationSchema.getActions());

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

    CollectionSchema collectionSchema = new CollectionSchema();
    //HACK: AssociationSchema and CollectionSchema share many common elements, but have no inheritance
    //relationship.  Here, we construct them both as facades on the same DataMap, which allows
    //us to pass strongly typed CollectionSchema objects around, even when we're dealing with
    //an association.
    AssociationSchema associationSchema = new AssociationSchema(collectionSchema.data());

    if (collectionModel.getKeys().size() == 1)
    {
      appendIdentifierNode(collectionSchema, collectionModel);
    }
View Full Code Here

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

    final AssociationSchema associationSchema = resourceSchema.getAssociation();
    if (associationSchema != null)
    {
      methods = associationSchema.getMethods();
    }

    final SimpleSchema simpleSchema = resourceSchema.getSimple();
    if (simpleSchema != null)
    {
View Full Code Here

          }
        }
      }
    }

    final AssociationSchema associationSchema = resourceSchema.getAssociation();
    if (associationSchema != null)
    {
      final FinderSchemaArray finders = associationSchema.getFinders();
      if (finders != null)
      {
        for (FinderSchema finderSchema: finders)
        {
          if (finderSchema.getName().equals(finderName))
View Full Code Here

          }
        }
      }
    }

    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

          return actionSchema;
        }
      }
    }

    final AssociationSchema associationSchema = resourceSchema.getAssociation();
    if (associationSchema != null)
    {
      final EntitySchema entity = associationSchema.getEntity();
      if (entity != null)
      {
        actionSchema = findActionInEntity(entity, actionName);
        if (actionSchema != null)
        {
View Full Code Here

    }
    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;
View Full Code Here

      CollectionSchema collection = resourceSchema.getCollection();
      return collectionToResourceSpec(resourceSchema, collection);
    }
    else if(resourceSchema.hasAssociation())
    {
      AssociationSchema association = resourceSchema.getAssociation();
      return associationToResourceSpec(resourceSchema, association);
    }
    else if(resourceSchema.hasActionsSet())
    {
      ActionsSetSchema actionsSet = resourceSchema.getActionsSet();
View Full Code Here

TOP

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

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.