Class Annotation
- java.lang.Object
-
- it.unive.lisa.program.annotations.Annotation
-
- All Implemented Interfaces:
java.lang.Comparable<Annotation>
public class Annotation extends java.lang.Object implements java.lang.Comparable<Annotation>
A single annotation.
-
-
Constructor Summary
Constructors Constructor Description Annotation(java.lang.String annotationName)
Builds an annotation from its name .Annotation(java.lang.String annotationName, boolean inherited)
Builds an annotation from its name.Annotation(java.lang.String annotationName, java.util.List<AnnotationMember> annotationMembers)
Builds an annotation from its name and its members that cannot be inherited.Annotation(java.lang.String annotationName, java.util.List<AnnotationMember> annotationMembers, boolean inherited)
Builds an annotation from its name and its members.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Annotation o)
boolean
equals(java.lang.Object obj)
java.util.List<AnnotationMember>
getAnnotationMembers()
Yields the annotation members of this annotation.java.lang.String
getAnnotationName()
Yields the annotation name of this annotation.int
hashCode()
boolean
isInherited()
Yieldstrue
if this annotation can be inherited,false
otherwise.java.lang.String
toString()
-
-
-
Constructor Detail
-
Annotation
public Annotation(java.lang.String annotationName)
Builds an annotation from its name .- Parameters:
annotationName
- the name of the annotation
-
Annotation
public Annotation(java.lang.String annotationName, boolean inherited)
Builds an annotation from its name.- Parameters:
annotationName
- the name of the annotationinherited
- denotes whether the annotation can be inherited
-
Annotation
public Annotation(java.lang.String annotationName, java.util.List<AnnotationMember> annotationMembers)
Builds an annotation from its name and its members that cannot be inherited.- Parameters:
annotationName
- the name of the annotationannotationMembers
- the annotation members
-
Annotation
public Annotation(java.lang.String annotationName, java.util.List<AnnotationMember> annotationMembers, boolean inherited)
Builds an annotation from its name and its members.- Parameters:
annotationName
- the name of the annotationannotationMembers
- the annotation membersinherited
- denotes whether the annotation can be inherited
-
-
Method Detail
-
getAnnotationMembers
public java.util.List<AnnotationMember> getAnnotationMembers()
Yields the annotation members of this annotation.- Returns:
- the annotation members of this annotation
-
getAnnotationName
public java.lang.String getAnnotationName()
Yields the annotation name of this annotation.- Returns:
- the annotaiton name of this annotaiton
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
isInherited
public boolean isInherited()
Yieldstrue
if this annotation can be inherited,false
otherwise.- Returns:
true
if this annotation can be inherited,false
otherwise
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
compareTo
public int compareTo(Annotation o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Annotation>
-
-