public class DataMethod
extends java.lang.Object
Encapsulates the metadata of an OData function or action.
Constructor and Description |
---|
DataMethod() |
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 . |
EntitySet |
getEntitySet()
Return (nullable) Entity set bound to this method, or
null if the method is not bound to an entity set. |
boolean |
getFixedLength()
Return
true if this item has fixed length for string and binary values. |
java.lang.String |
getHttpMethod()
Return (nullable) HTTP Method (e.g.
|
java.lang.String |
getImportedName()
Return synonym for
DataMethod.resourcePath . |
StringList |
getInvokeRoles()
Return security roles permitted for a user to be able to invoke this action.
|
java.lang.String |
getLocalName()
Return the local name of this method within its owning
DataSchema or EntityContainer , e.g. |
int |
getMaxLength()
Return maximum length for
string and binary values. |
DataMethodMetrics |
getMetrics()
Return metrics for runtime use of this data method.
|
int |
getMinLength()
Return minimum length for
string and binary values. |
java.lang.String |
getName()
Return synonym for
DataMethod.qualifiedName . |
DataMethodMap |
getOverloadMap()
Return map of overloads of this function.
|
ParameterList |
getParameters()
Return formal parameters for this method.
|
int |
getPrecision()
Return precision for
decimal and integer values. |
java.lang.String |
getQualifiedName()
Return the name of this method qualified by its owning
DataSchema or EntityContainer name, e.g. |
java.lang.String |
getResourcePath()
Return the name of this method as it should be referenced in resource paths.
|
DataType |
getReturnType()
Return return type for this method.
|
int |
getScale()
Return scale for
decimal values. |
java.lang.String |
getSignatureForParameters()
Return parameter type signature for this method.
|
java.lang.String |
getSignatureForReturnType()
Return parameter type signature for this method.
|
int |
getSourceLine()
Return source line number for this schema element within its defining schema.
|
int |
getSrid()
Return EPSG Spatial Reference System Identifier (SRID) for the associated value.
|
java.lang.String |
getTargetPath()
Return the name of this method qualified by its owning
DataSchema and EntityContainer names, e.g. |
java.lang.String |
getTypeSignature()
Return parameter/return type signature for this method.
|
java.lang.String |
getUnboundMethod()
Return (nullable) Qualified name of the associated unbound method.
|
boolean |
isAction()
Return
true if this method is an action, which is permitted to change entity state. |
boolean |
isBound()
Return is this method bound to a value when it is applied?
|
boolean |
isComposable()
Return is this method composable with another method?
|
boolean |
isExtension()
Return
true if this method was added since metadata was originally loaded. |
boolean |
isFunction()
Return
true if this method is a function, which is not permitted to change entity state. |
boolean |
isImported()
Return is this an ActionImport/FunctionImport (as opposed to an Action/Function)?
|
boolean |
isNullable()
Return
true if this item is nullable. |
boolean |
isOverloaded()
Return is this method overloaded?
|
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. |
boolean |
isUnicode()
Return
true if this item allows Unicode content. |
void |
setAction(boolean value)
Set
true if this method is an action, which is permitted to change entity state. |
void |
setBound(boolean value)
Set is this method bound to a value when it is applied?
|
void |
setCanBeRemoved(boolean value)
Set can this model element be removed by
DataService.refreshMetadata . |
void |
setComposable(boolean value)
Set is this method composable with another method?
|
void |
setEntitySet(EntitySet value)
Set entity set bound to this method, or
null if the method is not bound to an entity set. |
void |
setExtension(boolean value)
Set
true if this method was added since metadata was originally loaded. |
void |
setFunction(boolean value)
Set
true if this method is a function, which is not permitted to change entity state. |
void |
setHttpMethod(java.lang.String value)
Set HTTP Method (e.g.
|
void |
setImported(boolean value)
Set is this an ActionImport/FunctionImport (as opposed to an Action/Function)?
|
void |
setInvokeRoles(StringList value)
Set security roles permitted for a user to be able to invoke this action.
|
void |
setLocalName(java.lang.String value)
Set the local name of this method within its owning
DataSchema or EntityContainer , e.g. |
void |
setMaxLength(int value)
Set maximum length for
string and binary values. |
void |
setMinLength(int value)
Set minimum length for
string and binary values. |
void |
setNullable(boolean value)
Set
true if this item is nullable. |
void |
setParameters(ParameterList value)
Set formal parameters for this method.
|
void |
setPrecision(int value)
Set precision for
decimal and integer values. |
void |
setQualifiedName(java.lang.String value)
Set the name of this method qualified by its owning
DataSchema or EntityContainer 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 |
setResourcePath(java.lang.String value)
Set the name of this method as it should be referenced in resource paths.
|
void |
setReturnType(DataType value)
Set return type for this method.
|
void |
setScale(int value)
Set scale for
decimal values. |
void |
setSourceLine(int value)
Set source line number for this schema element within its defining schema.
|
void |
setSrid(int value)
Set EPSG Spatial Reference System Identifier (SRID) for the associated value.
|
void |
setTargetPath(java.lang.String value)
Set the name of this method qualified by its owning
DataSchema and EntityContainer names, e.g. |
void |
setUnboundMethod(java.lang.String value)
Set qualified name of the associated unbound method.
|
void |
setUnicode(boolean value)
Set
true if this item allows Unicode content. |
java.lang.String |
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.
DataMethod.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 EntitySet getEntitySet()
Return (nullable) Entity set bound to this method, or null
if the method is not bound to an entity set.
null
if the method is not bound to an entity set.public boolean getFixedLength()
Return true
if this item has fixed length for string
and binary
values.
public java.lang.String getHttpMethod()
Return (nullable) HTTP Method (e.g. "GET", "POST") for this data method.
public java.lang.String getImportedName()
Return synonym for DataMethod.resourcePath
.
DataMethod.resourcePath
.public StringList getInvokeRoles()
Return security roles permitted for a user to be able to invoke this action. The user need only belong to one of the roles.
public java.lang.String getLocalName()
Return the local name of this method within its owning DataSchema
or EntityContainer
, e.g. "MyAction".
DataSchema
or EntityContainer
, e.g. "MyAction".public int getMaxLength()
Return maximum length for string
and binary
values.
TypeFacets.ANY_LENGTH.
public DataMethodMetrics getMetrics()
Return metrics for runtime use of this data method.
public int getMinLength()
Return minimum length for string
and binary
values.
TypeFacets.ANY_LENGTH.
public java.lang.String getName()
Return synonym for DataMethod.qualifiedName
.
DataMethod.qualifiedName
.public DataMethodMap getOverloadMap()
Return map of overloads of this function. If this map contains only one entry, the method is not overloaded.
public ParameterList getParameters()
Return formal parameters for this method.
public int getPrecision()
Return precision for decimal
and integer
values.
TypeFacets.ANY_PRECISION.
public java.lang.String getQualifiedName()
Return the name of this method qualified by its owning DataSchema
or EntityContainer
name, e.g. "MySchema.MyAction" (if DataMethod.isImported
is false
]) or "MyContainer.MyAction" (if DataMethod.isImported
is true
]).
The Entity container prefix is omitted for the "default" entity container in the outermost schema.
DataSchema
or EntityContainer
name, e.g. "MySchema.MyAction" (if DataMethod.isImported
is false
]) or "MyContainer.MyAction" (if DataMethod.isImported
is true
]).public java.lang.String getResourcePath()
Return the name of this method as it should be referenced in resource paths.
public DataType getReturnType()
Return return type for this method.
public int getScale()
Return scale for decimal
values.
TypeFacets.FLOATING_SCALE, TypeFacets.VARIABLE_SCALE.
public java.lang.String getSignatureForParameters()
Return parameter type signature for this method.
public java.lang.String getSignatureForReturnType()
Return parameter type signature for this method.
public int getSourceLine()
Return source line number for this schema element within its defining schema.
public int getSrid()
Return EPSG Spatial Reference System Identifier (SRID) for the associated value.
TypeFacets.VARIABLE_SRID.
public java.lang.String getTargetPath()
Return the name of this method qualified by its owning DataSchema
and EntityContainer
names, e.g. "MySchema.MyAction" (if DataMethod.isImported
is false
]) or "MySchema.MyContainer/MyAction" (if DataMethod.isImported
is true
]).
DataSchema
and EntityContainer
names, e.g. "MySchema.MyAction" (if DataMethod.isImported
is false
]) or "MySchema.MyContainer/MyAction" (if DataMethod.isImported
is true
]).public java.lang.String getTypeSignature()
Return parameter/return type signature for this method.
public java.lang.String getUnboundMethod()
Return (nullable) Qualified name of the associated unbound method.
For OData V4+ ActionImport, this is the name of the corresponding Action.
For OData V4+ FunctionImport, this is the name of the corresponding Function.
Otherwise null
.
public boolean isAction()
Return true
if this method is an action, which is permitted to change entity state.
true
if this method is an action, which is permitted to change entity state.public boolean isBound()
Return is this method bound to a value when it is applied?
public boolean isComposable()
Return is this method composable with another method?
public boolean isExtension()
Return true
if this method was added since metadata was originally loaded.
true
if this method was added since metadata was originally loaded.public boolean isFunction()
Return true
if this method is a function, which is not permitted to change entity state.
true
if this method is a function, which is not permitted to change entity state.public boolean isImported()
Return is this an ActionImport/FunctionImport (as opposed to an Action/Function)?
public boolean isNullable()
Return true
if this item is nullable.
true
if this item is nullable.public boolean isOverloaded()
Return is this method overloaded?
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 boolean isUnicode()
Return true
if this item allows Unicode content.
If isUnicode
is false
, then this item only allows ASCII content.
true
if this item allows Unicode content.public void setAction(boolean value)
Set true
if this method is an action, which is permitted to change entity state.
value
- true
if this method is an action, which is permitted to change entity state.public void setBound(boolean value)
Set is this method bound to a value when it is applied?
value
- Is this method bound to a value when it is applied?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 setComposable(boolean value)
Set is this method composable with another method?
value
- Is this method composable with another method?public void setEntitySet(EntitySet value)
Set entity set bound to this method, or null
if the method is not bound to an entity set.
value
- Entity set bound to this method, or null
if the method is not bound to an entity set.public void setExtension(boolean value)
Set true
if this method was added since metadata was originally loaded.
value
- true
if this method was added since metadata was originally loaded.public void setFunction(boolean value)
Set true
if this method is a function, which is not permitted to change entity state.
value
- true
if this method is a function, which is not permitted to change entity state.public void setHttpMethod(java.lang.String value)
Set HTTP Method (e.g. "GET", "POST") for this data method.
value
- HTTP Method (e.g. "GET", "POST") for this data method.public void setImported(boolean value)
Set is this an ActionImport/FunctionImport (as opposed to an Action/Function)?
value
- Is this an ActionImport/FunctionImport (as opposed to an Action/Function)?public void setInvokeRoles(StringList value)
Set security roles permitted for a user to be able to invoke this action. The user need only belong to one of the roles.
value
- Security roles permitted for a user to be able to invoke this action.public void setLocalName(java.lang.String value)
Set the local name of this method within its owning DataSchema
or EntityContainer
, e.g. "MyAction".
value
- The local name of this method within its owning DataSchema
or EntityContainer
, e.g. "MyAction".public void setMaxLength(int value)
Set maximum length for string
and binary
values.
TypeFacets.ANY_LENGTH.
value
- Maximum length for `string` and `binary` values.public void setMinLength(int value)
Set minimum length for string
and binary
values.
TypeFacets.ANY_LENGTH.
value
- Minimum length for `string` and `binary` values.public void setNullable(boolean value)
Set true
if this item is nullable.
value
- true
if this item is nullable.public void setParameters(ParameterList value)
Set formal parameters for this method.
value
- Formal parameters for this method.public void setPrecision(int value)
Set precision for decimal
and integer
values.
TypeFacets.ANY_PRECISION.
value
- Precision for `decimal` and `integer` values.public void setQualifiedName(java.lang.String value)
Set the name of this method qualified by its owning DataSchema
or EntityContainer
name, e.g. "MySchema.MyAction" (if DataMethod.isImported
is false
]) or "MyContainer.MyAction" (if DataMethod.isImported
is true
]).
The Entity container prefix is omitted for the "default" entity container in the outermost schema.
value
- The name of this method qualified by its owning DataSchema
or EntityContainer
name, e.g. "MySchema.MyAction" (if DataMethod.isImported
is false
]) or "MyContainer.MyAction" (if DataMethod.isImported
is true
]).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 setResourcePath(java.lang.String value)
Set the name of this method as it should be referenced in resource paths.
value
- The name of this method as it should be referenced in resource paths.public void setReturnType(DataType value)
Set return type for this method.
value
- Return type for this method.public void setScale(int value)
Set scale for decimal
values.
TypeFacets.FLOATING_SCALE, TypeFacets.VARIABLE_SCALE.
value
- Scale for `decimal` values.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 setSrid(int value)
Set EPSG Spatial Reference System Identifier (SRID) for the associated value.
TypeFacets.VARIABLE_SRID.
value
- [EPSG](http://www.epsg.org/Geodetic.html) Spatial Reference System Identifier (SRID) for the associated value.public void setTargetPath(java.lang.String value)
Set the name of this method qualified by its owning DataSchema
and EntityContainer
names, e.g. "MySchema.MyAction" (if DataMethod.isImported
is false
]) or "MySchema.MyContainer/MyAction" (if DataMethod.isImported
is true
]).
value
- The name of this method qualified by its owning DataSchema
and EntityContainer
names, e.g. "MySchema.MyAction" (if DataMethod.isImported
is false
]) or "MySchema.MyContainer/MyAction" (if DataMethod.isImported
is true
]).public void setUnboundMethod(java.lang.String value)
Set qualified name of the associated unbound method.
For OData V4+ ActionImport, this is the name of the corresponding Action.
For OData V4+ FunctionImport, this is the name of the corresponding Function.
Otherwise null
.
value
- Qualified name of the associated unbound method.public void setUnicode(boolean value)
Set true
if this item allows Unicode content.
If isUnicode
is false
, then this item only allows ASCII content.
value
- true
if this item allows Unicode content.public java.lang.String toString()
toString
in class java.lang.Object