/** * Gets annotation. * * @param term the term * @return the annotation */ public CsdlAnnotation getAnnotation(final String term) { CsdlAnnotation result = null; for (CsdlAnnotation annotation : getAnnotations()) { if (term.equals(annotation.getTerm())) { result = annotation; } } return result; } }
/** * Gets annotation. * * @param term the term * @return the annotation */ public CsdlAnnotation getAnnotation(final String term) { CsdlAnnotation result = null; for (CsdlAnnotation annotation : getAnnotations()) { if (term.equals(annotation.getTerm())) { result = annotation; } } return result; } }
/** * @param structuralType * @param annotationGrp */ private void addAnnotationsToStructuralTypes(CsdlStructuralType structuralType, CsdlAnnotations annotationGrp) { for (CsdlAnnotation annotation : annotationGrp.getAnnotations()) { if (!compareAnnotations(structuralType.getAnnotations(), annotation)) { structuralType.getAnnotations().addAll(annotationGrp.getAnnotations()); } } }
/** * @param entitySet * @param annotationGrp */ private void addAnnotationsToEntitySet(CsdlEntitySet entitySet, CsdlAnnotations annotationGrp) { for (CsdlAnnotation annotation : annotationGrp.getAnnotations()) { if (!compareAnnotations(entitySet.getAnnotations(), annotation)) { entitySet.getAnnotations().add(annotation); } } }
/** Adds annotations to parameters of action * @param action * @param annotationGrp */ private void addAnnotationsToActions(CsdlAction action, CsdlAnnotations annotationGrp) { for (CsdlAnnotation annotation : annotationGrp.getAnnotations()) { if (!compareAnnotations(action.getAnnotations(), annotation)) { action.getAnnotations().add(annotation); } } }
/**Add annotations to functions * @param function * @param annotationGrp */ private void addAnnotationsToFunctions(CsdlFunction function, CsdlAnnotations annotationGrp) { for (CsdlAnnotation annotation : annotationGrp.getAnnotations()) { if (!compareAnnotations(function.getAnnotations(), annotation)) { function.getAnnotations().add(annotation); } } }
/** Adds annotation to singleton * @param singleton * @param annotationGrp */ private void addAnnotationsToSingleton(CsdlSingleton singleton, CsdlAnnotations annotationGrp) { for (CsdlAnnotation annotation : annotationGrp.getAnnotations()) { if (!compareAnnotations(singleton.getAnnotations(), annotation)) { singleton.getAnnotations().add(annotation); } } }
public void addAnnotations(CsdlEntityContainer csdlEntityContainer, FullQualifiedName containerName) { for (CsdlSchema schema : termSchemaDefinition) { List<CsdlAnnotations> annotationGrps = schema.getAnnotationGroups(); for (CsdlAnnotations annotationGrp : annotationGrps) { if (annotationGrp.getTarget().equalsIgnoreCase(containerName.getFullQualifiedNameAsString())) { for (CsdlAnnotation annotation : annotationGrp.getAnnotations()) { if (!compareAnnotations(csdlEntityContainer.getAnnotations(), annotation)) { csdlEntityContainer.getAnnotations().addAll(annotationGrp.getAnnotations()); } } break; } } } }
public void addAnnotations(CsdlEnumType enumType, FullQualifiedName enumName) { for (CsdlSchema schema : termSchemaDefinition) { List<CsdlAnnotations> annotationGrps = schema.getAnnotationGroups(); for (CsdlAnnotations annotationGrp : annotationGrps) { if (annotationGrp.getTarget().equalsIgnoreCase(enumName.getFullQualifiedNameAsString())) { for (CsdlAnnotation annotation : annotationGrp.getAnnotations()) { if (!compareAnnotations(enumType.getAnnotations(), annotation)) { enumType.getAnnotations().addAll(annotationGrp.getAnnotations()); } } break; } } } }
public void addAnnotations(CsdlTypeDefinition typeDefinition, FullQualifiedName typeDefinitionName) { for (CsdlSchema schema : termSchemaDefinition) { List<CsdlAnnotations> annotationGrps = schema.getAnnotationGroups(); for (CsdlAnnotations annotationGrp : annotationGrps) { if (annotationGrp.getTarget().equalsIgnoreCase(typeDefinitionName.getFullQualifiedNameAsString())) { for (CsdlAnnotation annotation : annotationGrp.getAnnotations()) { if (!compareAnnotations(typeDefinition.getAnnotations(), annotation)) { typeDefinition.getAnnotations().addAll(annotationGrp.getAnnotations()); } } break; } } } }
private void addAnnotations(CsdlFunctionImport functionImport, FullQualifiedName entityContainerName) { List<CsdlSchema> termSchemaDefinition = ((EdmProviderImpl)edm).getTermSchemaDefinitions(); for (CsdlSchema schema : termSchemaDefinition) { List<CsdlAnnotations> annotationGrps = schema.getAnnotationGroups(); for (CsdlAnnotations annotationGrp : annotationGrps) { if (annotationGrp.getTarget(). equalsIgnoreCase(entityContainerName + "/" + functionImport.getName())) { for (CsdlAnnotation annotation : annotationGrp.getAnnotations()) { if (!compareAnnotations(functionImport.getAnnotations(), annotation)) { functionImport.getAnnotations().add(annotation); } } break; } } } }
private void addAnnotations(CsdlActionImport actionImport, FullQualifiedName entityContainerName) { List<CsdlSchema> termSchemaDefinition = ((EdmProviderImpl)edm).getTermSchemaDefinitions(); for (CsdlSchema schema : termSchemaDefinition) { List<CsdlAnnotations> annotationGrps = schema.getAnnotationGroups(); for (CsdlAnnotations annotationGrp : annotationGrps) { if (annotationGrp.getTarget(). equalsIgnoreCase(entityContainerName + "/" + actionImport.getName())) { for (CsdlAnnotation annotation : annotationGrp.getAnnotations()) { if (!compareAnnotations(actionImport.getAnnotations(), annotation)) { actionImport.getAnnotations().add(annotation); } } break; } } } }
/** * @param annotationGrp * @param complexType * @param complexNavPropertyName */ private void addAnnotationsToComplexTypeNavProperties(CsdlAnnotations annotationGrp, CsdlComplexType complexType, CsdlNavigationProperty complexNavPropertyName) { for (CsdlAnnotation annotation : annotationGrp.getAnnotations()) { if (!compareAnnotations(complexType.getNavigationProperty( complexNavPropertyName.getName()).getAnnotations(), annotation)) { complexType.getNavigationProperty(complexNavPropertyName.getName()).getAnnotations().add(annotation); } } }
/** Adds annotations to Entity type Navigation Properties derived from entity set * @param annotationGrp * @param entityType * @param navPropertyName */ private void addAnnotationsToEntityTypeNavProperties(CsdlAnnotations annotationGrp, CsdlEntityType entityType, CsdlNavigationProperty navPropertyName) { for (CsdlAnnotation annotation : annotationGrp.getAnnotations()) { if (!compareAnnotations(entityType.getNavigationProperty( navPropertyName.getName()).getAnnotations(), annotation)) { entityType.getNavigationProperty(navPropertyName.getName()).getAnnotations().add(annotation); } } }
/** Adds annotations to Entity type Properties derived from entity set * @param annotationGrp * @param entityType * @param propertyName */ private void addAnnotationsToEntityTypeProperties(CsdlAnnotations annotationGrp, CsdlEntityType entityType, CsdlProperty propertyName) { for (CsdlAnnotation annotation : annotationGrp.getAnnotations()) { if (!compareAnnotations(entityType.getProperty( propertyName.getName()).getAnnotations(), annotation)) { entityType.getProperty(propertyName.getName()).getAnnotations().add(annotation); } } }
/** * @param structuralType * @param annotationGrp * @param property */ private void addAnnotationsToStructuralTypeProperties(CsdlStructuralType structuralType, CsdlAnnotations annotationGrp, CsdlProperty property) { for (CsdlAnnotation annotation : annotationGrp.getAnnotations()) { if (!compareAnnotations(structuralType.getProperty( property.getName()).getAnnotations(), annotation)) { structuralType.getProperty(property.getName()).getAnnotations().add(annotation); } } }
/** * @param annotationGrp * @param complexType * @param complexPropertyName */ private void addAnnotationsToComplexTypeProperties(CsdlAnnotations annotationGrp, CsdlComplexType complexType, CsdlProperty complexPropertyName) { for (CsdlAnnotation annotation : annotationGrp.getAnnotations()) { if (!compareAnnotations(complexType.getProperty( complexPropertyName.getName()).getAnnotations(), annotation)) { complexType.getProperty(complexPropertyName.getName()).getAnnotations().add(annotation); } } }
/** * @param structuralType * @param annotationGrp * @param navProperty */ private void addAnnotationsToStructuralTypeNavProperties(CsdlStructuralType structuralType, CsdlAnnotations annotationGrp, CsdlNavigationProperty navProperty) { for (CsdlAnnotation annotation : annotationGrp.getAnnotations()) { if (!compareAnnotations(structuralType.getNavigationProperty( navProperty.getName()).getAnnotations(), annotation)) { structuralType.getNavigationProperty(navProperty.getName()).getAnnotations(). add(annotation); } } }
/** Adds annotations to actions * @param action * @param actionName * @param annotationGrp */ private void addAnnotationsToParamsOfActions(CsdlAction action, FullQualifiedName actionName, CsdlAnnotations annotationGrp) { final List<CsdlParameter> parameters = action.getParameters(); for (CsdlParameter parameter : parameters) { if (annotationGrp.getTarget().equalsIgnoreCase( actionName.getFullQualifiedNameAsString() + "/" + parameter.getName())) { for (CsdlAnnotation annotation : annotationGrp.getAnnotations()) { if (!compareAnnotations(action.getParameter(parameter.getName()).getAnnotations(), annotation)) { action.getParameter(parameter.getName()).getAnnotations().add(annotation); } } } } }
/** Adds annotations of function parameters * @param function * @param functionName * @param annotationGrp */ private void addAnnotationsToParamsOFunctions(CsdlFunction function, FullQualifiedName functionName, CsdlAnnotations annotationGrp) { final List<CsdlParameter> parameters = function.getParameters(); for (CsdlParameter parameter : parameters) { if (annotationGrp.getTarget().equalsIgnoreCase( functionName.getFullQualifiedNameAsString() + "/" + parameter.getName())) { for (CsdlAnnotation annotation : annotationGrp.getAnnotations()) { if (!compareAnnotations(function.getParameter(parameter.getName()).getAnnotations(), annotation)) { function.getParameter(parameter.getName()).getAnnotations().add(annotation); } } } } }