for (ConstantExpressionType type:ConstantExpressionType.values()) { if (name.equals(type.name()) && reader.peek().isCharacters()) { CsdlExpression expr = new CsdlConstantExpression(type, elementValue(reader, element));
for (ConstantExpressionType type:ConstantExpressionType.values()) { if (name.equals(type.name()) && reader.peek().isCharacters()) { CsdlExpression expr = new CsdlConstantExpression(type, elementValue(reader, element));
private void readAnnotations(XMLEventReader reader, StartElement element, CsdlAnnotatable edmObject) throws XMLStreamException { if (!parseAnnotations) { return; } final CsdlAnnotation annotation = new CsdlAnnotation(); annotation.setTerm(attr(element, "Term")); for (ConstantExpressionType type:ConstantExpressionType.values()) { if (attr(element, type.name()) != null) { annotation.setExpression(new CsdlConstantExpression( type, attr(element, type.name()))); } } readExpressions(reader, element, annotation); edmObject.getAnnotations().add(annotation); }
private <T> void readAttributeExpressions(StartElement element, T target) throws XMLStreamException { // attribute based expressions for (ConstantExpressionType type:ConstantExpressionType.values()) { if (attr(element, type.name()) != null) { write(target, new CsdlConstantExpression( type, attr(element, type.name()))); } } if (attr(element, "AnnotationPath") != null) { write(target, new CsdlAnnotationPath().setValue(attr(element, "AnnotationPath"))); } if (attr(element, "NavigationPropertyPath") != null) { write(target, new CsdlNavigationPropertyPath() .setValue(attr(element, "NavigationPropertyPath"))); } if (attr(element, "Path") != null) { write(target, new CsdlPath().setValue(attr(element, "Path"))); } if (attr(element, "PropertyPath") != null) { write(target, new CsdlPropertyPath().setValue(attr(element, "PropertyPath"))); } if (attr(element, "UrlRef") != null) { write(target, new CsdlUrlRef().setValue(new CsdlConstantExpression( ConstantExpressionType.String, attr(element, "UrlRef")))); } }
private <T> void readAttributeExpressions(StartElement element, T target) throws XMLStreamException { // attribute based expressions for (ConstantExpressionType type:ConstantExpressionType.values()) { if (attr(element, type.name()) != null) { write(target, new CsdlConstantExpression( type, attr(element, type.name()))); } } if (attr(element, "AnnotationPath") != null) { write(target, new CsdlAnnotationPath().setValue(attr(element, "AnnotationPath"))); } if (attr(element, "NavigationPropertyPath") != null) { write(target, new CsdlNavigationPropertyPath() .setValue(attr(element, "NavigationPropertyPath"))); } if (attr(element, "Path") != null) { write(target, new CsdlPath().setValue(attr(element, "Path"))); } if (attr(element, "PropertyPath") != null) { write(target, new CsdlPropertyPath().setValue(attr(element, "PropertyPath"))); } if (attr(element, "UrlRef") != null) { write(target, new CsdlUrlRef().setValue(new CsdlConstantExpression( ConstantExpressionType.String, attr(element, "UrlRef")))); } }
private void readAnnotations(XMLEventReader reader, StartElement element, CsdlAnnotatable edmObject) throws XMLStreamException { if (!parseAnnotations) { return; } final CsdlAnnotation annotation = new CsdlAnnotation(); annotation.setTerm(attr(element, "Term")); for (ConstantExpressionType type:ConstantExpressionType.values()) { if (attr(element, type.name()) != null) { annotation.setExpression(new CsdlConstantExpression( type, attr(element, type.name()))); } } readExpressions(reader, element, annotation); edmObject.getAnnotations().add(annotation); }