/** * @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); } } }
/** * @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 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); } } }
} else if ("Annotation".equals(jp.getCurrentName())) { jp.nextToken(); property.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
} else if ("Annotation".equals(jp.getCurrentName())) { jp.nextToken(); property.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
/** Check if annotations are added on navigation properties of a structural type * @param structuralType * @param typeName * @param isNavPropAnnotationsCleared * @param annotationGrp */ private void checkAnnotationsOnStructuralNavProperties(CsdlStructuralType structuralType, FullQualifiedName typeName, boolean isNavPropAnnotationsCleared, CsdlAnnotations annotationGrp) { List<CsdlNavigationProperty> navProperties = structuralType.getNavigationProperties(); for (CsdlNavigationProperty navProperty : navProperties) { if (!isNavPropAnnotationsCleared) { structuralType.getNavigationProperty(navProperty.getName()).getAnnotations().clear(); } if (annotationGrp.getTarget().equalsIgnoreCase(typeName + "/" + navProperty.getName())) { addAnnotationsToStructuralTypeNavProperties(structuralType, annotationGrp, navProperty); } } }
/** * * @param singleton * @param entityContainerName2 * @param annotationGrp * @param propertyName * @param isComplexNavPropAnnotationsCleared * @param complexType */ private void addAnnotationsToComplexTypeIncludedFromSingleton(CsdlSingleton singleton, CsdlAnnotations annotationGrp, CsdlProperty propertyName, boolean isComplexNavPropAnnotationsCleared, CsdlComplexType complexType) { for (CsdlNavigationProperty complexNavPropertyName : complexType.getNavigationProperties()) { if (!isComplexNavPropAnnotationsCleared) { complexType.getNavigationProperty(complexNavPropertyName.getName()).getAnnotations().clear(); } if (annotationGrp.getTarget(). equalsIgnoreCase(entityContainerName + "/" + singleton.getName() + "/" + propertyName.getName() + "/" + complexNavPropertyName.getName())) { isSingletonAnnotationsIncluded = true; addAnnotationsToComplexTypeNavProperties(annotationGrp, complexType, complexNavPropertyName); } } }
complexType.getNavigationProperty(complexNavPropertyName.getName()).getAnnotations().clear();
entityType.getNavigationProperty(navPropertyName.getName()).getAnnotations().clear();