| Copyright | (c) Christian Gram Kalhauge 2017 |
|---|---|
| License | MIT |
| Maintainer | kalhuage@cs.ucla.edu |
| Safe Haskell | None |
| Language | Haskell2010 |
Language.JVM.Attribute
Description
This is the main module for accessing all kinds of Attributes.
- data Attribute = Attribute {}
- aInfo :: Attribute -> ByteString
- aName :: ConstantPool -> Attribute -> Maybe Text
- class IsAttribute a where
- type Code = Code Attribute
- data Const a b
Documentation
An Attribute, simply contains of a reference to a name and contains info.
Constructors
| Attribute | |
Fields
| |
aInfo :: Attribute -> ByteString Source #
A small helper function to extract the info as a
lazy ByteString.
aName :: ConstantPool -> Attribute -> Maybe Text Source #
Extracts the name from the attribute, if it exists in the ConstantPool.
class IsAttribute a where Source #
A class-type that describes a data-type a as an Attribute. Most notable
it provides the fromAttribute' method that enables converting an Attribute
to a data-type a.
Minimal complete definition
Methods
attrName :: Const Text a Source #
The name of the attribute.
fromAttribute :: Attribute -> Either String a Source #
Generate a a from an Attribute.
fromAttribute' :: ConstantPool -> Attribute -> Maybe (Either String a) Source #
Instances
| IsAttribute Code Source # | Code is an Attribute. |
type Code = Code Attribute Source #
Code is redefined with Attribute, as it is recursively containing
Attribute. This is a small hack to fix it.
Create a type dependent on another type b,
used for accessing the correct attrName in IsAttribute.