public class AnnotationType extends Object implements Comparable<AnnotationType>
If an AnnotationType has a DataType
, this means that Annotation
s of
that type are allowed to have a FieldValue
of the given
DataType
as an optional payload.
Modifier and Type | Field and Description |
---|---|
private DataType |
dataType |
private int |
id |
private String |
name |
private AnnotationType |
superType |
Constructor and Description |
---|
AnnotationType(String name)
Creates a new annotation type that cannot have values (hence no data type).
|
AnnotationType(String name,
DataType dataType)
Creates a new annotation type that can have values of the specified type.
|
AnnotationType(String name,
DataType dataType,
int id)
Creates a new annotation type that can have values of the specified type.
|
AnnotationType(String name,
int id)
Creates a new annotation type, with the specified ID. WARNING! Only to be used by configuration
system, do not use!!
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(AnnotationType annotationType) |
private int |
computeHash() |
boolean |
equals(Object o) |
DataType |
getDataType()
Returns the data type of this annotation, if any.
|
int |
getId()
Returns the ID of this annotation.
|
Collection<AnnotationType> |
getInheritedTypes() |
String |
getName()
Returns the name of this annotation.
|
int |
hashCode() |
void |
inherit(AnnotationType type)
WARNING! Only to be used by the configuration system and in unit tests. Not to be used in production code.
|
boolean |
inherits(AnnotationType type) |
boolean |
isValueCompatible(Annotation structValue) |
void |
setDataType(DataType dataType)
Sets the data type of this annotation. WARNING! Only to be used by configuration
system, do not use!!
|
String |
toString() |
private final int id
private final String name
private DataType dataType
private AnnotationType superType
public AnnotationType(String name)
name
- the name of the new annotation typepublic AnnotationType(String name, DataType dataType)
name
- the name of the new annotation typedataType
- the data type of the annotation valuepublic AnnotationType(String name, DataType dataType, int id)
name
- the name of the new annotation typedataType
- the data type of the annotation valueid
- the ID of the new annotation typepublic AnnotationType(String name, int id)
name
- the name of the new annotation typeid
- the ID of the new annotation typepublic String getName()
public DataType getDataType()
public void setDataType(DataType dataType)
dataType
- the data type of the annotation valuepublic int getId()
private int computeHash()
public boolean isValueCompatible(Annotation structValue)
public void inherit(AnnotationType type)
type
- the type to inherit frompublic Collection<AnnotationType> getInheritedTypes()
public boolean inherits(AnnotationType type)
public int compareTo(AnnotationType annotationType)
compareTo
in interface Comparable<AnnotationType>
Copyright © 2018. All rights reserved.