public class Annotation
extends java.lang.Object
Represents an OData annotation.
Constructor and Description |
---|
Annotation() |
Modifier and Type | Method and Description |
---|---|
static boolean |
equal(Annotation a,
Annotation b)
Return
true if two annotations 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.
|
boolean |
getExplicitNull()
Return is
Annotation.explicitValue an explicit null value? |
DataValue |
getExplicitValue()
Return (nullable) Explicit annotation value.
|
java.lang.String |
getQualifier()
Return (nullable) Annotation qualifier.
|
int |
getSourceLine()
Return source line number for this schema element within its defining schema.
|
AnnotationTerm |
getTerm()
Return annotation term.
|
DataValue |
getValue()
Return (nullable) Annotation value.
|
void |
setExplicitNull(boolean value)
Set is
Annotation.explicitValue an explicit null value? |
void |
setExplicitValue(DataValue value)
Set explicit annotation value.
|
void |
setQualifier(java.lang.String value)
Set annotation qualifier.
|
void |
setSourceLine(int value)
Set source line number for this schema element within its defining schema.
|
void |
setTerm(AnnotationTerm value)
Set annotation term.
|
java.lang.String |
toString() |
public static boolean equal(Annotation a, Annotation b)
Return true
if two annotations have equal key-values.
a
- (nullable) First annotation.b
- (nullable) Second annotation.true
if two annotations 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.
Annotation.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 getExplicitNull()
Return is Annotation.explicitValue
an explicit null
value?
Annotation.explicitValue
an explicit null
value?public DataValue getExplicitValue()
Return (nullable) Explicit annotation value.
public java.lang.String getQualifier()
Return (nullable) Annotation qualifier.
public int getSourceLine()
Return source line number for this schema element within its defining schema.
public AnnotationTerm getTerm()
Return annotation term.
public DataValue getValue()
Return (nullable) Annotation value.
Will return term.defaultValue
if Annotation.explicitValue
is null
and Annotation.explicitNull
is false
.
Otherwise returns Annotation.explicitValue
.
public void setExplicitNull(boolean value)
Set is Annotation.explicitValue
an explicit null
value?
value
- Is Annotation.explicitValue
an explicit null
value?public void setExplicitValue(DataValue value)
Set explicit annotation value.
value
- Explicit annotation value.public void setQualifier(java.lang.String value)
Set annotation qualifier.
value
- Annotation qualifier.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 setTerm(AnnotationTerm value)
Set annotation term.
value
- Annotation term.public java.lang.String toString()
toString
in class java.lang.Object