Search in sources :

Example 6 with EntitySchema

use of com.linkedin.restli.restspec.EntitySchema in project rest.li by linkedin.

the class SnapshotGenerator method findModelsAssocation.

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);
        }
    }
}
Also used : AssociationSchema(com.linkedin.restli.restspec.AssociationSchema) RestMethodSchema(com.linkedin.restli.restspec.RestMethodSchema) FinderSchema(com.linkedin.restli.restspec.FinderSchema) EntitySchema(com.linkedin.restli.restspec.EntitySchema) ActionSchema(com.linkedin.restli.restspec.ActionSchema) AssocKeySchema(com.linkedin.restli.restspec.AssocKeySchema)

Example 7 with EntitySchema

use of com.linkedin.restli.restspec.EntitySchema in project rest.li by linkedin.

the class SnapshotGenerator method findModelsSimple.

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);
        }
    }
}
Also used : SimpleSchema(com.linkedin.restli.restspec.SimpleSchema) RestMethodSchema(com.linkedin.restli.restspec.RestMethodSchema) EntitySchema(com.linkedin.restli.restspec.EntitySchema) ActionSchema(com.linkedin.restli.restspec.ActionSchema)

Aggregations

EntitySchema (com.linkedin.restli.restspec.EntitySchema)7 ActionSchema (com.linkedin.restli.restspec.ActionSchema)4 RestMethodSchema (com.linkedin.restli.restspec.RestMethodSchema)3 AssociationSchema (com.linkedin.restli.restspec.AssociationSchema)2 CollectionSchema (com.linkedin.restli.restspec.CollectionSchema)2 FinderSchema (com.linkedin.restli.restspec.FinderSchema)2 DataMap (com.linkedin.data.DataMap)1 ActionSchemaArray (com.linkedin.restli.restspec.ActionSchemaArray)1 AssocKeySchema (com.linkedin.restli.restspec.AssocKeySchema)1 CustomAnnotationContentSchemaMap (com.linkedin.restli.restspec.CustomAnnotationContentSchemaMap)1 IdentifierSchema (com.linkedin.restli.restspec.IdentifierSchema)1 ResourceSchema (com.linkedin.restli.restspec.ResourceSchema)1 ResourceSchemaArray (com.linkedin.restli.restspec.ResourceSchemaArray)1 SimpleSchema (com.linkedin.restli.restspec.SimpleSchema)1