Reads a non standard JVMS 'attribute' structure in #b. @param attributePrototypes prototypes of the attributes that must be parsed during the visit of the class. Any attribute whose type is not equal to the type of one the prototypes will not be parsed: its byte array value will be
(
final Attribute[] attributePrototypes,
final String type,
final int offset,
final int length,
final char[] charBuffer,
final int codeAttributeOffset,
final Label[] labels)
| 3240 | * @return the attribute that has been read. |
| 3241 | */ |
| 3242 | private Attribute readAttribute( |
| 3243 | final Attribute[] attributePrototypes, |
| 3244 | final String type, |
| 3245 | final int offset, |
| 3246 | final int length, |
| 3247 | final char[] charBuffer, |
| 3248 | final int codeAttributeOffset, |
| 3249 | final Label[] labels) { |
| 3250 | for (int i = 0; i < attributePrototypes.length; ++i) { |
| 3251 | if (attributePrototypes[i].type.equals(type)) { |
| 3252 | return attributePrototypes[i].read( |
| 3253 | this, offset, length, charBuffer, codeAttributeOffset, labels); |
| 3254 | } |
| 3255 | } |
| 3256 | return new Attribute(type).read(this, offset, length, null, -1, null); |
| 3257 | } |
| 3258 | |
| 3259 | // ----------------------------------------------------------------------------------------------- |
| 3260 | // Utility methods: low level parsing |