public class AnnotationTerm
extends java.lang.Object
Encapsulates an OData term definition.
Constructor and Description |
---|
AnnotationTerm() |
Modifier and Type | Method and Description |
---|---|
static boolean |
equal(AnnotationTerm a,
AnnotationTerm b)
Return
true if two annotation terms have equal key-values. |
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.
|
StringList |
getAppliesTo()
Return the types of CSDL definition this term applies to.
|
AnnotationTerm |
getBaseTerm()
Return (nullable) Base term if this term is inherited, otherwise
null . |
DataValue |
getDefaultValue()
Return (nullable) Default value for
Annotation.value of annotations referencing this term, or null if there is no default value. |
boolean |
getFixedLength()
Return
true if this item has fixed length for string and binary values. |
java.lang.String |
getLocalName()
Return term name within its defining schema, e.g.
|
int |
getMaxLength()
Return maximum length for
string and binary values. |
int |
getMinLength()
Return minimum length for
string and binary values. |
java.lang.String |
getName()
Return synonym for
AnnotationTerm.qualifiedName . |
int |
getPrecision()
Return precision for
decimal and integer values. |
java.lang.String |
getQualifiedName()
Return term name qualified by its owning schema, e.g.
|
int |
getScale()
Return scale for
decimal values. |
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.
|
DataType |
getType()
Return data type for
Annotation.value of annotations referencing this term. |
java.lang.String |
getXmlAttribute()
Return (nullable) If this annotation was derived from an XML attribute, then the attribute name.
|
boolean |
isInferred()
Return
true if this annotation term was inferred due to a missing term definition in the CSDL. |
boolean |
isNullable()
Return
true if this item is nullable. |
boolean |
isUnicode()
Return
true if this item allows Unicode content. |
void |
setAppliesTo(StringList value)
Set the types of CSDL definition this term applies to.
|
void |
setBaseTerm(AnnotationTerm value)
Set base term if this term is inherited, otherwise
null . |
void |
setDefaultValue(DataValue value)
Set default value for
Annotation.value of annotations referencing this term, or null if there is no default value. |
void |
setInferred(boolean value)
Set
true if this annotation term was inferred due to a missing term definition in the CSDL. |
void |
setLocalName(java.lang.String value)
Set term name within its defining schema, 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 |
setPrecision(int value)
Set precision for
decimal and integer values. |
void |
setQualifiedName(java.lang.String value)
Set term name qualified by its owning schema, e.g.
|
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 |
setType(DataType value)
Set data type for
Annotation.value of annotations referencing this term. |
void |
setUnicode(boolean value)
Set
true if this item allows Unicode content. |
void |
setXmlAttribute(java.lang.String value)
Set if this annotation was derived from an XML attribute, then the attribute name.
|
java.lang.String |
toString() |
public static boolean equal(AnnotationTerm a, AnnotationTerm b)
Return true
if two annotation terms have equal key-values.
a
- (nullable) First annotation term.b
- (nullable) Second annotation term.true
if two annotation terms have equal key-values.public Annotation getAnnotation(java.lang.String term)
Lookup an existing annotation by term name, or throw an exception if the annotation is not found.
AnnotationTerm.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 StringList getAppliesTo()
Return the types of CSDL definition this term applies to.
public AnnotationTerm getBaseTerm()
Return (nullable) Base term if this term is inherited, otherwise null
.
null
.public DataValue getDefaultValue()
Return (nullable) Default value for Annotation.value
of annotations referencing this term, or null
if there is no default value.
Annotation.value
of annotations referencing this term, or null
if there is no default value.public boolean getFixedLength()
Return true
if this item has fixed length for string
and binary
values.
public java.lang.String getLocalName()
Return term name within its defining schema, e.g. "MyTerm".
public int getMaxLength()
Return maximum length for string
and binary
values.
TypeFacets.ANY_LENGTH.
public int getMinLength()
Return minimum length for string
and binary
values.
TypeFacets.ANY_LENGTH.
public java.lang.String getName()
Return synonym for AnnotationTerm.qualifiedName
.
AnnotationTerm.qualifiedName
.public int getPrecision()
Return precision for decimal
and integer
values.
TypeFacets.ANY_PRECISION.
public java.lang.String getQualifiedName()
Return term name qualified by its owning schema, e.g. "MySchema.MyTerm".
public int getScale()
Return scale for decimal
values.
TypeFacets.FLOATING_SCALE, TypeFacets.VARIABLE_SCALE.
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 DataType getType()
Return data type for Annotation.value
of annotations referencing this term.
Annotation.value
of annotations referencing this term.public java.lang.String getXmlAttribute()
Return (nullable) If this annotation was derived from an XML attribute, then the attribute name. XML attribute-based annotations are commonly used in OData 2.0 schemas.
public boolean isInferred()
Return true
if this annotation term was inferred due to a missing term definition in the CSDL.
true
if this annotation term was inferred due to a missing term definition in the CSDL.public boolean isNullable()
Return true
if this item is nullable.
true
if this item is nullable.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 setAppliesTo(StringList value)
Set the types of CSDL definition this term applies to.
value
- The types of CSDL definition this term applies to.public void setBaseTerm(AnnotationTerm value)
Set base term if this term is inherited, otherwise null
.
value
- Base term if this term is inherited, otherwise null
.public void setDefaultValue(DataValue value)
Set default value for Annotation.value
of annotations referencing this term, or null
if there is no default value.
value
- Default value for Annotation.value
of annotations referencing this term, or null
if there is no default value.public void setInferred(boolean value)
Set true
if this annotation term was inferred due to a missing term definition in the CSDL.
value
- true
if this annotation term was inferred due to a missing term definition in the CSDL.public void setLocalName(java.lang.String value)
Set term name within its defining schema, e.g. "MyTerm".
value
- Term name within its defining schema, e.g. "MyTerm".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 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 term name qualified by its owning schema, e.g. "MySchema.MyTerm".
value
- Term name qualified by its owning schema, e.g. "MySchema.MyTerm".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 setType(DataType value)
Set data type for Annotation.value
of annotations referencing this term.
value
- Data type for Annotation.value
of annotations referencing this term.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 void setXmlAttribute(java.lang.String value)
Set if this annotation was derived from an XML attribute, then the attribute name. XML attribute-based annotations are commonly used in OData 2.0 schemas.
value
- If this annotation was derived from an XML attribute, then the attribute name.public java.lang.String toString()
toString
in class java.lang.Object