public static final class ClassReader.AttrIterator
extends java.lang.Object
AttrIterators can be reused for many different iterations, like this:
AttrIterator iter = new AttrIterator();
int fieldCount = reader.getFieldCount();
for (int i = 0; i < fieldCount; i++) {
reader.initFieldAttributeIterator(i, iter);
for (; iter.isValid(); iter.advance()) {
if (iter.getName().equals("ConstantValue")) {
ConstantValueReader cv = new ConstantValueReader(iter);
...
}
}
}
| Constructor and Description |
|---|
AttrIterator()
Create a blank iterator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
advance()
The attribute iterator must be valid.
|
ClassReader |
getClassReader() |
int |
getDataOffset()
The attribute iterator must be valid.
|
int |
getDataSize()
The attribute iterator must be valid.
|
java.lang.String |
getName()
The attribute iterator must be valid.
|
int |
getNameIndex()
The attribute iterator must be valid.
|
int |
getRawOffset()
The attribute iterator must be valid.
|
int |
getRawSize()
The attribute iterator must be valid.
|
int |
getRemainingAttributesCount() |
boolean |
isValid() |
public AttrIterator()
public ClassReader getClassReader()
public int getRawOffset()
public int getRawSize()
public int getDataOffset()
public int getDataSize()
public int getRemainingAttributesCount()
public int getNameIndex()
public java.lang.String getName()
throws InvalidClassFileException
InvalidClassFileExceptionpublic boolean isValid()
public void advance()
The iterator is advanced to the next attribute (which might not exist, so the iterator might become invalid).