public abstract class StructureType extends DataType
Common base class for ComplexType
and EntityType
.
ANNOTATION_PATH, BINARY, BOOLEAN, BYTE, BYTE_STREAM, CHAR, CHAR_STREAM, CODE_UNKNOWN, COMPLEX_VALUE, COMPLEX_VALUE_LIST, DATA_VALUE_LIST, DAY_TIME_DURATION, DECIMAL, DELTA_STREAM, DOUBLE, DYNAMIC_PATH, EDM_PRIMITIVE, ENTITY_VALUE, ENTITY_VALUE_LIST, ENUM_VALUE, FLOAT, GEOGRAPHY_COLLECTION, GEOGRAPHY_LINE_STRING, GEOGRAPHY_MULTI_LINE_STRING, GEOGRAPHY_MULTI_POINT, GEOGRAPHY_MULTI_POLYGON, GEOGRAPHY_POINT, GEOGRAPHY_POLYGON, GEOGRAPHY_VALUE, GEOMETRY_COLLECTION, GEOMETRY_LINE_STRING, GEOMETRY_MULTI_LINE_STRING, GEOMETRY_MULTI_POINT, GEOMETRY_MULTI_POLYGON, GEOMETRY_POINT, GEOMETRY_POLYGON, GEOMETRY_VALUE, GLOBAL_DATE_TIME, GUID_VALUE, INT, INTEGER, LIST, LOCAL_DATE, LOCAL_DATE_TIME, LOCAL_TIME, LONG, NAVIGATION_PATH, OBJECT, PATH, PATH_EXPRESSION, PROPERTY_PATH, QUERY_ALIAS, QUERY_FILTER, QUERY_FUNCTION_CALL, QUERY_OPERATOR_CALL, SHORT, STREAM_LINK, STRING, STRUCTURAL_PATH, TARGET_PATH, unknown, UNSIGNED_BYTE, UNSIGNED_INT, UNSIGNED_LONG, UNSIGNED_SHORT, YEAR_MONTH_DURATION
Constructor and Description |
---|
StructureType() |
Modifier and Type | Method and Description |
---|---|
Annotation |
getAnnotation(java.lang.String term)
Lookup an existing annotation by term name, or throw an exception if the annotation is not found.
|
AnnotationMap |
getAnnotations()
Return map of annotations for this model element.
|
boolean |
getCanBeRemoved()
Return can this model element be removed by
DataService.refreshMetadata . |
PropertyList |
getCollectionProperties()
Return list of collection-typed properties for this type (both structural and navigation properties may be included).
|
PropertyList |
getComplexProperties()
Return list of complex properties for this type (a subset of
StructureType.structuralProperties ). |
PropertyList |
getExtensionProperties()
Return list of extension properties for this type.
|
java.lang.String |
getLocalName()
Return the local name of this type within its owning
DataSchema , e.g. |
java.lang.String |
getName()
Return synonym for
StructureType.qualifiedName . |
PropertyList |
getNavigationProperties()
Return list of navigation properties for this type.
|
com.sap.cloud.server.odata.core.ObjectFactory |
getObjectFactory()
Return (nullable) Factory for creating custom (subclass) objects with this type.
|
Property |
getProperty(java.lang.String name)
Lookup an existing property by name.
|
PropertyList |
getPropertyList()
Return list of stream, structural and navigation properties for this type.
|
PropertyMap |
getPropertyMap()
Return map of stream, structural and navigation properties for this type.
|
java.lang.String |
getQualifiedName()
Return the name of this type qualified by its owning
DataSchema name, e.g. |
int |
getSourceLine()
Return source line number for this schema element within its defining schema.
|
PropertyList |
getStreamProperties()
Return list of stream properties for this type.
|
PropertyList |
getStructuralProperties()
Return list of structural properties for this type.
|
boolean |
isAbstract()
Return
true if this is an abstract type. |
boolean |
isExtension()
Return
true if this type was added since metadata was originally loaded. |
boolean |
isHidden()
Return indicates that the type is intended to be hidden for client side
|
boolean |
isInferred()
Return
true if this structure type was inferred due to a missing term definition in the CSDL. |
boolean |
isOpenType()
Return
true if this is an open type. |
boolean |
isRemoved()
Return has this model element been removed by a successful call to
DataService.refreshMetadata ?
If `isRemoved == true, that implies that the old metadata (before refreshMetadata was called) did include this model element,
and that the new metadata (after refreshMetadata was called) does not include this model element. |
void |
setAbstract(boolean value)
Set
true if this is an abstract type. |
void |
setCanBeRemoved(boolean value)
Set can this model element be removed by
DataService.refreshMetadata . |
void |
setCollectionProperties(PropertyList value)
Set list of collection-typed properties for this type (both structural and navigation properties may be included).
|
void |
setComplexProperties(PropertyList value)
Set list of complex properties for this type (a subset of
StructureType.structuralProperties ). |
void |
setExtension(boolean value)
Set
true if this type was added since metadata was originally loaded. |
void |
setExtensionProperties(PropertyList value)
Set list of extension properties for this type.
|
void |
setHidden(boolean value)
Set indicates that the type is intended to be hidden for client side
|
void |
setInferred(boolean value)
Set
true if this structure type was inferred due to a missing term definition in the CSDL. |
void |
setLocalName(java.lang.String value)
Set the local name of this type within its owning
DataSchema , e.g. |
void |
setNavigationProperties(PropertyList value)
Set list of navigation properties for this type.
|
void |
setObjectFactory(com.sap.cloud.server.odata.core.ObjectFactory value)
Set factory for creating custom (subclass) objects with this type.
|
void |
setOpenType(boolean value)
Set
true if this is an open type. |
void |
setPropertyList(PropertyList value)
Set list of stream, structural and navigation properties for this type.
|
void |
setPropertyMap(PropertyMap value)
Set map of stream, structural and navigation properties for this type.
|
void |
setQualifiedName(java.lang.String value)
Set the name of this type qualified by its owning
DataSchema name, e.g. |
void |
setRemoved(boolean value)
Set has this model element been removed by a successful call to
DataService.refreshMetadata ?
If `isRemoved == true, that implies that the old metadata (before refreshMetadata was called) did include this model element,
and that the new metadata (after refreshMetadata was called) does not include this model element. |
void |
setSourceLine(int value)
Set source line number for this schema element within its defining schema.
|
void |
setStreamProperties(PropertyList value)
Set list of stream properties for this type.
|
void |
setStructuralProperties(PropertyList value)
Set list of structural properties for this type.
|
forCode, forName, getBaseType, getCode, getItemType, isBasic, isBasicList, isCalendar, isComplex, isComplexList, isDerived, isEntity, isEntityList, isEnum, isEnumList, isGeography, isGeometry, isGeospatial, isGuid, isList, isNumber, isPath, isStream, isUnsigned, listOf, toString
public Annotation getAnnotation(java.lang.String term)
Lookup an existing annotation by term name, or throw an exception if the annotation is not found.
StructureType.annotations
and AnnotationMap.get
, for looking up annotations that might not exist.
term
- The term name.public AnnotationMap getAnnotations()
Return map of annotations for this model element. For annotations without qualifiers, the entry key is the annotation term name. For annotations with qualifiers, the entry key is the annotation term name, then "#", then the annotation qualifier.
public boolean getCanBeRemoved()
Return can this model element be removed by DataService.refreshMetadata
. Defaults to false
.
Set this to true
to indicate that the application is coded to be able able to function correctly without this model element.
public PropertyList getCollectionProperties()
Return list of collection-typed properties for this type (both structural and navigation properties may be included).
public PropertyList getComplexProperties()
Return list of complex properties for this type (a subset of StructureType.structuralProperties
).
StructureType.structuralProperties
).public PropertyList getExtensionProperties()
Return list of extension properties for this type. Includes extension structural/navigation properties.
public java.lang.String getLocalName()
Return the local name of this type within its owning DataSchema
, e.g. "MyType".
DataSchema
, e.g. "MyType".public java.lang.String getName()
Return synonym for StructureType.qualifiedName
.
getName
in class DataType
StructureType.qualifiedName
.public PropertyList getNavigationProperties()
Return list of navigation properties for this type.
public com.sap.cloud.server.odata.core.ObjectFactory getObjectFactory()
Return (nullable) Factory for creating custom (subclass) objects with this type.
public Property getProperty(java.lang.String name)
Lookup an existing property by name. If the property does not exist it indicates a fundamental implementation
problem, therefore a non-catchable FatalException
will be thrown, and the app intentionally crashes.
The reason behind this drastic behaviour is to avoid mismatch between server and client.
It is still possible to avoid the FatalException
by looking up propery before calling this method like in the
following code snippet:
public void checkPropertyExistsExample() { DataService service = this.getService(); EntitySet entitySet = service.getEntitySet("Employees"); EntityType entityType = entitySet.getEntityType(); PropertyMap propMap = entityType.getPropertyMap(); if (propMap.keys().includes("BirthDate")) { Ignore.valueOf_any(entityType.getProperty("BirthDate")); } else { } }
StructureType.propertyMap
, for looking up properties that might not exist.
name
- Name of the property.public PropertyList getPropertyList()
Return list of stream, structural and navigation properties for this type.
public PropertyMap getPropertyMap()
Return map of stream, structural and navigation properties for this type.
public java.lang.String getQualifiedName()
Return the name of this type qualified by its owning DataSchema
name, e.g. "MySchema.MyType".
DataSchema
name, e.g. "MySchema.MyType".public int getSourceLine()
Return source line number for this schema element within its defining schema.
public PropertyList getStreamProperties()
Return list of stream properties for this type.
public PropertyList getStructuralProperties()
Return list of structural properties for this type.
public boolean isAbstract()
Return true
if this is an abstract type.
true
if this is an abstract type.public boolean isExtension()
Return true
if this type was added since metadata was originally loaded.
true
if this type was added since metadata was originally loaded.public boolean isHidden()
Return indicates that the type is intended to be hidden for client side
public boolean isInferred()
Return true
if this structure type was inferred due to a missing term definition in the CSDL.
true
if this structure type was inferred due to a missing term definition in the CSDL.public boolean isOpenType()
Return true
if this is an open type. An open type can have dynamic properties.
true
if this is an open type. An open type can have dynamic properties.public boolean isRemoved()
Return has this model element been removed by a successful call to DataService.refreshMetadata
?
If `isRemoved == true, that implies that the old metadata (before refreshMetadata was called) did include this model element,
and that the new metadata (after refreshMetadata was called) does not include this model element.
public void setAbstract(boolean value)
Set true
if this is an abstract type.
value
- true
if this is an abstract type.public void setCanBeRemoved(boolean value)
Set can this model element be removed by DataService.refreshMetadata
. Defaults to false
.
Set this to true
to indicate that the application is coded to be able able to function correctly without this model element.
value
- Can this model element be removed by `DataService.refreshMetadata`. Defaults to `false`.public void setCollectionProperties(PropertyList value)
Set list of collection-typed properties for this type (both structural and navigation properties may be included).
value
- List of collection-typed properties for this type (both structural and navigation properties may be included).public void setComplexProperties(PropertyList value)
Set list of complex properties for this type (a subset of StructureType.structuralProperties
).
value
- List of complex properties for this type (a subset of StructureType.structuralProperties
).public void setExtension(boolean value)
Set true
if this type was added since metadata was originally loaded.
value
- true
if this type was added since metadata was originally loaded.public void setExtensionProperties(PropertyList value)
Set list of extension properties for this type. Includes extension structural/navigation properties.
value
- List of extension properties for this type.public void setHidden(boolean value)
Set indicates that the type is intended to be hidden for client side
value
- Indicates that the type is intended to be hidden for client sidepublic void setInferred(boolean value)
Set true
if this structure type was inferred due to a missing term definition in the CSDL.
value
- true
if this structure type was inferred due to a missing term definition in the CSDL.public void setLocalName(java.lang.String value)
Set the local name of this type within its owning DataSchema
, e.g. "MyType".
value
- The local name of this type within its owning DataSchema
, e.g. "MyType".public void setNavigationProperties(PropertyList value)
Set list of navigation properties for this type.
value
- List of navigation properties for this type.public void setObjectFactory(com.sap.cloud.server.odata.core.ObjectFactory value)
Set factory for creating custom (subclass) objects with this type.
value
- Factory for creating custom (subclass) objects with this type.public void setOpenType(boolean value)
Set true
if this is an open type. An open type can have dynamic properties.
value
- true
if this is an open type. An open type can have dynamic properties.public void setPropertyList(PropertyList value)
Set list of stream, structural and navigation properties for this type.
value
- List of stream, structural and navigation properties for this type.public void setPropertyMap(PropertyMap value)
Set map of stream, structural and navigation properties for this type.
value
- Map of stream, structural and navigation properties for this type.public void setQualifiedName(java.lang.String value)
Set the name of this type qualified by its owning DataSchema
name, e.g. "MySchema.MyType".
value
- The name of this type qualified by its owning DataSchema
name, e.g. "MySchema.MyType".public void setRemoved(boolean value)
Set has this model element been removed by a successful call to DataService.refreshMetadata
?
If `isRemoved == true, that implies that the old metadata (before refreshMetadata was called) did include this model element,
and that the new metadata (after refreshMetadata was called) does not include this model element.
value
- Has this model element been removed by a successful call to `DataService.refreshMetadata`?public void setSourceLine(int value)
Set source line number for this schema element within its defining schema.
value
- Source line number for this schema element within its defining schema.public void setStreamProperties(PropertyList value)
Set list of stream properties for this type.
value
- List of stream properties for this type.public void setStructuralProperties(PropertyList value)
Set list of structural properties for this type.
value
- List of structural properties for this type.