private Property readSimpleProperty(final XMLStreamReader reader, final FullQualifiedName fqName) throws XMLStreamException { SimpleProperty property = new SimpleProperty(); property.setName(reader.getAttributeValue(null, XmlMetadataConstants.EDM_NAME)); property.setType(EdmSimpleTypeKind.valueOf(fqName.getName())); return property; }
private Property readSimpleProperty(final XMLStreamReader reader, final FullQualifiedName fqName) throws XMLStreamException { SimpleProperty property = new SimpleProperty(); property.setName(reader.getAttributeValue(null, XmlMetadataConstants.EDM_NAME)); property.setType(EdmSimpleTypeKind.valueOf(fqName.getName())); return property; }
private Property readSimpleProperty(final XMLStreamReader reader, final FullQualifiedName fqName) throws XMLStreamException { SimpleProperty property = new SimpleProperty(); property.setName(reader.getAttributeValue(null, XmlMetadataConstants.EDM_NAME)); property.setType(EdmSimpleTypeKind.valueOf(fqName.getName())); return property; }
private Object formatValue(EdmSimpleType type , LiteralExpression literal) throws EdmException{ EdmSimpleTypeKind typeKind = EdmSimpleTypeKind.valueOf(type.getName()); String value = literal.getUriLiteral().toString(); EdmSimpleType instance = typeKind.getEdmSimpleTypeInstance();
private FunctionImportParameter readFunctionImportParameter(final XMLStreamReader reader) throws EntityProviderException, XMLStreamException { reader.require(XMLStreamConstants.START_ELEMENT, edmNamespace, XmlMetadataConstants.EDM_FUNCTION_PARAMETER); FunctionImportParameter functionParameter = new FunctionImportParameter(); List<AnnotationElement> annotationElements = new ArrayList<AnnotationElement>(); functionParameter.setName(reader.getAttributeValue(null, XmlMetadataConstants.EDM_NAME)); functionParameter.setMode(reader.getAttributeValue(null, XmlMetadataConstants.EDM_FUNCTION_PARAMETER_MODE)); String type = reader.getAttributeValue(null, XmlMetadataConstants.EDM_TYPE); if (type == null) { throw new EntityProviderException(EntityProviderException.MISSING_ATTRIBUTE .addContent(XmlMetadataConstants.EDM_TYPE).addContent(XmlMetadataConstants.EDM_FUNCTION_PARAMETER)); } functionParameter.setType(EdmSimpleTypeKind.valueOf(extractFQName(type).getName())); functionParameter.setFacets(readFacets(reader)); functionParameter.setAnnotationAttributes(readAnnotationAttribute(reader)); while (reader.hasNext() && !(reader.isEndElement() && edmNamespace.equals(reader.getNamespaceURI()) && XmlMetadataConstants.EDM_FUNCTION_PARAMETER.equals(reader.getLocalName()))) { reader.next(); if (reader.isStartElement()) { extractNamespaces(reader); annotationElements.add(readAnnotationElement(reader)); } } if (!annotationElements.isEmpty()) { functionParameter.setAnnotationElements(annotationElements); } return functionParameter; }
private FunctionImportParameter readFunctionImportParameter(final XMLStreamReader reader) throws EntityProviderException, XMLStreamException { reader.require(XMLStreamConstants.START_ELEMENT, edmNamespace, XmlMetadataConstants.EDM_FUNCTION_PARAMETER); FunctionImportParameter functionParameter = new FunctionImportParameter(); List<AnnotationElement> annotationElements = new ArrayList<AnnotationElement>(); functionParameter.setName(reader.getAttributeValue(null, XmlMetadataConstants.EDM_NAME)); String type = reader.getAttributeValue(null, XmlMetadataConstants.EDM_TYPE); if (type == null) { throw new EntityProviderException(EntityProviderException.MISSING_ATTRIBUTE .addContent(XmlMetadataConstants.EDM_TYPE).addContent(XmlMetadataConstants.EDM_FUNCTION_PARAMETER)); } functionParameter.setType(EdmSimpleTypeKind.valueOf(extractFQName(type).getName())); functionParameter.setFacets(readFacets(reader)); functionParameter.setAnnotationAttributes(readAnnotationAttribute(reader)); while (reader.hasNext() && !(reader.isEndElement() && edmNamespace.equals(reader.getNamespaceURI()) && XmlMetadataConstants.EDM_FUNCTION_IMPORT.equals(reader.getLocalName()))) { reader.next(); if (reader.isStartElement()) { extractNamespaces(reader); annotationElements.add(readAnnotationElement(reader)); } } if (!annotationElements.isEmpty()) { functionParameter.setAnnotationElements(annotationElements); } return functionParameter; }
private FunctionImportParameter readFunctionImportParameter(final XMLStreamReader reader) throws EntityProviderException, XMLStreamException { reader.require(XMLStreamConstants.START_ELEMENT, edmNamespace, XmlMetadataConstants.EDM_FUNCTION_PARAMETER); FunctionImportParameter functionParameter = new FunctionImportParameter(); List<AnnotationElement> annotationElements = new ArrayList<AnnotationElement>(); functionParameter.setName(reader.getAttributeValue(null, XmlMetadataConstants.EDM_NAME)); functionParameter.setMode(reader.getAttributeValue(null, XmlMetadataConstants.EDM_FUNCTION_PARAMETER_MODE)); String type = reader.getAttributeValue(null, XmlMetadataConstants.EDM_TYPE); if (type == null) { throw new EntityProviderException(EntityProviderException.MISSING_ATTRIBUTE .addContent(XmlMetadataConstants.EDM_TYPE).addContent(XmlMetadataConstants.EDM_FUNCTION_PARAMETER)); } functionParameter.setType(EdmSimpleTypeKind.valueOf(extractFQName(type).getName())); functionParameter.setFacets(readFacets(reader)); functionParameter.setAnnotationAttributes(readAnnotationAttribute(reader)); while (reader.hasNext() && !(reader.isEndElement() && edmNamespace.equals(reader.getNamespaceURI()) && XmlMetadataConstants.EDM_FUNCTION_PARAMETER.equals(reader.getLocalName()))) { reader.next(); if (reader.isStartElement()) { extractNamespaces(reader); annotationElements.add(readAnnotationElement(reader)); } } if (!annotationElements.isEmpty()) { functionParameter.setAnnotationElements(annotationElements); } return functionParameter; }
.addContent(XmlMetadataConstants.EDM_TYPE).addContent(XmlMetadataConstants.EDM_FUNCTION_PARAMETER)); functionParameter.setType(EdmSimpleTypeKind.valueOf(extractFQName(type).getName())); EdmFacets facets = readFacets(reader); functionParameter.setFacets(facets);
private EdmPropertyImpl readSimpleProperty(final XMLStreamReader reader, final FullQualifiedName fqName) throws XMLStreamException, EdmException { EdmSimplePropertyImpl property = new EdmSimplePropertyImpl(); property.setName(reader.getAttributeValue(null, XmlMetadataConstants.EDM_NAME)); property.setTypeName(fqName); property.setSimpleType(EdmSimpleTypeKind.valueOf(fqName.getName())); property.setEdmType(EdmSimpleTypeFacadeImpl.getEdmSimpleType(property.getSimpleType())); return property; }
@Override public EdmType getType() throws EdmException { if (edmType == null) { final String namespace = typeName.getNamespace(); if (EdmSimpleType.EDM_NAMESPACE.equals(typeName.getNamespace())) { edmType = EdmSimpleTypeFacadeImpl.getEdmSimpleType(EdmSimpleTypeKind.valueOf(typeName.getName())); } else { edmType = edm.getComplexType(namespace, typeName.getName()); } if (edmType == null) { edmType = edm.getEntityType(namespace, typeName.getName()); } if (edmType == null) { throw new EdmException(EdmException.COMMON); } } return edmType; }
@Override public EdmType getType() throws EdmException { if (edmType == null) { final String namespace = typeName.getNamespace(); if (EdmSimpleType.EDM_NAMESPACE.equals(typeName.getNamespace())) { edmType = EdmSimpleTypeFacadeImpl.getEdmSimpleType(EdmSimpleTypeKind.valueOf(typeName.getName())); } else { edmType = edm.getComplexType(namespace, typeName.getName()); } if (edmType == null) { edmType = edm.getEntityType(namespace, typeName.getName()); } if (edmType == null) { throw new EdmException(EdmException.COMMON); } } return edmType; }
@Override public EdmType getType() throws EdmException { if (edmType == null) { final String namespace = typeName.getNamespace(); if (EdmSimpleType.EDM_NAMESPACE.equals(typeName.getNamespace())) { edmType = EdmSimpleTypeFacadeImpl.getEdmSimpleType(EdmSimpleTypeKind.valueOf(typeName.getName())); } else { edmType = edm.getComplexType(namespace, typeName.getName()); } if (edmType == null) { edmType = edm.getEntityType(namespace, typeName.getName()); } if (edmType == null) { throw new EdmException(EdmException.TYPEPROBLEM); } } return edmType; }
@Override public EdmType getType() throws EdmException { if (edmType == null) { final String namespace = typeName.getNamespace(); if (EdmSimpleType.EDM_NAMESPACE.equals(typeName.getNamespace())) { edmType = EdmSimpleTypeFacadeImpl.getEdmSimpleType(EdmSimpleTypeKind.valueOf(typeName.getName())); } else { edmType = edm.getComplexType(namespace, typeName.getName()); } if (edmType == null) { edmType = edm.getEntityType(namespace, typeName.getName()); } if (edmType == null) { throw new EdmException(EdmException.COMMON); } } return edmType; }
reader.nextNull(); } else { switch (EdmSimpleTypeKind.valueOf(type.getName())) { case Boolean: if (tokenType == JsonToken.BOOLEAN) {
reader.nextNull(); } else { switch (EdmSimpleTypeKind.valueOf(type.getName())) { case Boolean: if (tokenType == JsonToken.BOOLEAN) {
reader.nextNull(); } else { switch (EdmSimpleTypeKind.valueOf(type.getName())) { case Boolean: if (tokenType == JsonToken.BOOLEAN) {
reader.nextNull(); } else { switch (EdmSimpleTypeKind.valueOf(type.getName())) { case Boolean: if (tokenType == JsonToken.BOOLEAN) {
final Object contentValue = value instanceof Map ? ((Map<?, ?>) value).get(propertyInfo.getName()) : value; final String valueAsString = type.valueToString(contentValue, EdmLiteralKind.JSON, propertyInfo.getFacets()); switch (EdmSimpleTypeKind.valueOf(type.getName())) { case String: jsonStreamWriter.stringValue(valueAsString);
propertyInfo.getName()), e); switch (EdmSimpleTypeKind.valueOf(type.getName())) { case String: jsonStreamWriter.stringValue(valueAsString);
propertyInfo.getName()), e); switch (EdmSimpleTypeKind.valueOf(type.getName())) { case String: jsonStreamWriter.stringValue(valueAsString);