Copyright | (c) Christian Gram Kalhauge 2018-2019 |
---|---|
License | MIT |
Maintainer | kalhuage@cs.ucla.edu |
Safe Haskell | None |
Language | Haskell2010 |
Based on the Annotations Attribute, as documented [here](https:/docs.oracle.comjavasespecsjvmsse8html/jvms-4.html#jvms-4.7.16).
Synopsis
- newtype RuntimeVisibleAnnotations r = RuntimeVisibleAnnotations {}
- newtype RuntimeInvisibleAnnotations r = RuntimeInvisibleAnnotations {}
- newtype RuntimeVisibleParameterAnnotations r = RuntimeVisibleParameterAnnotations {}
- newtype RuntimeInvisibleParameterAnnotations r = RuntimeInvisibleParameterAnnotations {}
- data Annotation r = Annotation {
- annotationType :: !(Ref FieldDescriptor r)
- annotationValuePairs :: !(SizedList16 (ValuePair r))
- data ElementValue r
- = EByte !(Ref VInteger r)
- | EChar !(Ref VInteger r)
- | EDouble !(Ref VDouble r)
- | EFloat !(Ref VFloat r)
- | EInt !(Ref VInteger r)
- | ELong !(Ref VLong r)
- | EShort !(Ref VInteger r)
- | EBoolean !(Ref VInteger r)
- | EString !(Ref VString r)
- | EEnum !(EnumValue r)
- | EClass !(Ref ReturnDescriptor r)
- | EAnnotationType !(Annotation r)
- | EArrayType !(SizedList16 (ElementValue r))
- data EnumValue r = EnumValue {
- enumTypeName :: !(Ref FieldDescriptor r)
- enunConstName :: !(Ref Text r)
- data ValuePair r = ValuePair {
- name :: !(Ref Text r)
- value :: !(ElementValue r)
- data TypeAnnotation m r = TypeAnnotation {
- typeAnnotationTarget :: !(m r)
- typeAnnotationPath :: !TypePath
- typeAnnotationType :: !(Ref FieldDescriptor r)
- typeAnnotationValuePairs :: SizedList16 (ValuePair r)
- type TypePath = SizedList8 TypePathItem
- data TypePathItem = TypePathItem {}
- data TypePathKind
- newtype RuntimeVisibleTypeAnnotations m r = RuntimeVisibleTypeAnnotations {}
- newtype RuntimeInvisibleTypeAnnotations m r = RuntimeInvisibleTypeAnnotations {}
- data ClassTypeAnnotation r
- data MethodTypeAnnotation r
- data FieldTypeAnnotation r = FieldTypeAnnotation
- data CodeTypeAnnotation r
- = LocalVariableDeclaration !(LocalvarTarget r)
- | ResourceVariableDeclaration !(LocalvarTarget r)
- | ExceptionParameterDeclaration !CatchTarget
- | InstanceOfExpression !(OffsetTarget r)
- | NewExpression !(OffsetTarget r)
- | NewMethodReferenceExpression !(OffsetTarget r)
- | IdentifierMethodReferenceExpression !(OffsetTarget r)
- | CastExpression !(TypeArgumentTarget r)
- | ConstructorExpression !(TypeArgumentTarget r)
- | MethodIncovationExpression !(TypeArgumentTarget r)
- | GenericNewMethodReferenceExpression !(TypeArgumentTarget r)
- | GenericIdentifierwMethodReferenceExpression !(TypeArgumentTarget r)
- type TypeParameterTarget = Word8
- type SupertypeTarget = Word16
- isInExtendsClause :: SupertypeTarget -> Bool
- data TypeParameterBoundTarget = TypeParameterBoundTarget {}
- type FormalParameterTarget = Word8
- type ThrowsTarget = Word16
- type LocalvarTarget r = SizedList16 (LocalvarEntry r)
- data LocalvarEntry r = LocalvarEntry {
- lvStartPc :: !(ByteCodeRef r)
- lvLength :: !Word16
- lvLocalVarIndex :: !Word16
- type CatchTarget = Word16
- type OffsetTarget r = ByteCodeRef r
- data TypeArgumentTarget r = TypeArgumentTarget {
- typeArgumentOffset :: !(ByteCodeRef r)
- typeArgumentIndex :: Word8
- newtype AnnotationDefault r = AnnotationDefault {
- defaultValue :: ElementValue r
Documentation
newtype RuntimeVisibleAnnotations r Source #
Instances
newtype RuntimeInvisibleAnnotations r Source #
Instances
newtype RuntimeVisibleParameterAnnotations r Source #
Instances
newtype RuntimeInvisibleParameterAnnotations r Source #
Instances
data Annotation r Source #
Annotation | |
|
Instances
data ElementValue r Source #
EByte !(Ref VInteger r) | |
EChar !(Ref VInteger r) | |
EDouble !(Ref VDouble r) | |
EFloat !(Ref VFloat r) | |
EInt !(Ref VInteger r) | |
ELong !(Ref VLong r) | |
EShort !(Ref VInteger r) | |
EBoolean !(Ref VInteger r) | |
EString !(Ref VString r) | |
EEnum !(EnumValue r) | |
EClass !(Ref ReturnDescriptor r) | |
EAnnotationType !(Annotation r) | |
EArrayType !(SizedList16 (ElementValue r)) |
Instances
EnumValue | |
|
Instances
Instances
TypeAnnotations
data TypeAnnotation m r Source #
A TypeAnnotation
is targeting different types.
TypeAnnotation | |
|
Instances
type TypePath = SizedList8 TypePathItem Source #
data TypePathItem Source #
Instances
data TypePathKind Source #
Instances
newtype RuntimeVisibleTypeAnnotations m r Source #
Instances
newtype RuntimeInvisibleTypeAnnotations m r Source #
Instances
data ClassTypeAnnotation r Source #
From here
ClassTypeParameterDeclaration !TypeParameterTarget | type parameter declaration of generic class or interface (0x00) |
ClassSuperType !SupertypeTarget | type in extends clause of class or interface declaration, or in implements clause of interface declaration (0x10) |
ClassBoundTypeParameterDeclaration !TypeParameterBoundTarget | type in bound of type parameter declaration of generic class or interface (0x11) |
Instances
data MethodTypeAnnotation r Source #
MethodTypeParameterDeclaration !TypeParameterTarget | type parameter declaration of generic method or constructor (0x01) |
MethodBoundTypeParameterDeclaration !TypeParameterBoundTarget | type in bound of type parameter declaration of generic method or constructor (0x12) |
MethodReturnType | return type of method or constructor (0x14) |
MethodReceiverType | receiver type of method or constructor (0x15) |
MethodFormalParameter !FormalParameterTarget | type in formal parameter declaration of method, constructor, or lambda expression (0x16) |
MethodThrowsClause !ThrowsTarget | type in throws clause of method or constructor (0x17) |
Instances
data FieldTypeAnnotation r Source #
FieldTypeAnnotation | type in field declaration (0x13) |
Instances
data CodeTypeAnnotation r Source #
LocalVariableDeclaration !(LocalvarTarget r) | type in local variable declaration (0x40) |
ResourceVariableDeclaration !(LocalvarTarget r) | type in resource variable declaration (0x41) |
ExceptionParameterDeclaration !CatchTarget | type in exception parameter declaration (0x42) |
InstanceOfExpression !(OffsetTarget r) | type in instanceof expression (0x43) |
NewExpression !(OffsetTarget r) | type in new expression (0x44) |
NewMethodReferenceExpression !(OffsetTarget r) | type in method reference expression using ::new (0x45) |
IdentifierMethodReferenceExpression !(OffsetTarget r) | type in method reference expression using ::Identifier (0x46) |
CastExpression !(TypeArgumentTarget r) | type in cast expression (0x47) |
ConstructorExpression !(TypeArgumentTarget r) | type argument for generic constructor in new expression or explicit constructor invocation statement (0x48) |
MethodIncovationExpression !(TypeArgumentTarget r) | type argument for generic method in method invocation expression (0x49) |
GenericNewMethodReferenceExpression !(TypeArgumentTarget r) | type argument for generic constructor in method reference expression using ::new (0x4A) |
GenericIdentifierwMethodReferenceExpression !(TypeArgumentTarget r) | type argument for generic method in method reference expression using ::Identifier (0x4B) |
Instances
type TypeParameterTarget = Word8 Source #
The TypeParameterTarget
item indicates that an annotation appears on the
declaration of the i'th type parameter of a generic class, generic interface,
generic method, or generic constructor.
type SupertypeTarget = Word16 Source #
The SupertypeTarget
item indicates that an annotation appears on a type in
the extends or implements clause of a class or interface declaration.
A value of 65535 specifies that the annotation appears on the superclass in an extends clause of a class declaration.
isInExtendsClause :: SupertypeTarget -> Bool Source #
Check if the SupertypeTarget
is in the extends clauses
data TypeParameterBoundTarget Source #
The TypeParameterBoundTarget
item indicates that an annotation appears
on the i'th bound of the j'th type parameter declaration of a generic class,
interface, method, or constructor.
Instances
type FormalParameterTarget = Word8 Source #
The FormalParameterTarget
item indicates that an annotation appears on
the type in a formal parameter declaration of a method, constructor, or
lambda expression. The target is 0-indexed.
type ThrowsTarget = Word16 Source #
The ThrowsTarget
item indicates that an annotation appears on the i'th
type in the throws clause of a method or constructor declaration.
The value is an index into the Exceptions attribute
type LocalvarTarget r = SizedList16 (LocalvarEntry r) Source #
The LocalvarTarget
item indicates that an annotation appears on the type
in a local variable declaration, including a variable declared as a resource
in a try-with-resources statement.
The table is needed because a variable might span multiple live ranges.
data LocalvarEntry r Source #
An entry in the Localvar Table
LocalvarEntry | |
|
Instances
type CatchTarget = Word16 Source #
The CatchTarget
item indicates that an annotation appears on the i'th
type in an exception parameter declaration.
type OffsetTarget r = ByteCodeRef r Source #
The OffsetTarget
item indicates that an annotation appears on either the
type in an instanceof expression or a new expression, or the type before the
:: in a method reference expression.
data TypeArgumentTarget r Source #
The TypeArgumentTarget
item indicates that an annotation appears either
on the i'th type in a cast expression, or on the i'th type argument in the
explicit type argument list for any of the following: a new expression, an
explicit constructor invocation statement, a method invocation expression, or a
method reference expression.
Instances
AnnotationDefault
newtype AnnotationDefault r Source #
The AnnotationDefault attribute is a variable-length attribute in the attributes table of certain method_info structures (§4.6), namely those representing elements of annotation types (JLS §9.6.1). The AnnotationDefault attribute records the default value (JLS §9.6.2) for the element represented by the method_info structure. The Java Virtual Machine must make this default value available so it can be applied by appropriate reflective APIs.