/** * Returns the primitive type's default class or the manually mapped class if present. * @param mapping * @param edmPrimitiveType * @return the java class to be used during deserialization */ private Class<?> getJavaClassForPrimitiveType(final EdmMapping mapping, final EdmPrimitiveType type) { final EdmPrimitiveType edmPrimitiveType = type.getKind() == EdmTypeKind.ENUM ? ((EdmEnumType) type).getUnderlyingType() : type .getKind() == EdmTypeKind.DEFINITION ? ((EdmTypeDefinition) type).getUnderlyingType() : type; return mapping == null || mapping.getMappedJavaClass() == null ? edmPrimitiveType.getDefaultType() : mapping .getMappedJavaClass(); }
/** * Returns the {@link FullQualifiedName} for this type kind. * * @return {@link FullQualifiedName} */ public FullQualifiedName getFullQualifiedName() { return new FullQualifiedName(EdmPrimitiveType.EDM_NAMESPACE, toString()); }
/** * Set the derived edm entity type. * @param derivedType the derived edm entity type * @return Builder */ public Builder derived(final EdmEntityType derivedType) { contextURL.derivedEntity = derivedType.getFullQualifiedName().getFullQualifiedNameAsString(); return this; }
public static String getUUIDkeyPropertyName(EdmEntitySet entSet) { EdmEntityType entType=entSet.getEntityType(); for(EdmKeyPropertyRef refs:entType.getKeyPropertyRefs()) { if(refs.getProperty().getType().getFullQualifiedName().getName().equalsIgnoreCase("Guid")) { return refs.getName(); } } return null; }
@Override public String toString() { return type == null ? "NULL" : type.getFullQualifiedName().getFullQualifiedNameAsString(); } }
@Override public EdmAnnotation getAnnotation(final EdmTerm term, String qualifier) { EdmAnnotation result = null; for (EdmAnnotation annotation : getAnnotations()) { if (term.getFullQualifiedName().equals(annotation.getTerm().getFullQualifiedName()) && qualifierEqual(qualifier, annotation.getQualifier())) { result = annotation; break; } } return result; }
/** * Set the edm entity type. * @param type the edm entity type * @return Builder */ public Builder type(final EdmType type) { contextURL.entitySetOrSingletonOrType = type.getFullQualifiedName().toString(); return this; }
@Override public boolean isCollection() { return action.getReturnType() != null && action.getReturnType().isCollection(); }
@Override public String getSegmentValue() { return type.getFullQualifiedName().getFullQualifiedNameAsString(); } }
/** * Set the derived edm entity type. * @param derivedType the derived edm entity type * @return Builder */ public Builder derived(final EdmEntityType derivedType) { contextURL.derivedEntity = derivedType.getFullQualifiedName().getFullQualifiedNameAsString(); return this; }
/** * Returns the primitive type's default class or the manually mapped class if present. * @param mapping * @param edmPrimitiveType * @return the java class to be used during deserialization */ private Class<?> getJavaClassForPrimitiveType(final EdmMapping mapping, final EdmPrimitiveType type) { final EdmPrimitiveType edmPrimitiveType = type.getKind() == EdmTypeKind.ENUM ? ((EdmEnumType) type).getUnderlyingType() : type .getKind() == EdmTypeKind.DEFINITION ? ((EdmTypeDefinition) type).getUnderlyingType() : type; return mapping == null || mapping.getMappedJavaClass() == null ? edmPrimitiveType.getDefaultType() : mapping .getMappedJavaClass(); }
/** * Set the edm entity type. * @param type the edm entity type * @return Builder */ public Builder type(final EdmType type) { contextURL.entitySetOrSingletonOrType = type.getFullQualifiedName().toString(); return this; }
/** * Returns the {@link FullQualifiedName} for this type kind. * * @return {@link FullQualifiedName} */ public FullQualifiedName getFullQualifiedName() { return new FullQualifiedName(EdmPrimitiveType.EDM_NAMESPACE, toString()); }
@Override public boolean isCollection() { return action.getReturnType() != null && action.getReturnType().isCollection(); }
@Override public String toString() { return type == null ? "NULL" : type.getFullQualifiedName().getFullQualifiedNameAsString(); } }
@Override public String getSegmentValue() { return type.getFullQualifiedName().getFullQualifiedNameAsString(); } }
private String getFullQualifiedName(final EdmType type, final boolean isCollection) { final String name = type.getFullQualifiedName().getFullQualifiedNameAsString(); return isCollection ? "Collection(" + name + ")" : name; }